warvair / as3crypto

Automatically exported from code.google.com/p/as3crypto
0 stars 0 forks source link

X509Certificate.isSigned does not seem to respect timezones #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Be in a timezone different from GMT (PST, in my case)
2. Get your new certificate signed and installed on server
3. Connect to that server using TLSSocket

What is the expected output? What do you see instead?

Expected certificate to be validated, however as3crypto decided that it is 
approx 6.5hrs in the 
future so it can't validate it. Now, if we'll take at a difference between GMT 
and PST at the moment, 
it is 7 hours. So, my guess is that as3crypto did not get this issue into 
account when was validating 
certificate's 'NotBefore'.

Original issue reported on code.google.com by yra...@gmail.com on 26 Apr 2009 at 10:08

GoogleCodeExporter commented 9 years ago
I fixed this in my code by changing how date variables get set:

line 48 of UTCTime.as:
date = new Date(Date.UTC(year, month-1, day, hour, minute));

As far as I can tell, the time strings that get sent in are in UTC (the 'Z' 
character
at the end indicates UTC).  Perhaps this is how the date parsing should be done 
always.

Original comment by SilentCh...@gmail.com on 1 Sep 2009 at 9:55

Attachments: