check for qca provider plugin, fixes #1045
[quassel.git] / src / core / cipher.cpp
index 195936c..92b8fad 100644 (file)
@@ -13,6 +13,7 @@
 */
 
 #include "cipher.h"
+#include "logger.h"
 
 
 Cipher::Cipher()
@@ -449,3 +450,14 @@ QByteArray Cipher::b64ToByte(QByteArray text)
   }
   return decoded;
 }
+
+bool Cipher::neededFeaturesAvailable()
+{
+  QCA::Initializer init;
+
+  if (QCA::isSupported("blowfish-ecb") && QCA::isSupported("blowfish-cbc") && QCA::isSupported("dh"))
+    return true;
+
+  qWarning() << "QCA provider plugin not found. It is usually provided by the qca-ossl plugin.";
+  return false;
+}