rsa: Accept NULL OAEP label for backward compatibility
authorDaiki Ueno <dueno@redhat.com>
Mon, 16 Oct 2023 05:42:12 +0000 (14:42 +0900)
committerTomas Mraz <tomas@openssl.org>
Wed, 18 Oct 2023 14:26:07 +0000 (16:26 +0200)
commita6ed37c2e2c50e93937e4ea3271a8af96e0303de
tree729a12e119f06c7362b6a56ad9cd5a8c8e52ccd5
parentf4bc5568a973e640a70f416da37a030c25a38ebc
rsa: Accept NULL OAEP label for backward compatibility

According to the manual page, EVP_PKEY_CTX_set0_rsa_oaep_label()
should accept NULL as the label argument, though the function
currently rejects it while setting the corresponding octet string
parameter with OSSL_PARAM_construct_octet_string, which expects
non-NULL input.  This adds a workaround to the caller for backward
compatibility.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22397)

(cherry picked from commit 21b98da9d80c561b6273b0c51c259196d6740e70)
crypto/rsa/rsa_lib.c
test/evp_extra_test.c