diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-02-15 12:43:51 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-02-15 12:45:58 +0000 |
commit | 943d75b557a8bf857d651e8116a7368b9d284e41 (patch) | |
tree | 36fae45ff882568d85857f5331eaae41e02267d3 /src/tests/x509_test.c | |
parent | 3e721e0c0836588b64deb6e1c1befd08f0f02e71 (diff) | |
download | ipxe-943d75b557a8bf857d651e8116a7368b9d284e41.tar.gz |
[crypto] Add x509_is_self_signed() helper function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests/x509_test.c')
-rw-r--r-- | src/tests/x509_test.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tests/x509_test.c b/src/tests/x509_test.c index bc9032041..50eb4d787 100644 --- a/src/tests/x509_test.c +++ b/src/tests/x509_test.c @@ -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 ) ); |