diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-08-18 10:43:52 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-08-18 15:44:38 +0100 |
commit | 53f089b723e16eecb4fd2e2a59b74b3932431b30 (patch) | |
tree | b18d3ae4d8de119a6afb23c01ea3e9df069a0173 /src/crypto/ocsp.c | |
parent | 950f6b5861d8d6b247b37e4e1401d26d8f908ee8 (diff) | |
download | ipxe-53f089b723e16eecb4fd2e2a59b74b3932431b30.tar.gz |
[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>
Diffstat (limited to 'src/crypto/ocsp.c')
-rw-r--r-- | src/crypto/ocsp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/ocsp.c b/src/crypto/ocsp.c index cc957b40c..f35593454 100644 --- a/src/crypto/ocsp.c +++ b/src/crypto/ocsp.c @@ -857,8 +857,8 @@ static int ocsp_check_signature ( struct ocsp_check *ocsp, digest_final ( digest, digest_ctx, digest_out ); /* Initialise public-key algorithm */ - if ( ( rc = pubkey_init ( pubkey, pubkey_ctx, public_key->raw.data, - public_key->raw.len ) ) != 0 ) { + if ( ( rc = pubkey_init ( pubkey, pubkey_ctx, + &public_key->raw ) ) != 0 ) { DBGC ( ocsp, "OCSP %p \"%s\" could not initialise public key: " "%s\n", ocsp, x509_name ( ocsp->cert ), strerror ( rc )); goto err_init; |