From: Bas Pape Date: Sun, 25 Aug 2013 13:52:40 +0000 (+0200) Subject: Properly detect CBC in key negotiation. X-Git-Tag: 0.10-beta1~126 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=d921c7e14b3bd35d2b9f022ae88b90d83b97d568;ds=sidebyside 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)