Drop hostlen from X509_VERIFY_PARAM_ID.

Just store NUL-terminated strings.  This works better when we add
support for multiple hostnames.
This commit is contained in:
Viktor Dukhovni
2014-06-22 01:35:44 -04:00
parent d241b80409
commit b3012c698a
4 changed files with 8 additions and 8 deletions

View File

@@ -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);
}