[crypto] Allow for X.509 certificates with no common name

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-05-08 10:36:09 +01:00
parent 6ba7fb7c5c
commit 0ad8b601dd
3 changed files with 7 additions and 5 deletions

View File

@@ -1399,7 +1399,8 @@ static int tls_new_certificate ( struct tls_session *tls,
assert ( cert != NULL );
/* Verify server name */
if ( strcmp ( tls->name, cert->subject.name ) != 0 ) {
if ( ( cert->subject.name == NULL ) ||
( strcmp ( cert->subject.name, tls->name ) != 0 ) ) {
DBGC ( tls, "TLS %p server name incorrect (expected %s, got "
"%s)\n", tls, tls->name, cert->subject.name );
return -EACCES_WRONG_NAME;