diff options
| author | tb <> | 2024-04-17 13:58:55 +0000 |
|---|---|---|
| committer | tb <> | 2024-04-17 13:58:55 +0000 |
| commit | 58f738fb8187c3e72b76725cc55d0feb1937498c (patch) | |
| tree | 8a3ba857eee78c2ea2910a50df6e2ae4ba695376 /src | |
| parent | 80578a3798fdbf4f7b4818b1d1994cbd43554b25 (diff) | |
| download | openbsd-58f738fb8187c3e72b76725cc55d0feb1937498c.tar.gz openbsd-58f738fb8187c3e72b76725cc55d0feb1937498c.tar.bz2 openbsd-58f738fb8187c3e72b76725cc55d0feb1937498c.zip | |
ecdh_cms_encrypt: tweak handling of ecdh_nid
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 120d07548c..e87cc1766c 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.60 2024/04/17 13:57:58 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.61 2024/04/17 13:58:55 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 | */ |
| @@ -958,10 +958,9 @@ ecdh_cms_encrypt(CMS_RecipientInfo *ri) | |||
| 958 | if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) | 958 | if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) |
| 959 | goto err; | 959 | goto err; |
| 960 | 960 | ||
| 961 | ecdh_nid = EVP_PKEY_CTX_get_ecdh_cofactor_mode(pctx); | 961 | if ((ecdh_nid = EVP_PKEY_CTX_get_ecdh_cofactor_mode(pctx)) < 0) |
| 962 | if (ecdh_nid < 0) | ||
| 963 | goto err; | 962 | goto err; |
| 964 | else if (ecdh_nid == 0) | 963 | if (ecdh_nid == 0) |
| 965 | ecdh_nid = NID_dh_std_kdf; | 964 | ecdh_nid = NID_dh_std_kdf; |
| 966 | else if (ecdh_nid == 1) | 965 | else if (ecdh_nid == 1) |
| 967 | ecdh_nid = NID_dh_cofactor_kdf; | 966 | ecdh_nid = NID_dh_cofactor_kdf; |
