diff options
author | jsing <> | 2015-10-22 15:38:05 +0000 |
---|---|---|
committer | jsing <> | 2015-10-22 15:38:05 +0000 |
commit | ca8f4781e1e4eb0cbcd85f1b12896c0233628d5c (patch) | |
tree | 1b495746849cc766ce39b908351fc1301972fb31 | |
parent | 30ecd9641307fcbba78c89b5fda0fbeae31c7dce (diff) | |
download | openbsd-ca8f4781e1e4eb0cbcd85f1b12896c0233628d5c.tar.gz openbsd-ca8f4781e1e4eb0cbcd85f1b12896c0233628d5c.tar.bz2 openbsd-ca8f4781e1e4eb0cbcd85f1b12896c0233628d5c.zip |
Another change that is needed to restore the previous behaviour of
ASN1_{GENERALIZED,UTC}TIME_set_string(), which allows it to be called
with a NULL pointer.
ok beck@
-rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_time_tm.c | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c index e5ef007bb9..65de0d4f18 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.7 2015/10/22 15:03:19 jsing Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.8 2015/10/22 15:38:05 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -369,7 +369,7 @@ ASN1_UTCTIME_check(ASN1_UTCTIME *d) | |||
369 | int | 369 | int |
370 | ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) | 370 | ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) |
371 | { | 371 | { |
372 | if (s->type != V_ASN1_UTCTIME) | 372 | if (s != NULL && s->type != V_ASN1_UTCTIME) |
373 | return (0); | 373 | return (0); |
374 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME)); | 374 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME)); |
375 | } | 375 | } |
@@ -425,7 +425,7 @@ ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) | |||
425 | int | 425 | int |
426 | ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) | 426 | ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) |
427 | { | 427 | { |
428 | if (s->type != V_ASN1_GENERALIZEDTIME) | 428 | if (s != NULL && s->type != V_ASN1_GENERALIZEDTIME) |
429 | return (0); | 429 | return (0); |
430 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME)); | 430 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME)); |
431 | } | 431 | } |
@@ -443,5 +443,3 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, | |||
443 | return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, | 443 | return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, |
444 | V_ASN1_GENERALIZEDTIME)); | 444 | V_ASN1_GENERALIZEDTIME)); |
445 | } | 445 | } |
446 | |||
447 | |||
diff --git a/src/lib/libssl/src/crypto/asn1/a_time_tm.c b/src/lib/libssl/src/crypto/asn1/a_time_tm.c index e5ef007bb9..65de0d4f18 100644 --- a/src/lib/libssl/src/crypto/asn1/a_time_tm.c +++ b/src/lib/libssl/src/crypto/asn1/a_time_tm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_time_tm.c,v 1.7 2015/10/22 15:03:19 jsing Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.8 2015/10/22 15:38:05 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -369,7 +369,7 @@ ASN1_UTCTIME_check(ASN1_UTCTIME *d) | |||
369 | int | 369 | int |
370 | ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) | 370 | ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) |
371 | { | 371 | { |
372 | if (s->type != V_ASN1_UTCTIME) | 372 | if (s != NULL && s->type != V_ASN1_UTCTIME) |
373 | return (0); | 373 | return (0); |
374 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME)); | 374 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME)); |
375 | } | 375 | } |
@@ -425,7 +425,7 @@ ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) | |||
425 | int | 425 | int |
426 | ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) | 426 | ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) |
427 | { | 427 | { |
428 | if (s->type != V_ASN1_GENERALIZEDTIME) | 428 | if (s != NULL && s->type != V_ASN1_GENERALIZEDTIME) |
429 | return (0); | 429 | return (0); |
430 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME)); | 430 | return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME)); |
431 | } | 431 | } |
@@ -443,5 +443,3 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, | |||
443 | return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, | 443 | return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec, |
444 | V_ASN1_GENERALIZEDTIME)); | 444 | V_ASN1_GENERALIZEDTIME)); |
445 | } | 445 | } |
446 | |||
447 | |||