diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2014-06-22 01:35:44 -0400 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2014-06-22 19:52:44 -0400 |
commit | b3012c698a086937319ed413a113ed7bec1edd1a (patch) | |
tree | 43c6b0cee80d85c961d12d940b763fdbe5ac93e7 /crypto/x509v3/v3_utl.c | |
parent | d241b804099ce28c053ba988eb5532b1a32dd51e (diff) | |
download | openssl-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.c | 4 |
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); } |