From nobody Mon Feb 9 16:19:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100124+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100124+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676316005; cv=none; d=zohomail.com; s=zohoarc; b=QbVOdG/3nRPOzjqIay3gtH034a/+M/MeV46s5Xooylr9jaC6jQ3yMLAY64MAs4NA7mtrEQRHRTjEZEsTZiyLWbrMaoMBpoOHulnQ972NPT5Ii8KexAGGSC3952cGJMyEojnFdsZ8hR8WE6fBtUQq7P+DtCRPoJ+0f4SOxaxZb+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676316005; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=FWJVUmo+bZuJ0RmhegoLtmR3aRkCU834Ivq0rIQnx2Q=; b=JTO1reqSnvNwxn6O14N9TSom1hVbCqcADq6PYRFClDW3eGaAsleaRLG9ovnJwZvvRIhJ17iRn6LFwzl7gfg46jMOmiQR6+3Mw2ylm5nnu6xqGBTjW9g/xQzv9D10TuthsNkBcufJD+BzpLwReie6MOT5T3i50AlgE4BAiWSKoH0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100124+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1676316005226333.86292839659257; Mon, 13 Feb 2023 11:20:05 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id pedZYY1788612xapDRBZDNxD; Mon, 13 Feb 2023 11:20:04 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.24306.1676316003739138854 for ; Mon, 13 Feb 2023 11:20:04 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-547-aiQg7rdDOhiNpIeGxCm3jQ-1; Mon, 13 Feb 2023 14:20:01 -0500 X-MC-Unique: aiQg7rdDOhiNpIeGxCm3jQ-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3849485CCE2 for ; Mon, 13 Feb 2023 19:20:01 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 090722026D4B; Mon, 13 Feb 2023 19:20:01 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1D1631800613; Mon, 13 Feb 2023 20:19:58 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Pawel Polawski , Gerd Hoffmann Subject: [edk2-devel] [PATCH 3/4] CryptoPkg/BaseCryptLib: avoid using SHA384() Date: Mon, 13 Feb 2023 20:19:57 +0100 Message-Id: <20230213191958.913689-4-kraxel@redhat.com> In-Reply-To: <20230213191958.913689-1-kraxel@redhat.com> References: <20230213191958.913689-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com X-Gm-Message-State: V5BzAnx0ZqRx10q1Qm3rAdOKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1676316004; bh=CWdT9+QGUYBOIecT968f/cLxHBDaGC90uKQ5gvfpgRM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=RTsya1FMQ6GQD/ReuvyCGiEYEzpFgfUCk8selW0FArhZ0OVvqXGFxj/iAw1qdKvFBUE 3RHbjLKSbspW7kTCVoEGngw6QITgCruu5VoFPcNHmA7q44haEduJ292SeXYsGuz/yNX6j Sqxq0cytazFEz4E67NFvOyC0eGeiGNltxOU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1676316006253100011 Content-Type: text/plain; charset="utf-8"; x-default="true" In openssl 3.0 SHA384() goes through the provider logic, requiring a huge amount of openssl code. The individual functions do not, so use them instead. Signed-off-by: Gerd Hoffmann --- .../Library/BaseCryptLib/Hash/CryptSha512.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c b/CryptoPkg/= Library/BaseCryptLib/Hash/CryptSha512.c index 59e570846588..2ab7188035e8 100644 --- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c @@ -204,6 +204,8 @@ Sha384HashAll ( OUT UINT8 *HashValue ) { + SHA512_CTX Context; + // // Check input parameters. // @@ -218,11 +220,19 @@ Sha384HashAll ( // // OpenSSL SHA-384 Hash Computation. // - if (SHA384 (Data, DataSize, HashValue) =3D=3D NULL) { + if (!SHA384_Init (&Context)) { return FALSE; - } else { - return TRUE; } + + if (!SHA384_Update (&Context, Data, DataSize)) { + return FALSE; + } + + if (!SHA384_Final (HashValue, &Context)) { + return FALSE; + } + + return TRUE; } =20 /** --=20 2.39.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100124): https://edk2.groups.io/g/devel/message/100124 Mute This Topic: https://groups.io/mt/96943600/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-