From ff316b7cddb49542c1fde75baa877e1e9dc49f48 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 17 Apr 2024 14:01:33 +0000 Subject: [PATCH] Shuffle EVP_PKEY_CTX setting together Another stroke of the already very dirty brush eliminates more traces of ADHD and/or crack. ok jsing --- lib/libcrypto/ec/ec_ameth.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c index 3848c121472..155c1855b46 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.62 2024/04/17 14:00:17 tb Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.63 2024/04/17 14:01:33 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -1006,13 +1006,11 @@ ecdh_cms_encrypt(CMS_RecipientInfo *ri) wrap_alg->parameter = NULL; } - if (EVP_PKEY_CTX_set_ecdh_kdf_outlen(pctx, keylen) <= 0) + if ((penclen = CMS_SharedInfo_encode(&penc, wrap_alg, ukm, keylen)) <= 0) goto err; - penclen = CMS_SharedInfo_encode(&penc, wrap_alg, ukm, keylen); - if (penclen <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_outlen(pctx, keylen) <= 0) goto err; - if (EVP_PKEY_CTX_set0_ecdh_kdf_ukm(pctx, penc, penclen) <= 0) goto err; penc = NULL; -- 2.20.1