[Mono-dev] System.dll few patches for review

Andreas Nahr ClassDevelopment at A-SoftTech.com
Thu Oct 5 15:35:45 EDT 2006


Sorry if this is already handled, just looked over the list and found this 
bug:

>> Index: System.Net/DigestClient.cs
>> ===================================================================
>> --- System.Net/DigestClient.cs (revision 66034)
>> +++ System.Net/DigestClient.cs (working copy)
>> @@ -248,9 +248,9 @@
>>  return false;
>>  }
>>
>> - // build the hash object (only MD5 is defined in RFC2617)
>> - if ((parser.Algorithm == null) || (parser.Algorithm.ToUpper 
>> ().StartsWith ("MD5")))
>> - hash = HashAlgorithm.Create ("MD5");
>> + // build the hash object (only MD5 is defined in RFC2617)
>> + if ((parser.Algorithm == null) || (parser.Algorithm.ToUpper 
>> ().StartsWith ("MD5")))
>> + hash = MD5.Create ();
>>
>>  return true;
>>  }

Algorithm.ToUpper ().StartsWith ("MD5"))) is most likely wrong because the 
code is doing a culture-sensitive uppercasing.
You should use something like ToUpperInvariant or pass the Invariant Culture 
(or better if possible: one of the case-insensitive compares)

I didn't look into the relevant classes, but there may be more similar 
occurences of that problem.

mfg
Andreas 




More information about the Mono-devel-list mailing list