From nobody Thu Apr 25 00:02:59 2024 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+74124+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+74124+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1618486720; cv=none; d=zohomail.com; s=zohoarc; b=nEKfbJQn4aTOH79zeaHdeXaGBeNP3SMZtxYdKwU5NzBpr4M67XrHGlFZqNY/R6etyOUvIAxjbQ5LI1hCzU/GWn5TyBYk75U1lnCEHxEfQ0lnyARMuBhxm4CwtJC9e+n6p6Q0AzAvbd2hMft062pOzLn9MkyBbrRVl4i1dBwfC68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618486720; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=P5W/XxghxpalHD78B5bBSCYNhGI1sOX/BZVJ6TDEwwI=; b=JTwI5FeJrXti9/g0o0Ed0zPky+5rcS9aj7VHiLMUN/4DtZ8Jo9lUoWOrr01Z8V+5w108C6FP2BDQovgQ4rBhyAfwig0VYG4NjCk0w/oWav4bfNAhkyNHLs4H8dd28JbiOS8GU9JP6f47fa/KtqHiQbJWq+EZRrLr2YZcTkooArA= 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+74124+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1618486720409290.57553229480084; Thu, 15 Apr 2021 04:38:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uHtKYY1788612xK2X8MHvqdH; Thu, 15 Apr 2021 04:38:39 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.3419.1618468294795410865 for ; Wed, 14 Apr 2021 23:31:35 -0700 IronPort-SDR: usrRXJfZ5hnNd817I6esQ2MFxLHoCePb1EpU6AE4xa4jn8hQtoDC0R4HJKCzhGslTLgB8fgpWh +OO8qVCIQzTw== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="256114308" X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="256114308" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 23:31:33 -0700 IronPort-SDR: ssbqkdVokXOndKVpsuF2haMetX1Tv4Xjmd6ulbZA5dWnKA4hvLW/lt5jhoTVT3D2BtgbDsCHon +KIrDHiITUCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="399467855" X-Received: from fm73lab132.amr.corp.intel.com ([10.121.84.146]) by orsmga002.jf.intel.com with ESMTP; 14 Apr 2021 23:31:33 -0700 From: "Mohammad Miazi" To: devel@edk2.groups.io Cc: Mohammad Miazi Subject: [edk2-devel] [PATCH] [INTEL][TOOLS][FITGEN] Modify Fitgen tool to support new ACM header Date: Wed, 14 Apr 2021 23:31:29 -0700 Message-Id: <20210415063129.38520-1-mohammad.m.miazi@intel.com> MIME-Version: 1.0 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,mohammad.m.miazi@intel.com X-Gm-Message-State: q5V9FzcbPz1ByjdV2qJNudD6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1618486719; bh=0ZoK0GpTsIc7E8uuSXaZhOLkUJ1cAzJOKNQTnC6A1TQ=; h=Cc:Date:From:Reply-To:Subject:To; b=gqz5W4RYMvetoCdVDtKm1c15TYyN2PGWmAgVzP8b7PjhpKDneFAWoj9r+z8YPhu3vdu AhxxcIcDrQ+ZEDJtUn9zyxhOtszUEsNEgBywe+Jdtwbe0VY3K24PrJk5cSNq5A+qh5cy/ g2SHiAD9Xz11N1Ev0Kai3sU+iZ6Z+z24KRs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3332 Currently Fitgen tools verifies every detail of ACM header, so any ACM header change breaks the tool. As ACM header is verified by microcode and ACM itself, Fitgen tool does not need to verify every fieldof ACM header except some important fields like ACM_TYPE/SUB_TYPE etc.The changes will remove the dependency between future ACM header changeand FitGen tool. Signed-off-by: Mohammad Miazi Reviewed-by: Bob Feng --- Silicon/Intel/Tools/FitGen/FitGen.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools/FitG= en/FitGen.c index 36e6e3c905..290e688f6e 100644 --- a/Silicon/Intel/Tools/FitGen/FitGen.c +++ b/Silicon/Intel/Tools/FitGen/FitGen.c @@ -2,7 +2,7 @@ This utility is part of build process for IA32/X64 FD. It generates FIT table. =20 -Copyright (c) 2010-2020, Intel Corporation. All rights reserved.
+Copyright (c) 2010-2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -48,6 +48,7 @@ typedef struct { #define ACM_PKCS_1_5_RSA_SIGNATURE_SHA384_SIZE 384 =20 #define ACM_HEADER_VERSION_3 (3 << 16) +#define ACM_HEADER_VERSION_0 (0) #define ACM_MODULE_TYPE_CHIPSET_ACM 2 #define ACM_MODULE_SUBTYPE_CAPABLE_OF_EXECUTE_AT_RESET 0x1 #define ACM_MODULE_SUBTYPE_ANC_MODULE 0x2 @@ -2456,7 +2457,16 @@ Returns: DumpHex (Buffer, Acm->KeySize * 4); printf ("\n"); Buffer +=3D Acm->KeySize * 4; - + // + // To simplify the tool and making it independent of ACM header change, + // the rest of ACM parsing will be skipped starting ACM_HEADER_VERSION4 + // + if((Acm->HeaderVersion !=3D ACM_HEADER_VERSION_3) && (Acm->HeaderVersion= !=3D ACM_HEADER_VERSION_0)){ + printf ( + "*****************************************************************= ************\n\n" + ); + return; + } if (Acm->HeaderVersion =3D=3D ACM_HEADER_VERSION_3) { printf (" RSASig - \n"); DumpHex (Buffer, ACM_PKCS_1_5_RSA_SIGNATURE_SHA384_SIZE); // PKCS #1.5= RSA Signature @@ -2580,6 +2590,14 @@ Returns: return FALSE; } =20 + // + // To simplify the tool and making it independent of ACM header change, + // the following check will be skipped starting ACM_HEADER_VERSION3 + // + if((Acm->HeaderVersion !=3D ACM_HEADER_VERSION_3) && (Acm->HeaderVersion= !=3D ACM_HEADER_VERSION_0)){ + printf ("ACM header Version 4 or higher, bypassing other checks!\n"); + return TRUE; + } Buffer =3D (UINT8 *)(Acm + 1); Buffer +=3D Acm->KeySize * 4; if (Acm->HeaderVersion =3D=3D ACM_HEADER_VERSION_3) { --=20 2.16.2.windows.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 (#74124): https://edk2.groups.io/g/devel/message/74124 Mute This Topic: https://groups.io/mt/82114465/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-