GeneralizedTime setting fixes.
authorDr. Stephen Henson <steve@openssl.org>
Sat, 8 May 1999 11:08:25 +0000 (11:08 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sat, 8 May 1999 11:08:25 +0000 (11:08 +0000)
crypto/asn1/a_gentm.c
crypto/asn1/a_time.c

index 70c99ef441964da39d147fe700b9466a3cb6e2b9..84440cce6c74ebf2200e2dd7f68083aff6f46294 100644 (file)
@@ -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;
index c19b7b2cac58a1272b3a852f374c31a2f5ca533a..718992d0a574fd6663987345f9c4d63faa3d99c7 100644 (file)
@@ -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);
        }