test: Add build system support and a main function for unit tests
[quassel.git] / src / core / cipher.cpp
index 9bfc787..c5a40c2 100644 (file)
@@ -30,9 +30,6 @@ Cipher::Cipher(QByteArray key, QString cipherType)
 }
 
 
-Cipher::~Cipher()
-{}
-
 bool Cipher::setKey(QByteArray key)
 {
     if (key.isEmpty()) {
@@ -56,7 +53,8 @@ bool Cipher::setKey(QByteArray key)
 //    if(Preferences::self()->encryptionType())
 //      m_cbc = true;
 //    else
-        m_cbc = false;
+//    default to CBC
+        m_cbc = true;
         m_key = key;
     }
     return true;
@@ -117,7 +115,6 @@ QByteArray Cipher::decrypt(QByteArray cipherText)
     // (if cbc and no error we parse cbc) || (if ecb and error we parse cbc)
     if ((m_cbc && !error) || (!m_cbc && error))
     {
-        cipherText = cipherText;
         temp = blowfishCBC(cipherText, false);
 
         if (temp == cipherText)