summaryrefslogtreecommitdiffstats
path: root/pica-client/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client/main.cpp')
-rw-r--r--pica-client/main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/pica-client/main.cpp b/pica-client/main.cpp
index 55dc10c..2cfa2d4 100644
--- a/pica-client/main.cpp
+++ b/pica-client/main.cpp
@@ -11,6 +11,7 @@
#include <QMessageBox>
#include <QString>
#include <QIcon>
+#include "openssltool.h"
//globals
QString config_dir;
@@ -239,6 +240,20 @@ static bool create_config_dir()
else
update_database();
+ if (!QFile::exists(config_dir + QDir::separator() + PICA_CLIENT_DHPARAMFILE))
+ {
+ OpenSSLTool osslt;
+ msgBox.setText(QString(QObject::tr("Diffie-Hellman parameters will be generated. Please wait. This process can take several minutes...")));
+ msgBox.exec();
+
+ if (!osslt.GenDHParam(4096, config_dir + QDir::separator() + PICA_CLIENT_DHPARAMFILE))
+ {
+ msgBox.setText(QString(QObject::tr("Failed to generate Diffie-Hellman parameters")));
+ msgBox.exec();
+ return false;
+ }
+ }
+
return true;
}