[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

@@ -570,7 +570,7 @@ static int x509_parse_common_name ( struct x509_certificate *cert, char **name,
return rc;
}
/* Allocate name */
/* Allocate and copy name */
*name = zalloc ( name_cursor.len + 1 /* NUL */ );
if ( ! *name )
return -ENOMEM;
@@ -578,9 +578,9 @@ static int x509_parse_common_name ( struct x509_certificate *cert, char **name,
return 0;
}
/* Certificates may not have a commonName */
DBGC ( cert, "X509 %p no commonName found:\n", cert );
DBGC_HDA ( cert, 0, raw->data, raw->len );
return -ENOENT;
return 0;
}
/**