diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2024-04-17 13:58:56 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2024-04-17 13:58:56 +0000 |
commit | d9f181b6629514775d58a4466b77ffbabb56439c (patch) | |
tree | ec650ef3614ecb37d5b88af916b716a9a0159612 /lib/libcrypto/ec | |
parent | 01ad4b97238fb3037c680b816e4916d6571dd0f8 (diff) |
ecdh_cms_encrypt: tweak handling of ecdh_nid
ok jsing
Diffstat (limited to 'lib/libcrypto/ec')
-rw-r--r-- | lib/libcrypto/ec/ec_ameth.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c index 120d07548cb..e87cc1766c6 100644 --- a/lib/libcrypto/ec/ec_ameth.c +++ b/lib/libcrypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.60 2024/04/17 13:57:58 tb Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.61 2024/04/17 13:58:55 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -958,10 +958,9 @@ ecdh_cms_encrypt(CMS_RecipientInfo *ri) if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) goto err; - ecdh_nid = EVP_PKEY_CTX_get_ecdh_cofactor_mode(pctx); - if (ecdh_nid < 0) + if ((ecdh_nid = EVP_PKEY_CTX_get_ecdh_cofactor_mode(pctx)) < 0) goto err; - else if (ecdh_nid == 0) + if (ecdh_nid == 0) ecdh_nid = NID_dh_std_kdf; else if (ecdh_nid == 1) ecdh_nid = NID_dh_cofactor_kdf; |