mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[test] Include key matching in existing public-key tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -53,6 +53,10 @@ void pubkey_okx ( struct pubkey_test *test, const char *file,
|
|||||||
struct asn1_builder plaintext;
|
struct asn1_builder plaintext;
|
||||||
struct asn1_builder ciphertext;
|
struct asn1_builder ciphertext;
|
||||||
|
|
||||||
|
/* Test key matching */
|
||||||
|
okx ( pubkey_match ( pubkey, &test->private, &test->public ) == 0,
|
||||||
|
file, line );
|
||||||
|
|
||||||
/* Test decrypting with private key to obtain known plaintext */
|
/* Test decrypting with private key to obtain known plaintext */
|
||||||
plaintext.data = NULL;
|
plaintext.data = NULL;
|
||||||
plaintext.len = 0;
|
plaintext.len = 0;
|
||||||
@@ -109,6 +113,10 @@ void pubkey_sign_okx ( struct pubkey_sign_test *test, const char *file,
|
|||||||
struct asn1_builder signature = { NULL, 0 };
|
struct asn1_builder signature = { NULL, 0 };
|
||||||
uint8_t *bad;
|
uint8_t *bad;
|
||||||
|
|
||||||
|
/* Test key matching */
|
||||||
|
okx ( pubkey_match ( pubkey, &test->private, &test->public ) == 0,
|
||||||
|
file, line );
|
||||||
|
|
||||||
/* Construct digest over plaintext */
|
/* Construct digest over plaintext */
|
||||||
digest_init ( digest, digestctx );
|
digest_init ( digest, digestctx );
|
||||||
digest_update ( digest, digestctx, test->plaintext,
|
digest_update ( digest, digestctx, test->plaintext,
|
||||||
|
|||||||
Reference in New Issue
Block a user