From: Bas Pape Date: Sun, 25 Aug 2013 13:52:40 +0000 (+0200) Subject: Properly detect CBC in key negotiation. X-Git-Tag: 0.9.1~15 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=ccd0c6083b0e9fbd939e637711eea7d23fd90033 Properly detect CBC in key negotiation. When FiSH starts a key exchange, it appends CBC to the key to indicate that it wants to use CBC rather than EBC. The cipher code simply rejected this key. --- diff --git a/src/core/cipher.cpp b/src/core/cipher.cpp index 9ea9c130..7cc75d0a 100644 --- a/src/core/cipher.cpp +++ b/src/core/cipher.cpp @@ -170,6 +170,13 @@ QByteArray Cipher::initKeyExchange() 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(); @@ -198,6 +205,9 @@ QByteArray Cipher::parseInitKeyX(QByteArray key) //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)