OLD | NEW |
| (Empty) |
1 Index: mozilla/security/nss/lib/util/sectime.c | |
2 =================================================================== | |
3 --- mozilla/security/nss/lib/util/sectime.c (revision 152884) | |
4 +++ mozilla/security/nss/lib/util/sectime.c (working copy) | |
5 @@ -34,14 +34,11 @@ | |
6 * | |
7 * ***** END LICENSE BLOCK ***** */ | |
8 | |
9 -#include "prlong.h" | |
10 #include "prtime.h" | |
11 #include "secder.h" | |
12 #include "secitem.h" | |
13 #include "secerr.h" | |
14 | |
15 -static const PRTime January1st2050 = LL_INIT(0x0008f81e, 0x1b098000); | |
16 - | |
17 static char *DecodeUTCTime2FormattedAscii (SECItem *utcTimeDER, char *format); | |
18 static char *DecodeGeneralizedTime2FormattedAscii (SECItem *generalizedTimeDER,
char *format); | |
19 | |
20 @@ -186,9 +183,11 @@ | |
21 | |
22 SECStatus DER_EncodeTimeChoice(PRArenaPool* arena, SECItem* output, PRTime inpu
t) | |
23 { | |
24 - if (LL_CMP(input, >, January1st2050)) { | |
25 - return DER_TimeToGeneralizedTimeArena(arena, output, input); | |
26 - } else { | |
27 - return DER_TimeToUTCTimeArena(arena, output, input); | |
28 + SECStatus rv; | |
29 + | |
30 + rv = DER_TimeToUTCTimeArena(arena, output, input); | |
31 + if (rv == SECSuccess || PORT_GetError() != SEC_ERROR_INVALID_ARGS) { | |
32 + return rv; | |
33 } | |
34 + return DER_TimeToGeneralizedTimeArena(arena, output, input); | |
35 } | |
OLD | NEW |