From 42f329624d8977c80b31d06537d0ebff250b388f Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 7 Mar 2023 07:01:35 +0000 Subject: [PATCH] Fix another return value check for CMS_SharedInfo_encode() This should have been included in a previous diff/commit... --- lib/libcrypto/ec/ec_ameth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c index a3ac989e6f5..e47dcbc7c05 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.37 2023/03/06 08:37:24 tb Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.38 2023/03/07 07:01:35 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -814,7 +814,7 @@ ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) goto err; plen = CMS_SharedInfo_encode(&der, kekalg, ukm, keylen); - if (!plen) + if (plen <= 0) goto err; if (EVP_PKEY_CTX_set0_ecdh_kdf_ukm(pctx, der, plen) <= 0) -- 2.20.1