Do some basic self-checks when initializing the crypto backend.

This commit is contained in:
Felix Geyer 2014-06-15 11:17:40 +02:00
parent b417bf9187
commit 0d6117bf4c
23 changed files with 143 additions and 27 deletions

View file

@ -25,6 +25,7 @@
#include "crypto/Crypto.h"
#include "gui/Application.h"
#include "gui/MainWindow.h"
#include "gui/MessageBox.h"
int main(int argc, char** argv)
{
@ -38,7 +39,14 @@ int main(int argc, char** argv)
// don't set organizationName as that changes the return value of
// QDesktopServices::storageLocation(QDesktopServices::DataLocation)
Crypto::init();
if (!Crypto::init()) {
QString error = QCoreApplication::translate("Main",
"Fatal error while testing the cryptographic functions.");
error.append("\n");
error.append(Crypto::errorString());
MessageBox::critical(Q_NULLPTR, QCoreApplication::translate("Main", "KeePassX - Error"), error);
return 1;
}
QCommandLineParser parser;
parser.setApplicationDescription(QCoreApplication::translate("main", "KeePassX - cross-platform password manager"));