projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 2:
310dc3a
)
Merge pull request #96 from TheOneRing/qca_qt5
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 23 Oct 2014 21:48:57 +0000
(23:48 +0200)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 23 Oct 2014 21:48:57 +0000
(23:48 +0200)
make quassel compile with qca enabled on qt5
src/core/cipher.cpp
patch
|
blob
|
history
diff --git
a/src/core/cipher.cpp
b/src/core/cipher.cpp
index
3f299f4
..
a8232a3
100644
(file)
--- a/
src/core/cipher.cpp
+++ b/
src/core/cipher.cpp
@@
-364,6
+364,10
@@
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction)
}
else
{
+ // ECB Blowfish encodes in blocks of 12 chars, so anything else is malformed input
+ if ((temp.length() % 12) != 0)
+ return cipherText;
+
temp = b64ToByte(temp);
while ((temp.length() % 8) != 0) temp.append('\0');
}
@@
-376,8
+380,13
@@
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction)
if (!cipher.ok())
return cipherText;
- if (direction)
+ if (direction) {
+ // Sanity check
+ if ((temp2.length() % 8) != 0)
+ return cipherText;
+
temp2 = byteToB64(temp2);
+ }
return temp2;
}