[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kioslave/http
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-12-10 12:26:58
[Download RAW message or body]

CVS commit by waba: 

Generate better nonce


  M +2 -3      http.cc   1.599


--- kdelibs/kioslave/http/http.cc  #1.598:1.599
@@ -5183,7 +5183,6 @@ QString HTTPProtocol::createDigestAuth (
   info.qop = "";
 
-  // Use some random # b/n 1 and 100,000 for generating the nonce value...
-  info.cnonce.setNum((1 + static_cast<int>(100000.0*rand()/(RAND_MAX+1.0))));
-  info.cnonce = KCodecs::base64Encode( info.cnonce );
+  // cnonce is recommended to contain about 64 bits of entropy
+  info.cnonce = KApplication::randomString(16).latin1();
 
   // HACK: Should be fixed according to RFC 2617 section 3.2.2


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic