diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-09-30 17:16:58 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-09-30 17:16:58 +0200 |
commit | c8f89279026af6bb03ef3d66e44e859fb7208925 (patch) | |
tree | 112fe122309ba40e109714878937b8a59c4b409c | |
parent | 1b6255cc2b333e7721f8ea3b387ffe7b23e9aa24 (diff) | |
download | distfold-c8f89279026af6bb03ef3d66e44e859fb7208925.tar.gz distfold-c8f89279026af6bb03ef3d66e44e859fb7208925.zip |
autocreate key dir
-rw-r--r-- | distfoldd/localkey.cc | 6 | ||||
-rw-r--r-- | distfoldd/localkey.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/distfoldd/localkey.cc b/distfoldd/localkey.cc index 9855ff4..f104afd 100644 --- a/distfoldd/localkey.cc +++ b/distfoldd/localkey.cc @@ -19,6 +19,12 @@ bool LocalKey::setupLocalKey() if (local_key_dir.exists("server.crt") && local_key_dir.exists("server.key")) { return true; } + if (!local_key_dir.exists()) { + if (!local_key_dir.mkpath(local_key_dir.absolutePath())) { + qWarning() << "Could not create local key directory"; + return false; + } + } QCA::Initializer qca; diff --git a/distfoldd/localkey.h b/distfoldd/localkey.h index ad23091..9d9e6a8 100644 --- a/distfoldd/localkey.h +++ b/distfoldd/localkey.h @@ -10,8 +10,6 @@ private: public: static QString localKeyDir(); - static QString localCertPath(); - static QString localPrivateKeyPath(); static bool setupLocalKey(); }; |