From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 89391780091 for ; Sun, 19 May 2024 13:11:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vZgu/EAVr5VkL8jf1K/t9usPxLHqPK3klnT6i1qPFpM=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1716124270; v=1; b=NLV7CnqqEwZInM7FZpaOi28N/TUYbjjNl0p5QC2f9aau56HA3+rcwcSmgSPqZlHJxYfjg4E/ dtkoz57mjNuA7PEQFNvi7UZ/jnLS2PhPEokTgu9j0KhcE4cplQ48DPZHeZRs75cdIHKBvNQ2aUO WyYFvE15nv/aHRVOTokgdGHWVofqPQoNAc/OIzO/23qx3xA242FkWC2BhDCGNpGOt1SzjuNhfsb XmRlk4bNwakZvILKi2F0SkNUxMN9+9LN8G/2H1HUCDcenZ66JiGWdVTupIAtbJusA2pQUvBGWBA tZiQ7QyqsSqLy5tpFoSwHlHUGdfEfKkrST5SzHR2Zm+nw== X-Received: by 127.0.0.2 with SMTP id F6iAYY7687511xFCXrcl7Ujs; Sun, 19 May 2024 06:11:10 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mx.groups.io with SMTP id smtpd.web10.38142.1716124268706626729 for ; Sun, 19 May 2024 06:11:08 -0700 X-CSE-ConnectionGUID: CTFM61e3RASWY3zIEljvJw== X-CSE-MsgGUID: pxMCgCn9QYGvQp14T+F9NQ== X-IronPort-AV: E=McAfee;i="6600,9927,11077"; a="37635219" X-IronPort-AV: E=Sophos;i="6.08,173,1712646000"; d="scan'208";a="37635219" X-Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2024 06:11:08 -0700 X-CSE-ConnectionGUID: Y+6yfzjNQD2SRI0NuFG2aQ== X-CSE-MsgGUID: x2Ts9ToJTdON9F9mm2eCKA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,173,1712646000"; d="scan'208";a="32693607" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 May 2024 06:11:08 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 19 May 2024 06:11:07 -0700 X-Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 19 May 2024 06:11:07 -0700 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Sun, 19 May 2024 06:11:07 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Sun, 19 May 2024 06:11:07 -0700 X-Received: from SJ1PR11MB6227.namprd11.prod.outlook.com (2603:10b6:a03:45a::10) by DM6PR11MB4673.namprd11.prod.outlook.com (2603:10b6:5:2a4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Sun, 19 May 2024 13:11:05 +0000 X-Received: from SJ1PR11MB6227.namprd11.prod.outlook.com ([fe80::c4da:83f1:f7be:e307]) by SJ1PR11MB6227.namprd11.prod.outlook.com ([fe80::c4da:83f1:f7be:e307%4]) with mapi id 15.20.7587.030; Sun, 19 May 2024 13:11:05 +0000 From: "Li, Yi" To: Sountharya N CC: "Yao, Jiewen" , "devel@edk2.groups.io" , "Li, Yi1" , "Shang, Qingyu" Subject: Re: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for correct return value checking when get X509Cert Thread-Topic: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for correct return value checking when get X509Cert Thread-Index: AQHapsejtmk4AM/ZD0GN4AeS5h36ObGYa9oggAYhxnA= Date: Sun, 19 May 2024 13:11:04 +0000 Message-ID: References: <17CFB34C84CCD610.5173@groups.io> In-Reply-To: <17CFB34C84CCD610.5173@groups.io> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ1PR11MB6227:EE_|DM6PR11MB4673:EE_ x-ms-office365-filtering-correlation-id: 354cb15b-a7e8-4c4e-6012-08dc780523bd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?tWePRqYZKH2EWWWR73Ltm15Sh8dnh4wc8tbnhD0wYyqpKDLQhMu6JqbVgijl?= =?us-ascii?Q?Z8Tu/xT7IgIsS51C+OKa/VzgJELm5jAjjrGADGc68XvS5CmsjeUaivWedQOr?= =?us-ascii?Q?knF7xGwwg+JUZ14hquGYkut61YxLsnxJXeqL305tus2Tw00Du1R0GSvgQtcP?= =?us-ascii?Q?HH8F1uDnJnpSzk0j63PwyZf4GOCjH3F9qvlyfSIS+DvxrWyKYlbDGQ6nNob2?= =?us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ju0FTrPaghx/cJR1nKHhtHk3qNdYmVC?= =?us-ascii?Q?pu6144ds+v2vKJ3dUXezmz+yz4FXgz5DfOXxKkydKSz3Pl05uvgAt8HYcmUC?= =?us-ascii?Q?QyITkXzd5vkTTP50Os1Pyq6EdvgRJP33VYlrJ5sIGG5mA2lhpwsBjN8buS1N?= =?us-ascii?Q?stEhpZVoL8F5HdLAGDaYRlXj6epu4dnUm8oM5+6Ps1pEvyIKqkyumb7BBn8y?= =?us-ascii?Q?YOo=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WqTEDQhqgxz6BtGy1aHIeRi3fDxEPxIke0yWkuh8x8IuxjmWCXdN/P6QlZ3K?= =?us-ascii?Q?ZOEeEefEjiXu3mHAp0Kf74+QbpOZFHwVObV5RIOZnaUei5d/pzcie9P8B4kv?= =?us-ascii?Q?DbQVEvJb71xTQgJwqn/MSH/LbtXo6vZQsVkrOjZLpKgzNyEO6jyquIH/gTE0?= =?us-ascii?Q?nnpIUw28I1cV7LBVksf8eY1ef++WKppNi87QVhx4pac1syNPCapTLC+BRRWU?= =?us-ascii?Q?G4zdvPTksXVCuWg8WBBvrslUdYipG4BrHfTnOmMNZ6fN7DEDq8dhWWs/5TWQ?= =?us-ascii?Q?omqyIi6w+jATVgCVHwfgLx5+bnHzLbpLvPWHqLx9FJmuaj1iEAEGaSSRs1al?= =?us-ascii?Q?zRbMSagVkeS/4bV7rMfx84WKDmSFH8GnMBWc4fc9uVV3/D2Xta99vaESx9KI?= =?us-ascii?Q?DktXQOUjSlxNpZ3dn89nwHycqEdN9hjPn8vPerYHH1HBXFmrvq8+q00M83/V?= =?us-ascii?Q?5+xGQ/DuMbh4q/FfroIP9Wvf6Kk2LFBvt86uSlHbZ3Lxzax77zl8o9u6UT9L?= =?us-ascii?Q?y5W4b1ukzRUdbvT7Ant6Eon2gVyFGm19czOhP/PC9UVn6JEBtb1gGvKVbqT2?= =?us-ascii?Q?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RJV2/gaCHh2BS?= =?us-ascii?Q?+SoVw4f64XdVIEErXJtIpmnT5Lkivi8naD5VXb+PK1za/g6gZJEXatTCqhzZ?= =?us-ascii?Q?0Y3O0JB+WJzd0aKwhrw=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ1PR11MB6227.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 354cb15b-a7e8-4c4e-6012-08dc780523bd X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2024 13:11:04.9161 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: N4kEa0+tWqgsKjuymWaKRpoKQB84xcbRLBRlfDdKHzGckNH3cypIITY3WWKktu6NqVSQhanvreyMDUMoLFksyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4673 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 19 May 2024 06:11:08 -0700 Resent-From: yi1.li@intel.com Reply-To: devel@edk2.groups.io,yi1.li@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: UYLS1u514tbPePwinrIUPfa5x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=NLV7Cnqq; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hi @sountharyan@ami.com, I already asked Qingyu to help raise patch. Will merge it after hard freeze. Thanks, Yi=20 -----Original Message----- From: devel@edk2.groups.io On Behalf Of Li, Yi Sent: Wednesday, May 15, 2024 11:32 PM To: devel@edk2.groups.io; Shang, Qingyu Cc: Yao, Jiewen Subject: Re: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for correct return= value checking when get X509Cert Looks good to me. Reviewed-by: Yi Li We are in Hard Freeze phase, will push it after freeze. Thanks. -----Original Message----- From: devel@edk2.groups.io On Behalf Of Qingyu Sent: Wednesday, May 15, 2024 8:58 PM To: devel@edk2.groups.io Cc: Shang, Qingyu ; Yao, Jiewen ; Li, Yi1 Subject: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for correct return val= ue checking when get X509Cert From: Qingyu REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4509 CryptX509.c file has X509GetTBSCert() funtion and it is added Inf variable = to collect the return value of ASN1_get_object(), which return 0x80 in erro= r case. Supplement the return value check during the second function call a= nd correct the check logic. Signed-off-by: Qingyu Cc: Jiewen Yao Cc: Yi Li --- CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c b/CryptoPkg/Libr= ary/BaseCryptLib/Pk/CryptX509.c index 1182323b63ee..7ebec9dbad5b 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c @@ -839,17 +839,17 @@ X509GetTBSCert ( Length =3D 0; Inf =3D ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (in= t *)&ObjClass, (long)CertSize); =20 - if (((Inf & 0x80) =3D=3D 0x00) && (Asn1Tag !=3D V_ASN1_SEQUENCE)) { + if (((Inf & 0x80) =3D=3D 0x80) && (Asn1Tag !=3D V_ASN1_SEQUENCE)) { return FALSE; } =20 *TBSCert =3D (UINT8 *)Temp; =20 - ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjCla= ss, (long)Length); + Inf =3D ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int= =20 + *)&ObjClass, (long)Length); // // Verify the parsed TBSCertificate is one correct SEQUENCE data. // - if (((Inf & 0x80) =3D=3D 0x00) && (Asn1Tag !=3D V_ASN1_SEQUENCE)) { + if (((Inf & 0x80) =3D=3D 0x80) && (Asn1Tag !=3D V_ASN1_SEQUENCE)) { return FALSE; } =20 -- 2.44.0.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 (#119066): https://edk2.groups.io/g/devel/message/119066 Mute This Topic: https://groups.io/mt/106113214/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-