Skip to content

Commit

Permalink
Check error return from cms_sd_asn1_ctrl() correctly.
Browse files Browse the repository at this point in the history
Fixes #21986

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from #21988)

(cherry picked from commit 00a413e)
  • Loading branch information
paulidale committed Sep 8, 2023
1 parent 457fd05 commit 2482061
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/cms/cms_sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ static int cms_sd_asn1_ctrl(CMS_SignerInfo *si, int cmd)
int i;

if (EVP_PKEY_is_a(pkey, "DSA") || EVP_PKEY_is_a(pkey, "EC"))
return ossl_cms_ecdsa_dsa_sign(si, cmd);
return ossl_cms_ecdsa_dsa_sign(si, cmd) > 0;
else if (EVP_PKEY_is_a(pkey, "RSA") || EVP_PKEY_is_a(pkey, "RSA-PSS"))
return ossl_cms_rsa_sign(si, cmd);
return ossl_cms_rsa_sign(si, cmd) > 0;

/* Something else? We'll give engines etc a chance to handle this */
if (pkey->ameth == NULL || pkey->ameth->pkey_ctrl == NULL)
Expand Down

0 comments on commit 2482061

Please sign in to comment.