Fix a memleak in prepare_rsa_params
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 11 Sep 2023 10:34:02 +0000 (12:34 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 13 Sep 2023 05:47:29 +0000 (07:47 +0200)
commite3d4cc706d78d33430ae2d4efd9c3e8321137a2d
tree6d4adcb4b166cdeec578bc8d499b3043ee6ec68b
parentd9f84aef6033804e4c7ebf28ee88fcd2c63161d6
Fix a memleak in prepare_rsa_params

This affects only RSA-PSS keys with params using
negative salt legth, or in case of out of memory.
This fixes a memory leak reported in #22049.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22061)

(cherry picked from commit 46def829afa4d8bed8f53d484bdf842d65f0e176)
providers/implementations/encode_decode/encode_key2any.c