mirror of
https://github.com/ipxe/ipxe
synced 2026-01-21 01:28:02 +03:00
[test] Test verification of constructed signature
Some signature schemes (such as ECDSA) allow for non-deterministic signatures. Provide more information in test results by performing verification of the constructed signature even when it does not match the expected test case result: this allows us to distinguish between a bug that is generating invalid signatures and a bug that is generating valid but non-canonical signatures. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -146,6 +146,10 @@ void pubkey_sign_okx ( struct pubkey_sign_test *test, const char *file,
|
||||
okx ( asn1_compare ( asn1_built ( &builder ), &test->signature ) == 0,
|
||||
file, line );
|
||||
|
||||
/* Test verification of constructed signature */
|
||||
okx ( pubkey_verify ( pubkey, &test->public, digest, digestout,
|
||||
asn1_built ( &builder ) ) == 0, file, line );
|
||||
|
||||
/* Free signature */
|
||||
free ( builder.data );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user