aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509v3/v3_utl.c
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2014-06-22 01:35:44 -0400
committerViktor Dukhovni <openssl-users@dukhovni.org>2014-06-22 19:52:44 -0400
commitb3012c698a086937319ed413a113ed7bec1edd1a (patch)
tree43c6b0cee80d85c961d12d940b763fdbe5ac93e7 /crypto/x509v3/v3_utl.c
parentd241b804099ce28c053ba988eb5532b1a32dd51e (diff)
downloadopenssl-b3012c698a086937319ed413a113ed7bec1edd1a.zip
openssl-b3012c698a086937319ed413a113ed7bec1edd1a.tar.gz
openssl-b3012c698a086937319ed413a113ed7bec1edd1a.tar.bz2
Drop hostlen from X509_VERIFY_PARAM_ID.
Just store NUL-terminated strings. This works better when we add support for multiple hostnames.
Diffstat (limited to 'crypto/x509v3/v3_utl.c')
-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 6e91ac9..5401d90 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);
}