diff options
author | beck <> | 2024-03-25 07:02:22 +0000 |
---|---|---|
committer | beck <> | 2024-03-25 07:02:22 +0000 |
commit | d62e5f1b93f3d9f6eb2bad2c89d2d5e33b059bf2 (patch) | |
tree | c6c73a2af3fbddb1f3f77c2b3d165679674645f7 | |
parent | 656bda5a1cf11b36c07317e2a50c9b772aa6ebf1 (diff) | |
download | openbsd-d62e5f1b93f3d9f6eb2bad2c89d2d5e33b059bf2.tar.gz openbsd-d62e5f1b93f3d9f6eb2bad2c89d2d5e33b059bf2.tar.bz2 openbsd-d62e5f1b93f3d9f6eb2bad2c89d2d5e33b059bf2.zip |
Fix time conversion that broke regress.
ok tb@
-rw-r--r-- | src/lib/libcrypto/ts/ts_rsp_sign.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_sign.c b/src/lib/libcrypto/ts/ts_rsp_sign.c index 8eb687aab1..dc8241d2be 100644 --- a/src/lib/libcrypto/ts/ts_rsp_sign.c +++ b/src/lib/libcrypto/ts/ts_rsp_sign.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ts_rsp_sign.c,v 1.33 2024/03/24 11:30:12 beck Exp $ */ | 1 | /* $OpenBSD: ts_rsp_sign.c,v 1.34 2024/03/25 07:02:22 beck Exp $ */ |
2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL | 2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL |
3 | * project 2002. | 3 | * project 2002. |
4 | */ | 4 | */ |
@@ -990,7 +990,7 @@ static ASN1_GENERALIZEDTIME * | |||
990 | TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, | 990 | TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, |
991 | time_t sec, long usec, unsigned precision) | 991 | time_t sec, long usec, unsigned precision) |
992 | { | 992 | { |
993 | struct tm *tm = NULL; | 993 | struct tm tm; |
994 | char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS]; | 994 | char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS]; |
995 | char usecstr[TS_MAX_CLOCK_PRECISION_DIGITS + 2]; | 995 | char usecstr[TS_MAX_CLOCK_PRECISION_DIGITS + 2]; |
996 | char *p; | 996 | char *p; |
@@ -999,7 +999,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, | |||
999 | if (precision > TS_MAX_CLOCK_PRECISION_DIGITS) | 999 | if (precision > TS_MAX_CLOCK_PRECISION_DIGITS) |
1000 | goto err; | 1000 | goto err; |
1001 | 1001 | ||
1002 | if (OPENSSL_gmtime(&sec, tm) == NULL) | 1002 | if (OPENSSL_gmtime(&sec, &tm) == NULL) |
1003 | goto err; | 1003 | goto err; |
1004 | 1004 | ||
1005 | /* | 1005 | /* |
@@ -1037,8 +1037,8 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, | |||
1037 | } | 1037 | } |
1038 | rv = snprintf(genTime_str, sizeof(genTime_str), | 1038 | rv = snprintf(genTime_str, sizeof(genTime_str), |
1039 | "%04d%02d%02d%02d%02d%02d%sZ", | 1039 | "%04d%02d%02d%02d%02d%02d%sZ", |
1040 | tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, | 1040 | tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, |
1041 | tm->tm_hour, tm->tm_min, tm->tm_sec, usecstr); | 1041 | tm.tm_hour, tm.tm_min, tm.tm_sec, usecstr); |
1042 | if (rv < 0 || rv >= sizeof(genTime_str)) | 1042 | if (rv < 0 || rv >= sizeof(genTime_str)) |
1043 | goto err; | 1043 | goto err; |
1044 | 1044 | ||