summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2014-06-22 01:35:44 -0400
committerDr. Stephen Henson <steve@openssl.org>2014-06-25 18:21:35 +0100
commitd93edc0aab98377f42dd19312248597a018a7889 (patch)
treef25e825b81df3313b5068cd9af5adf831bedf7df /crypto/x509v3
parent609daababb4dc614f23436c21bfb1691e6d3eb89 (diff)
Drop hostlen from X509_VERIFY_PARAM_ID.
Just store NUL-terminated strings. This works better when we add support for multiple hostnames. (cherry picked from commit b3012c698a086937319ed413a113ed7bec1edd1a)
Diffstat (limited to 'crypto/x509v3')
-rw-r--r--crypto/x509v3/v3_utl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c
index 6e91ac9816..5401d90e10 100644
--- a/crypto/x509v3/v3_utl.c
+++ b/crypto/x509v3/v3_utl.c
@@ -972,6 +972,10 @@ static int do_x509_check(X509 *x, const unsigned char *chk, size_t chklen,
int X509_check_host(X509 *x, const unsigned char *chk, size_t chklen,
unsigned int flags)
{
+ if (chklen == 0)
+ chklen = chk ? strlen((char *)chk) : 0;
+ else if (chk && memchr(chk, '\0', chklen))
+ return 0;
return do_x509_check(x, chk, chklen, flags, GEN_DNS);
}