diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-06-02 16:50:15 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-06-06 09:44:53 +0200 |
commit | 4fa5ed5ce5c345eaeaec8b86eda265add467f941 (patch) | |
tree | 413d888ff88a73c5a00412c85435e85bb3d847e0 /providers/implementations/encode_decode | |
parent | 697d0b5ba146c232f5b2aa87f4e847a5495c1735 (diff) | |
download | openssl-new-4fa5ed5ce5c345eaeaec8b86eda265add467f941.tar.gz |
Check return value of ossl_parse_property()
Also check if we have d2i_public_key() function pointer.
Fixes https://github.com/openssl/openssl/pull/18355#issuecomment-1144893289
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18462)
Diffstat (limited to 'providers/implementations/encode_decode')
-rw-r--r-- | providers/implementations/encode_decode/decode_der2key.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/providers/implementations/encode_decode/decode_der2key.c b/providers/implementations/encode_decode/decode_der2key.c index f6d293f2b8..ebc2d24833 100644 --- a/providers/implementations/encode_decode/decode_der2key.c +++ b/providers/implementations/encode_decode/decode_der2key.c @@ -227,7 +227,7 @@ static int der2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection, derp = der; if (ctx->desc->d2i_PUBKEY != NULL) key = ctx->desc->d2i_PUBKEY(NULL, &derp, der_len); - else + else if (ctx->desc->d2i_public_key != NULL) key = ctx->desc->d2i_public_key(NULL, &derp, der_len); if (key == NULL && ctx->selection != 0) { ERR_clear_last_mark(); |