QByteArray Cipher::parseInitKeyX(QByteArray key)
{
QCA::Initializer init;
+ bool isCBC = false;
+
+ if (key.endsWith(" CBC"))
+ {
+ isCBC = true;
+ key.chop(4);
+ }
if (key.length() != 181)
return QByteArray();
//remove trailing = because mircryption and fish think it's a swell idea.
while (sharedKey.endsWith('=')) sharedKey.chop(1);
+ if (isCBC)
+ sharedKey.prepend("cbc:");
+
bool success = setKey(sharedKey);
if (!success)
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;
}
}
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;
}