Fix the check of evp_pkey_ctx_set_params_strict
@@ -1084,6 +1084,7 @@ int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md)
int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen)
{
OSSL_PARAM rsa_params[2], *p = rsa_params;
+ int ret;
if (ctx == NULL || !EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)) {
ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
@@ -1100,8 +1101,9 @@ int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen)
(void *)label, (size_t)llen);
*p++ = OSSL_PARAM_construct_end();
- if (!evp_pkey_ctx_set_params_strict(ctx, rsa_params))
- return 0;
+ ret = evp_pkey_ctx_set_params_strict(ctx, rsa_params);
+ if (ret <= 0)
+ return ret;
/* Ownership is supposed to be transferred to the callee. */
OPENSSL_free(label);
