From 15253d1995ea49b114ef5c627e15b661dbd602b2 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 30 Sep 2012 19:41:17 +0200 Subject: add some trivial authentication --- distfoldd/main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'distfoldd/main.cc') diff --git a/distfoldd/main.cc b/distfoldd/main.cc index 48d52a5..01ad11c 100644 --- a/distfoldd/main.cc +++ b/distfoldd/main.cc @@ -1,6 +1,7 @@ #include #include #include +#include #include "distfolder.h" #include "localkey.h" @@ -13,6 +14,14 @@ int main(int argc, char *argv[]) a.setApplicationName("distfoldd"); a.setApplicationVersion("0.2"); + QCA::Initializer qca; + qsrand(uint(QDateTime::currentMSecsSinceEpoch() & 0xFFFF)); + + if (!QCA::isSupported("cert,pkey,rsa,sha1,hmac(sha1),random")) { + qWarning() << "QCA was not build with the OpenSSL plugin"; + return EXIT_FAILURE; + } + if (!LocalKey::setupLocalKey()) { qWarning() << "Failed to setup local private key"; return EXIT_FAILURE; @@ -24,6 +33,7 @@ int main(int argc, char *argv[]) QUuid uuid(settings.value("uuid").toString()); QString path = settings.value("path").toString(); DistFolder *f = new DistFolder(uuid, path); + f->setPassword(settings.value("password", uuid.toString()).toString()); f->setReadOnlySync(settings.value("ro", false).toBool()); f->setPullMode(settings.value("pull", false).toBool()); f->setCompress(settings.value("compress", true).toBool()); -- cgit v1.2.3