[Mono-dev] Mono.Security - ssl certificate datetime parsing causes crash on some cultures. (patch)

Stifu stifu at free.fr
Wed Mar 24 10:12:50 EDT 2010


Looking at the patch, it's done within a "#if NET_2_0" compilation condition.
Shouldn't the same fix be applied in the "#else" just below (ie: replace
"null" with "CultureInfo.InvariantCulture")?


Sebastien Pouliot wrote:
> 
> Fixed on HEAD (r154135), 2-6 (r154136) and 2-4 (r154137)
> Thanks!
> Sebastien
> 
> On Wed, 2010-03-24 at 11:26 +0200, yoni shalom wrote:
>> A crash occurs on windows machines when the process culture info
>> doesn't support the string format representing the x509 certificate
>> timestamp. 
>> Certificate timestamps should be parsed to DateTime using
>> InvariantCulture, which is what the patch does.
>> 
>> 
>> Stack Trace :
>> 
>> 
>> System.Security.Cryptography.CryptographicException: Input data cannot
>> be coded as a valid certificate. ---> System.FormatException: The
>> DateTime represented by the string is not supported in calendar
>> System.Globalization.UmAlQuraCalendar. at
>> System.DateTimeParse.ParseExact(String s, String format,
>> DateTimeFormatInfo dtfi, DateTimeStyles style) at
>> System.DateTime.ParseExact(String s, String format, IFormatProvider
>> provider, DateTimeStyles style) at
>> Mono.Security.ASN1Convert.ToDateTime(ASN1 time) at
>> Mono.Security.X509.X509Certificate.Parse(Byte[] data) --- End of inner
>> exception stack trace --- at
>> Mono.Security.X509.X509Certificate.Parse(Byte[] data) at
>> Mono.Security.X509.X509Certificate..ctor(Byte[] data)
>> 
>> 
>> 
>> 
>> Regards,
>> Yoni Shalom.
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 

-- 
View this message in context: http://n4.nabble.com/Mono-Security-ssl-certificate-datetime-parsing-causes-crash-on-some-cultures-patch-tp1680269p1680607.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list