[PATCH] fix '!' in scrambled passwords

Dirk Mueller <[email protected]>
Newsgroups gmane.comp.kde.devel.kmail
Message-ID <[email protected]>
Hi, 

with the recent utf8 decoder fix in Qt (CVE-2007-0242), kmail fails to restore 
passwords with '!' correctly from kconfig. the issue is that '!' is scrambled 
to 0xfffe - the unicode BOM. which is now rejected by the utf8-decoder. 

the only workaround I could think of without breaking it for everyone is to 
not encode the '!' character. this is a small information leak, but I can't 
see a way to make it working without some breakage. 

for KDE4 I hope the stupid, stupid, ultrastupid scrambler is fixed to not 
produce BOMs (0xffff, 0xffffe). 

ok?


Dirk

_______________________________________________
KMail developers mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kmail-devel
kmail-utf8.diff (text/x-diff, 576 B)
Index: kmaccount.cpp
===================================================================
--- kmaccount.cpp	(revision 656120)
+++ kmaccount.cpp	(working copy)
@@ -399,7 +399,9 @@ QString KMAccount::encryptStr(const QStr
 {
   QString result;
   for (uint i = 0; i < aStr.length(); i++)
-    result += (aStr[i].unicode() < 0x20) ? aStr[i] :
+    /* yes, no typo. can't encode ' ' or '!' because
+       they're the unicode BOM. stupid scrambling. stupid. */
+    result += (aStr[i].unicode() <= 0x21 ) ? aStr[i] :
       QChar(0x1001F - aStr[i].unicode());
   return result;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.