Skip to content

Commit 86eb82d

Browse files
authored
Add option to enable CDoc2 encryption (#1213)
* Add option to enable CDoc2 encryption CDOC-3 Signed-off-by: Raul Metsma <[email protected]> * Update to new UI Signed-off-by: Raul Metsma <[email protected]> * Enc SSL cert Signed-off-by: Raul Metsma <[email protected]> --------- Signed-off-by: Raul Metsma <[email protected]>
1 parent e950292 commit 86eb82d

31 files changed

+1446
-1590
lines changed

client/Application.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,6 @@ class DigidocConf final: public digidoc::XmlConfCurrent
148148
#ifdef Q_OS_MAC
149149
std::string TSLCache() const final
150150
{ return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation).toStdString(); }
151-
152-
void setProxyHost( const std::string &host ) final
153-
{ Settings::PROXY_HOST = host; }
154-
void setProxyPort( const std::string &port ) final
155-
{ Settings::PROXY_PORT = port; }
156-
void setProxyUser( const std::string &user ) final
157-
{ Settings::PROXY_USER = user; }
158-
void setProxyPass( const std::string &pass ) final
159-
{ Settings::PROXY_PASS = pass; }
160151
#endif
161152

162153
std::vector<digidoc::X509Cert> TSCerts() const final
@@ -609,10 +600,6 @@ QVariant Application::confValue( ConfParameter parameter, const QVariant &value
609600
switch( parameter )
610601
{
611602
case SiVaUrl: r = i->verifyServiceUri().c_str(); break;
612-
case ProxyHost: r = i->proxyHost().c_str(); break;
613-
case ProxyPort: r = i->proxyPort().c_str(); break;
614-
case ProxyUser: r = i->proxyUser().c_str(); break;
615-
case ProxyPass: r = i->proxyPass().c_str(); break;
616603
case TSAUrl: r = i->TSUrl().c_str(); break;
617604
case TSLUrl: r = i->TSLUrl().c_str(); break;
618605
case TSLCache: r = i->TSLCache().c_str(); break;
@@ -884,33 +871,6 @@ int Application::run()
884871
return exec();
885872
}
886873

887-
void Application::setConfValue( ConfParameter parameter, const QVariant &value )
888-
{
889-
try
890-
{
891-
auto *i = dynamic_cast<digidoc::XmlConfCurrent*>(digidoc::Conf::instance());
892-
if(!i)
893-
return;
894-
QByteArray v = value.toString().toUtf8();
895-
switch( parameter )
896-
{
897-
case ProxyHost: i->setProxyHost( v.isEmpty()? std::string() : v.constData() ); break;
898-
case ProxyPort: i->setProxyPort( v.isEmpty()? std::string() : v.constData() ); break;
899-
case ProxyUser: i->setProxyUser( v.isEmpty()? std::string() : v.constData() ); break;
900-
case ProxyPass: i->setProxyPass( v.isEmpty()? std::string() : v.constData() ); break;
901-
case TSAUrl:
902-
case SiVaUrl:
903-
case TSLCerts:
904-
case TSLUrl:
905-
case TSLCache: break;
906-
}
907-
}
908-
catch( const digidoc::Exception &e )
909-
{
910-
showWarning(tr("Caught exception!"), e);
911-
}
912-
}
913-
914874
void Application::showClient(const QStringList &params, bool crypto, bool sign, bool newWindow)
915875
{
916876
if(sign)

client/Application.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ class Application final: public BaseApplication
4646
enum ConfParameter : quint8
4747
{
4848
SiVaUrl,
49-
ProxyHost,
50-
ProxyPort,
51-
ProxyUser,
52-
ProxyPass,
5349
TSAUrl,
5450
TSLUrl,
5551
TSLCerts,
@@ -77,7 +73,6 @@ class Application final: public BaseApplication
7773
static QWidget* mainWindow();
7874
static void openHelp();
7975
static uint readTSLVersion(const QString &path);
80-
static void setConfValue( ConfParameter parameter, const QVariant &value );
8176
static void showClient(const QStringList &params = {}, bool crypto = false, bool sign = false, bool newWindow = false);
8277
static void updateTSLCache(const QDateTime &tslTime);
8378

client/Settings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ const Option<bool> Settings::CDOC2_DEFAULT { QStringLiteral("CDOC2-DEFAULT"), fa
3030
const Option<bool> Settings::CDOC2_NOTIFICATION { QStringLiteral("CDOC2-NOTIFICATION"), false };
3131
const Option<bool> Settings::CDOC2_USE_KEYSERVER { QStringLiteral("CDOC2-USE-KEYSERVER"), true };
3232
const Option<QString, QString (*)()> Settings::CDOC2_DEFAULT_KEYSERVER { QStringLiteral("CDOC2-DEFAULT-KEYSERVER"), [] {
33-
return Application::confValue(QLatin1String("CDOC2-DEFAULT-KEYSERVER")).toString(QStringLiteral("ria-test"));
33+
return Application::confValue(QLatin1String("CDOC2-DEFAULT-KEYSERVER"))
34+
.toString(QStringLiteral("00000000-0000-0000-0000-000000000000"));
3435
}};
36+
const Option<QString> Settings::CDOC2_UUID { QStringLiteral("CDOC2-UUID"), QStringLiteral("00000000-0000-0000-0000-000000000002") };
3537
const Option<QString> Settings::CDOC2_GET { QStringLiteral("CDOC2-GET"), QStringLiteral(CDOC2_GET_URL) };
3638
const Option<QByteArray> Settings::CDOC2_GET_CERT { QStringLiteral("CDOC2-GET-CERT") };
3739
const Option<QString> Settings::CDOC2_POST { QStringLiteral("CDOC2-POST"), QStringLiteral(CDOC2_POST_URL) };

client/Settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ struct Settings
4646
void operator =(const T &value) const {
4747
operator =(QVariant(value));
4848
}
49+
void operator() (const T &value) const {
50+
operator =(QVariant(value));
51+
}
4952
template <typename P = T, typename = if_QString<P>>
5053
void operator =(const std::string &value) const {
5154
operator =(QString::fromStdString(value));
@@ -101,6 +104,7 @@ struct Settings
101104
static const Option<bool> CDOC2_NOTIFICATION;
102105
static const Option<bool> CDOC2_USE_KEYSERVER;
103106
static const Option<QString, QString (*)()> CDOC2_DEFAULT_KEYSERVER;
107+
static const Option<QString> CDOC2_UUID;
104108
static const Option<QString> CDOC2_GET;
105109
static const Option<QByteArray> CDOC2_GET_CERT;
106110
static const Option<QString> CDOC2_POST;

client/dialogs/FirstRun.ui

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -849,21 +849,21 @@ border-radius: 3px;</string>
849849
<widget class="QPushButton" name="signSkip">
850850
<property name="geometry">
851851
<rect>
852-
<x>436</x>
852+
<x>363</x>
853853
<y>540</y>
854-
<width>151</width>
854+
<width>298</width>
855855
<height>25</height>
856856
</rect>
857857
</property>
858858
<property name="minimumSize">
859859
<size>
860-
<width>151</width>
860+
<width>298</width>
861861
<height>25</height>
862862
</size>
863863
</property>
864864
<property name="maximumSize">
865865
<size>
866-
<width>151</width>
866+
<width>298</width>
867867
<height>25</height>
868868
</size>
869869
</property>
@@ -1395,21 +1395,21 @@ border-radius: 3px;</string>
13951395
<widget class="QPushButton" name="cryptoSkip">
13961396
<property name="geometry">
13971397
<rect>
1398-
<x>436</x>
1398+
<x>363</x>
13991399
<y>540</y>
1400-
<width>151</width>
1400+
<width>298</width>
14011401
<height>25</height>
14021402
</rect>
14031403
</property>
14041404
<property name="minimumSize">
14051405
<size>
1406-
<width>151</width>
1406+
<width>298</width>
14071407
<height>25</height>
14081408
</size>
14091409
</property>
14101410
<property name="maximumSize">
14111411
<size>
1412-
<width>151</width>
1412+
<width>298</width>
14131413
<height>25</height>
14141414
</size>
14151415
</property>

client/dialogs/MobileProgress.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ background-color: #2F70B6;
138138
<number>30</number>
139139
</property>
140140
<property name="sizeConstraint">
141-
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
141+
<enum>QLayout::SetFixedSize</enum>
142142
</property>
143143
<property name="leftMargin">
144144
<number>40</number>

0 commit comments

Comments
 (0)