From: tb Date: Tue, 7 Nov 2023 22:32:09 +0000 (+0000) Subject: Move CMS_RecipientInfo_get0_pkey_ctx() to first use of pkctx X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=32c3cb9567cb21a2ffa6dc2cb195f384c661ef00;p=openbsd Move CMS_RecipientInfo_get0_pkey_ctx() to first use of pkctx --- diff --git a/lib/libcrypto/rsa/rsa_ameth.c b/lib/libcrypto/rsa/rsa_ameth.c index b4dbff26839..7533264add5 100644 --- a/lib/libcrypto/rsa/rsa_ameth.c +++ b/lib/libcrypto/rsa/rsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ameth.c,v 1.40 2023/11/07 16:22:04 tb Exp $ */ +/* $OpenBSD: rsa_ameth.c,v 1.41 2023/11/07 22:32:09 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -1061,13 +1061,13 @@ rsa_cms_encrypt(CMS_RecipientInfo *ri) RSA_OAEP_PARAMS *oaep = NULL; ASN1_STRING *os = NULL; X509_ALGOR *alg; - EVP_PKEY_CTX *pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri); + EVP_PKEY_CTX *pkctx; int pad_mode = RSA_PKCS1_PADDING, rv = 0, labellen; unsigned char *label; if (CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg) <= 0) return 0; - if (pkctx) { + if ((pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri)) != NULL) { if (EVP_PKEY_CTX_get_rsa_padding(pkctx, &pad_mode) <= 0) return 0; }