mirror of
https://github.com/ipxe/ipxe
synced 2026-04-16 03:00:10 +03:00
[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:
@@ -367,8 +367,7 @@ static int icert_cert ( struct icert *icert, struct asn1_cursor *subject,
|
||||
int rc;
|
||||
|
||||
/* Initialise "private" key */
|
||||
if ( ( rc = pubkey_init ( pubkey, pubkey_ctx, private->data,
|
||||
private->len ) ) != 0 ) {
|
||||
if ( ( rc = pubkey_init ( pubkey, pubkey_ctx, private ) ) != 0 ) {
|
||||
DBGC ( icert, "ICERT %p could not initialise private key: "
|
||||
"%s\n", icert, strerror ( rc ) );
|
||||
goto err_pubkey_init;
|
||||
|
||||
Reference in New Issue
Block a user