X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcipher.cpp;h=88a4c506229bf76adff6ef7c968ba20b76bd3d2f;hb=39328183a6a87c6eb10a9dbbffcd5d65bf154a1f;hp=7d1fe46a5e7be506d06310e188404bab8c8b8253;hpb=8b5ecd226f9208af3074b33d3b7cf5e14f55b138;p=quassel.git diff --git a/src/core/cipher.cpp b/src/core/cipher.cpp index 7d1fe46a..88a4c506 100644 --- a/src/core/cipher.cpp +++ b/src/core/cipher.cpp @@ -13,7 +13,7 @@ */ #include "cipher.h" -#include "logger.h" +#include "logmessage.h" Cipher::Cipher() { @@ -56,7 +56,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 +118,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) @@ -429,13 +429,13 @@ QByteArray Cipher::byteToB64(QByteArray text) right += v; for (int i = 0; i < 6; i++) { - encoded.append(base64.at(right & 0x3F).toAscii()); + encoded.append(base64.at(right & 0x3F).toLatin1()); right = right >> 6; } - //TODO make sure the .toascii doesn't break anything + //TODO make sure the .toLatin1 doesn't break anything for (int i = 0; i < 6; i++) { - encoded.append(base64.at(left & 0x3F).toAscii()); + encoded.append(base64.at(left & 0x3F).toLatin1()); left = left >> 6; } }