diff options
-rw-r--r-- | crypto/encode_decode/decoder_meth.c | 7 | ||||
-rw-r--r-- | crypto/encode_decode/encoder_meth.c | 7 | ||||
-rw-r--r-- | providers/implementations/encode_decode/decode_der2key.c | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c index a08705abb3..11e94dbcc4 100644 --- a/crypto/encode_decode/decoder_meth.c +++ b/crypto/encode_decode/decoder_meth.c @@ -191,8 +191,11 @@ void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef, return NULL; } decoder->base.algodef = algodef; - decoder->base.parsed_propdef - = ossl_parse_property(libctx, algodef->property_definition); + if ((decoder->base.parsed_propdef + = ossl_parse_property(libctx, algodef->property_definition)) == NULL) { + OSSL_DECODER_free(decoder); + return NULL; + } for (; fns->function_id != 0; fns++) { switch (fns->function_id) { diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c index 7571570d28..7a28894b2c 100644 --- a/crypto/encode_decode/encoder_meth.c +++ b/crypto/encode_decode/encoder_meth.c @@ -191,8 +191,11 @@ static void *encoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef, return NULL; } encoder->base.algodef = algodef; - encoder->base.parsed_propdef - = ossl_parse_property(libctx, algodef->property_definition); + if ((encoder->base.parsed_propdef + = ossl_parse_property(libctx, algodef->property_definition)) == NULL) { + OSSL_ENCODER_free(encoder); + return NULL; + } for (; fns->function_id != 0; fns++) { switch (fns->function_id) { 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(); |