Check for invalid input in encrypted buffers
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 21 Oct 2014 19:20:07 +0000 (21:20 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 21 Oct 2014 19:38:17 +0000 (21:38 +0200)
commit6b2d80b85a521392b3a34c902ab8ef85899f9cb6
tree1ea58da9f1ba0ca72b9887ceb27762519830a7ca
parentaccc6de77a88ad87c5cea773560633c81b25a645
Check for invalid input in encrypted buffers

The ECB Blowfish decryption function assumed that encrypted input would
always come in blocks of 12 characters, as specified. However, buggy
clients or annoying people may not adhere to that assumption, causing
the core to crash while trying to process the invalid base64 input.

With this commit we make sure that we're not overstepping the bounds of
the input string while decoding it; instead we bail out early and display
the original input. Fixes #1314.

Thanks to Tucos for finding that one!
src/core/cipher.cpp