From patchwork Tue Mar 5 14:20:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chien Wong X-Patchwork-Id: 1908282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Ta40ayEI; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=xv97.com header.i=m@xv97.com header.a=rsa-sha256 header.s=zmail header.b=XEeeiVWW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpyS61hlmz23cb for ; Wed, 6 Mar 2024 01:21:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vQqAThBSXT9K8AAEhbCMRVyX2pi5QiQkA+UXBkOi/gA=; b=Ta40ayEI628ps0 QUSbWJSxCPE6vhc/l8Ug9BZ856OwrP/Po/mYM1wSIpEcyvMsKRtStNBOUKXeShE/8SyVJ9PnxvNFz OEydisaD8SYsOBPDKKVxfLS1SaXfXDwD+uGgbVkrxfpaSpsfvYCz8GV4/M4t//yzrbfL9kM6DmHFy d281zz4/eV9e0kfvJxL+nUfULmUZvalFCbU312fB7/E3EG7fGSAiL+/k/wzTGF12ajr4f7Kb0/zeI wNLrVCP7x0OVgmcSCN6VjZirijntrE7H2L1CTA6Q5Alj9mGx0qxE1bXHzqsLOxekTGACcrGn7Wmlc krKhJkxSXCZa1OaiNdsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhVfG-0000000E0Hb-3nRP; Tue, 05 Mar 2024 14:21:06 +0000 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhVf7-0000000E0Dd-3zCh for hostap@lists.infradead.org; Tue, 05 Mar 2024 14:21:05 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1709648450; cv=none; d=zohomail.com; s=zohoarc; b=ZgIFjIGvgwItHV56Mn1FPaTpT+7ySkL/AsJh85h0QjZptsyWfcv+6KDAsEZFRasza+K2y2fnJu+TMUKgzWrQrMubjNISzihgveN7RB9xCY5W5ejTOWclkIRGIBtnzJwsGu85Ivy2QFE2VNjN3mel29cYELftjwbeg/SQsMn06CA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709648450; h=Content-Transfer-Encoding:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=g+mBj1PAkKeLXLD4F+Z9d1nlaVSLWwbcIFsRfy8/+ek=; b=mGvrv7mYtuEmQi0at8rKY0fuG+gfm8cLhQ49n8iThmIHi7RQivhcbwCbbKXvDcUR4nHwGE0GbacmMXHc2XvX31ELx6vRtOtoXPw3e5W0H260Z4jOCD+yStcFZ4JqPNjgaaSY8EvO5vv9QL6rhwCnPUogGcQjHRemjrQEO4ljWE0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=xv97.com; spf=pass smtp.mailfrom=m@xv97.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1709648450; s=zmail; d=xv97.com; i=m@xv97.com; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=g+mBj1PAkKeLXLD4F+Z9d1nlaVSLWwbcIFsRfy8/+ek=; b=XEeeiVWWWx8RpG8vjW8MJTTbdM/H6pKROgnefVTGtGnXDi+3/eCwShvw+MtTIrvn vLnPhzJUSNffwjAUwOts5nLLaVnJB79HLGsJpvR8lfpGlENwKy2F/Jqe/ci+KUspajR ArNEEcq7MP1GyMkHWdq6lMPg4vjdnYHic35ZNrHU= Received: from archwd500.lan (64.120.121.206 [64.120.121.206]) by mx.zohomail.com with SMTPS id 1709648447950292.35359778623945; Tue, 5 Mar 2024 06:20:47 -0800 (PST) From: Chien Wong To: hostap@lists.infradead.org Subject: [PATCH 1/2] OpenSSL: Fix a memory leak on openssl_evp_pkey_ec_prime_len() error path Date: Tue, 5 Mar 2024 22:20:40 +0800 Message-ID: <20240305142041.542353-1-m@xv97.com> MIME-Version: 1.0 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240305_062058_096912_BB92029F X-CRM114-Status: UNSURE ( 8.37 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Fixes: b700a56e1478 ("OpenSSL 3.0: Determine the prime length for an EC key group using EVP_PKEY!) Signed-off-by: Chien Wong --- src/crypto/crypto_openssl.c | 3 ++- 1 file changed, 2 inse [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 ARC_VALID Message has a valid ARC signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 ARC_SIGNED Message has a ARC signature -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [136.143.188.15 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [136.143.188.15 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Fixes: b700a56e1478 ("OpenSSL 3.0: Determine the prime length for an EC key group using EVP_PKEY!) Signed-off-by: Chien Wong --- src/crypto/crypto_openssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 427677d34..315c3feac 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -3932,9 +3932,10 @@ static int openssl_evp_pkey_ec_prime_len(struct crypto_ec_key *key) group = EC_GROUP_new_by_curve_name(nid); prime = BN_new(); if (!group || !prime) - return -1; + goto fail; if (EC_GROUP_get_curve(group, prime, NULL, NULL, NULL) == 1) prime_len = BN_num_bytes(prime); +fail: EC_GROUP_free(group); BN_free(prime); return prime_len;