diff options
author | Richard Levitte <levitte@openssl.org> | 2020-10-02 14:21:51 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-10-04 13:01:47 +0200 |
commit | 70c06aafa691a77861bd3d3aaf93afa2a55e04ce (patch) | |
tree | 2ccf9e7a520951f69585d9afaa1d82fe4bc4f7a5 /include | |
parent | ecadfdadde491572b0bdf3c5a95e7a6a004585c6 (diff) |
DECODER: Allow precise result type for OSSL_DECODER_CTX_new_by_EVP_PKEY()
There is some data that is very difficult to guess. For example, DSA
parameters and X9.42 DH parameters look exactly the same, a SEQUENCE
of 3 INTEGER. Therefore, callers may need the possibility to select
the exact keytype that they expect to get.
This will also allow use to translate d2i_TYPEPrivateKey(),
d2i_TYPEPublicKey() and d2i_TYPEParams() into OSSL_DECODER terms much
more smoothly.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13061)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/decoder.h | 2 | ||||
-rw-r--r-- | include/openssl/decoder.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/crypto/decoder.h b/include/crypto/decoder.h index b465752971..f025b3ec37 100644 --- a/include/crypto/decoder.h +++ b/include/crypto/decoder.h @@ -32,7 +32,7 @@ int ossl_decoder_ctx_add_decoder_inst(OSSL_DECODER_CTX *ctx, OSSL_DECODER_INSTANCE *di); int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx, - EVP_PKEY **pkey, + EVP_PKEY **pkey, const char *keytype, OPENSSL_CTX *libctx, const char *propquery); diff --git a/include/openssl/decoder.h b/include/openssl/decoder.h index 3da4577437..66790f43c8 100644 --- a/include/openssl/decoder.h +++ b/include/openssl/decoder.h @@ -112,7 +112,8 @@ int OSSL_DECODER_from_fp(OSSL_DECODER_CTX *ctx, FILE *in); * an implicit OSSL_DECODER_fetch(), suitable for the object of that type. */ OSSL_DECODER_CTX * -OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey, const char *input_type, +OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey, + const char *input_type, const char *keytype, OPENSSL_CTX *libctx, const char *propquery); # ifdef __cplusplus |