diff options
-rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c index 9faa4ba5dc..283a5c4453 100644 --- a/src/lib/libcrypto/asn1/a_time_tm.c +++ b/src/lib/libcrypto/asn1/a_time_tm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_time_tm.c,v 1.38 2024/04/11 06:49:19 tb Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.39 2024/05/03 18:15:27 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -293,7 +293,6 @@ asn1_time_parse_cbs(const CBS *cbs, int is_gentime, struct tm *out_tm) | |||
293 | int | 293 | int |
294 | ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) | 294 | ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) |
295 | { | 295 | { |
296 | struct tm tml, *tmp = tm ? tm : &tml; | ||
297 | int type = 0; | 296 | int type = 0; |
298 | CBS cbs; | 297 | CBS cbs; |
299 | 298 | ||
@@ -306,7 +305,7 @@ ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) | |||
306 | type = V_ASN1_UTCTIME; | 305 | type = V_ASN1_UTCTIME; |
307 | if (CBS_len(&cbs) == GENTIME_LENGTH) | 306 | if (CBS_len(&cbs) == GENTIME_LENGTH) |
308 | type = V_ASN1_GENERALIZEDTIME; | 307 | type = V_ASN1_GENERALIZEDTIME; |
309 | if (asn1_time_parse_cbs(&cbs, type == V_ASN1_GENERALIZEDTIME, tmp)) { | 308 | if (asn1_time_parse_cbs(&cbs, type == V_ASN1_GENERALIZEDTIME, tm)) { |
310 | if (mode != 0 && mode != type) | 309 | if (mode != 0 && mode != type) |
311 | return -1; | 310 | return -1; |
312 | return type; | 311 | return type; |