From 8c7c1c84cbaa38a4053404883d666ea8dff81b3a Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 8 Jun 2021 11:49:06 +0100 Subject: Add a generic SubjectPublicKeyInfo decoder Previously all the SubjectPublicKeyInfo decoders were specific to a key type. We would iterate over all them until a match was found for the correct key type. Each one would fully decode the key before then testing whether it was a match or not - throwing it away if not. This was very inefficient. Instead we introduce a generic SubjectPublicKeyInfo decoder which figures out what type of key is contained within it, before subsequently passing on the data to a key type specific SubjectPublicKeyInfo decoder. Fixes #15646 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15662) --- providers/implementations/encode_decode/endecoder_local.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'providers/implementations/encode_decode/endecoder_local.h') diff --git a/providers/implementations/encode_decode/endecoder_local.h b/providers/implementations/encode_decode/endecoder_local.h index ab431b8086..96941e4d16 100644 --- a/providers/implementations/encode_decode/endecoder_local.h +++ b/providers/implementations/encode_decode/endecoder_local.h @@ -24,3 +24,5 @@ int ossl_prov_der_from_p8(unsigned char **new_der, long *new_der_len, void *ossl_prov_import_key(const OSSL_DISPATCH *fns, void *provctx, int selection, const OSSL_PARAM params[]); void ossl_prov_free_key(const OSSL_DISPATCH *fns, void *key); +int ossl_read_der(PROV_CTX *provctx, OSSL_CORE_BIO *cin, unsigned char **data, + long *len); -- cgit v1.2.3