Fix hostname validation in the command-line tool to honour negative return values.
authorEmilia Kasper <emilia@openssl.org>
Thu, 5 Feb 2015 15:38:54 +0000 (16:38 +0100)
committerEmilia Kasper <emilia@openssl.org>
Tue, 10 Feb 2015 14:36:03 +0000 (15:36 +0100)
commit95929797a01eb4ad42694f1f848bdbb9decbcefe
tree56cf46001e6839c97bf5a172321afa23ea24e930
parentbcfaa4eeee5bbb2ddf9545e41b62cbfc10ad60b0
Fix hostname validation in the command-line tool to honour negative return values.

Specifically, an ASN.1 NumericString in the certificate CN will fail UTF-8 conversion
and result in a negative return value, which the "x509 -checkhost" command-line option
incorrectly interpreted as success.

Also update X509_check_host docs to reflect reality.

Thanks to Sean Burford (Google) for reporting this issue.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 0923e7df9eafec6db9c75405d7085ec8581f01bd)
apps/apps.c
crypto/x509v3/v3_utl.c
doc/crypto/X509_check_host.pod