[crypto] Pass asymmetric keys as ASN.1 cursors

Asymmetric keys are invariably encountered within ASN.1 structures
such as X.509 certificates, and the various large integers within an
RSA key are themselves encoded using ASN.1.

Simplify all code handling asymmetric keys by passing keys as a single
ASN.1 cursor, rather than separate data and length pointers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2024-08-18 10:43:52 +01:00
parent 950f6b5861
commit 53f089b723
10 changed files with 74 additions and 112 deletions

View File

@@ -93,8 +93,8 @@ struct cipher_algorithm cipher_null = {
.auth = cipher_null_auth,
};
int pubkey_null_init ( void *ctx __unused, const void *key __unused,
size_t key_len __unused ) {
int pubkey_null_init ( void *ctx __unused,
const struct asn1_cursor *key __unused ) {
return 0;
}