diff options
author | tb <> | 2023-11-07 22:32:09 +0000 |
---|---|---|
committer | tb <> | 2023-11-07 22:32:09 +0000 |
commit | dea80baeb0e1dac8ee33631b3587b4ba621cb4a3 (patch) | |
tree | 8e127d1cb0e7dfdad4b19652445ac02979b02e17 | |
parent | eb72606d84105bd325072f167dfb5474ce98ad32 (diff) | |
download | openbsd-dea80baeb0e1dac8ee33631b3587b4ba621cb4a3.tar.gz openbsd-dea80baeb0e1dac8ee33631b3587b4ba621cb4a3.tar.bz2 openbsd-dea80baeb0e1dac8ee33631b3587b4ba621cb4a3.zip |
Move CMS_RecipientInfo_get0_pkey_ctx() to first use of pkctx
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_ameth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c index b4dbff2683..7533264add 100644 --- a/src/lib/libcrypto/rsa/rsa_ameth.c +++ b/src/lib/libcrypto/rsa/rsa_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_ameth.c,v 1.40 2023/11/07 16:22:04 tb Exp $ */ | 1 | /* $OpenBSD: rsa_ameth.c,v 1.41 2023/11/07 22:32:09 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -1061,13 +1061,13 @@ rsa_cms_encrypt(CMS_RecipientInfo *ri) | |||
1061 | RSA_OAEP_PARAMS *oaep = NULL; | 1061 | RSA_OAEP_PARAMS *oaep = NULL; |
1062 | ASN1_STRING *os = NULL; | 1062 | ASN1_STRING *os = NULL; |
1063 | X509_ALGOR *alg; | 1063 | X509_ALGOR *alg; |
1064 | EVP_PKEY_CTX *pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri); | 1064 | EVP_PKEY_CTX *pkctx; |
1065 | int pad_mode = RSA_PKCS1_PADDING, rv = 0, labellen; | 1065 | int pad_mode = RSA_PKCS1_PADDING, rv = 0, labellen; |
1066 | unsigned char *label; | 1066 | unsigned char *label; |
1067 | 1067 | ||
1068 | if (CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg) <= 0) | 1068 | if (CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg) <= 0) |
1069 | return 0; | 1069 | return 0; |
1070 | if (pkctx) { | 1070 | if ((pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri)) != NULL) { |
1071 | if (EVP_PKEY_CTX_get_rsa_padding(pkctx, &pad_mode) <= 0) | 1071 | if (EVP_PKEY_CTX_get_rsa_padding(pkctx, &pad_mode) <= 0) |
1072 | return 0; | 1072 | return 0; |
1073 | } | 1073 | } |