mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
GeneralizedTime setting fixes.
This commit is contained in:
parent
8cf6522820
commit
7e797a06c3
@ -198,7 +198,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
s->data=(unsigned char *)p;
|
||||
}
|
||||
|
||||
sprintf(p,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year,
|
||||
sprintf(p,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
|
||||
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
||||
s->length=strlen(p);
|
||||
s->type=V_ASN1_GENERALIZEDTIME;
|
||||
|
@ -102,7 +102,7 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
|
||||
#else
|
||||
ts=gmtime(&t);
|
||||
#endif
|
||||
if((ts->tm_year >= 1950) && (ts->tm_year < 2050))
|
||||
if((ts->tm_year >= 50) && (ts->tm_year < 150))
|
||||
return ASN1_UTCTIME_set(s, t);
|
||||
return ASN1_GENERALIZEDTIME_set(s,t);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user