diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_utl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c index 04c789922b..67ecc81a44 100644 --- a/src/lib/libcrypto/x509v3/v3_utl.c +++ b/src/lib/libcrypto/x509v3/v3_utl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: v3_utl.c,v 1.26 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: v3_utl.c,v 1.27 2018/03/20 16:16:59 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -1015,7 +1015,9 @@ int X509_check_host(X509 *x, const char *chk, size_t chklen, | |||
1015 | { | 1015 | { |
1016 | if (chk == NULL) | 1016 | if (chk == NULL) |
1017 | return -2; | 1017 | return -2; |
1018 | if (memchr(chk, '\0', chklen)) | 1018 | if (chklen == 0) |
1019 | chklen = strlen(chk); | ||
1020 | else if (memchr(chk, '\0', chklen)) | ||
1019 | return -2; | 1021 | return -2; |
1020 | return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername); | 1022 | return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername); |
1021 | } | 1023 | } |
@@ -1025,7 +1027,9 @@ int X509_check_email(X509 *x, const char *chk, size_t chklen, | |||
1025 | { | 1027 | { |
1026 | if (chk == NULL) | 1028 | if (chk == NULL) |
1027 | return -2; | 1029 | return -2; |
1028 | if (memchr(chk, '\0', chklen)) | 1030 | if (chklen == 0) |
1031 | chklen = strlen(chk); | ||
1032 | else if (memchr(chk, '\0', chklen)) | ||
1029 | return -2; | 1033 | return -2; |
1030 | return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL); | 1034 | return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL); |
1031 | } | 1035 | } |