diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 739297346c..9bcda79b3e 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_ameth.c,v 1.54 2024/04/17 13:47:18 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.55 2024/04/17 13:49:18 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 | */ |
@@ -924,11 +924,10 @@ ecdh_cms_encrypt(CMS_RecipientInfo *ri) | |||
924 | int penclen; | 924 | int penclen; |
925 | int ecdh_nid, kdf_type, kdf_nid, wrap_nid; | 925 | int ecdh_nid, kdf_type, kdf_nid, wrap_nid; |
926 | const EVP_MD *kdf_md; | 926 | const EVP_MD *kdf_md; |
927 | int rv = 0; | 927 | int ret = 0; |
928 | 928 | ||
929 | pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); | 929 | if ((pctx = CMS_RecipientInfo_get0_pkey_ctx(ri)) == NULL) |
930 | if (!pctx) | 930 | goto err; |
931 | return 0; | ||
932 | /* Get ephemeral key */ | 931 | /* Get ephemeral key */ |
933 | pkey = EVP_PKEY_CTX_get0_pkey(pctx); | 932 | pkey = EVP_PKEY_CTX_get0_pkey(pctx); |
934 | if (!CMS_RecipientInfo_kari_get0_orig_id(ri, &talg, &pubkey, | 933 | if (!CMS_RecipientInfo_kari_get0_orig_id(ri, &talg, &pubkey, |
@@ -1043,12 +1042,13 @@ ecdh_cms_encrypt(CMS_RecipientInfo *ri) | |||
1043 | penc = NULL; | 1042 | penc = NULL; |
1044 | X509_ALGOR_set0(talg, OBJ_nid2obj(kdf_nid), V_ASN1_SEQUENCE, wrap_str); | 1043 | X509_ALGOR_set0(talg, OBJ_nid2obj(kdf_nid), V_ASN1_SEQUENCE, wrap_str); |
1045 | 1044 | ||
1046 | rv = 1; | 1045 | ret = 1; |
1047 | 1046 | ||
1048 | err: | 1047 | err: |
1049 | free(penc); | 1048 | free(penc); |
1050 | X509_ALGOR_free(wrap_alg); | 1049 | X509_ALGOR_free(wrap_alg); |
1051 | return rv; | 1050 | |
1051 | return ret; | ||
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | #endif | 1054 | #endif |