[crypto] Add x509_is_self_signed() helper function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2024-02-15 12:43:51 +00:00
parent 3e721e0c08
commit 943d75b557
3 changed files with 15 additions and 1 deletions

View File

@@ -1102,6 +1102,10 @@ static void x509_test_exec ( void ) {
x509_validate_chain_fail_ok ( &server_chain, test_time,
&empty_store, &test_root );
/* Check self-signedess */
ok ( x509_is_self_signed ( root_crt.cert ) );
ok ( ! x509_is_self_signed ( intermediate_crt.cert ) );
/* Sanity check */
assert ( list_empty ( &empty_store.links ) );