diff options
author | Matt Caswell <matt@openssl.org> | 2021-06-08 11:49:06 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-06-14 09:43:01 +0100 |
commit | 8c7c1c84cbaa38a4053404883d666ea8dff81b3a (patch) | |
tree | e775c97857d6cf816b94573bcbad11e68ed691fb /providers/implementations/encode_decode/endecoder_local.h | |
parent | 1c49be8673713d2ceb03a63be03531d9b28a46bd (diff) |
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 <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15662)
Diffstat (limited to 'providers/implementations/encode_decode/endecoder_local.h')
-rw-r--r-- | providers/implementations/encode_decode/endecoder_local.h | 2 |
1 files changed, 2 insertions, 0 deletions
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); |