0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

use stringstream

This commit is contained in:
Dwight 2010-05-06 15:46:11 -04:00
parent fba2392bb7
commit 53ca30be25
2 changed files with 12 additions and 11 deletions

0
buildscripts/errorcodes.py Normal file → Executable file
View File

View File

@ -307,20 +307,21 @@ namespace mongo {
string ha1 = user["pwd"].str();
string ha2 = md5simpledigest( (string)"GET" + ":" + parms["uri"] );
string r = ha1 + ":" + parms["nonce"];
stringstream r;
r << ha1 << ':' << parms["nonce"];
if ( parms["nc"].size() && parms["cnonce"].size() && parms["qop"].size() ){
r += ":";
r += parms["nc"];
r += ":";
r += parms["cnonce"];
r += ":";
r += parms["qop"];
r << ':';
r << parms["nc"];
r << ':';
r << parms["cnonce"];
r << ':';
r << parms["qop"];
}
r += ":";
r += ha2;
r = md5simpledigest( r );
r << ':';
r << ha2;
string r1 = md5simpledigest( r.str() );
if ( r == parms["response"] )
if ( r1 == parms["response"] )
return true;
}