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 423B8780091 for ; Wed, 22 May 2024 00:53:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4vbtdDFWhgi/mM7lPsuchQ2kOITqMnYmRrrZRuSmAHs=; 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=1716339233; v=1; b=Ap81rrG03RV48gxFqs99rXnQh3wLxycXSihH9hMk3hBaWSp6K7iSN/dUY/I6WW/0tTm+gXE9 sZFwpp/zq1id07lRpeDIDe2oYZTNIr0WILWeVyhcGOscX4EPiX8yl3+wjdbjefxQzKTKNvM9HEq R2S3EnXDXpWxjlo9eb/gBKc67p4O1wy1oHNr+o7DRmCXkV7mVa0p3EKMGAH26+b892tVzn6Kpqs JffwPLvXdWw4y8Xo48mvOHu/m5h8UqtPG6nHh8+9ztqbqP8kwenpaEG5DM4/TGvG9RnJZdoR/S7 w34As3E3V0NXdyH0MFMrsK4gWrEXGZ6ROpljieNHUojkw== X-Received: by 127.0.0.2 with SMTP id NpstYY7687511x6MQ3pKix4a; Tue, 21 May 2024 17:53:53 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.99]) by mx.groups.io with SMTP id smtpd.web10.52872.1716180156195314828 for ; Sun, 19 May 2024 21:42:36 -0700 X-Received: from CO1PR10MB4594.namprd10.prod.outlook.com (2603:10b6:303:9a::19) by DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 20 May 2024 04:42:32 +0000 X-Received: from CO1PR10MB4594.namprd10.prod.outlook.com ([fe80::9234:7e3f:da96:59eb]) by CO1PR10MB4594.namprd10.prod.outlook.com ([fe80::9234:7e3f:da96:59eb%6]) with mapi id 15.20.7587.030; Mon, 20 May 2024 04:42:32 +0000 From: "Sountharya N via groups.io" To: "Li, Yi1" CC: "Yao, Jiewen" , "devel@edk2.groups.io" , "Shang, Qingyu" , Srinivasan Mani , Prarthana Sagar V , Gayathri Thunuguntla Subject: Re: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for correct return value checking when get X509Cert Thread-Topic: [EXTERNAL] RE: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for correct return value checking when get X509Cert Thread-Index: AQHapsejtmk4AM/ZD0GN4AeS5h36ObGYa9oggAYhxnCAAQSTYA== Date: Mon, 20 May 2024 04:42:32 +0000 Message-ID: References: <17CFB34C84CCD610.5173@groups.io> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR10MB4594:EE_|DM6PR10MB4313:EE_ x-ms-office365-filtering-correlation-id: 58ab5e55-3adb-496b-fbf8-08dc7887431e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?Uj8vJZNzMsD5D7j2y0JdiemCyy3D7j06u64AWdODP4tlvul32NacmgdPkgyk?= =?us-ascii?Q?Hj0o0TmT94orm3ekZGhWVGZjUyKn696YurAptslQVtYLBQacMLktTW5yMpKl?= =?us-ascii?Q?zgvtJ5r4REQ9iD97gozqBXkRBahNwZohT7LpMggPYMOpXpUlGrPclwuO9qDq?= =?us-ascii?Q?lU3+fzlR6CFTn2CW8CiR6zQBGwvvvMqS/kELKmjCLk1uFIZfypgBPSUH+L1p?= =?us-ascii?Q?EeJDlIn8o8Y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iNBJRa?= =?us-ascii?Q?BjJz8qhwzFypq95X5kW2xRrLmCtlK+7nIPLOEXGDATmkOziNkql5ZE60zztx?= =?us-ascii?Q?RB6vOUV8VoT00LWsqBH0PnaerdaqMnnQdmZ3EPWiCt7lDBv8e95eodvx/VRL?= =?us-ascii?Q?pedQL52I1vF8L14v80r2G9Ka3H5jbkEt5/86mrjqcg=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5C5qSTeUpnzfYbKy0UcX1qHhlqoWjxA+/AYE7cI6ByvaeojUfYyO/gNn3gD0?= =?us-ascii?Q?4KN095FaIENhhVRmwZOB0obt9gViJTGVhFoQZ+xiYCdir6AMBkk8mANoLnye?= =?us-ascii?Q?yuH0LXCbdc3oJAyiv2UzyTriqDVm+wiVNKTOTA4j6WG/03E/B7k7gNCyZx47?= =?us-ascii?Q?AH3l42sA2/vGrkkM/yKGt9eKftFjnpjuGKwWeQB51FWqNjVtJAmE2PTr/LZ8?= =?us-ascii?Q?3SqHKzC+O8S1A9dJRcJ9oX2t2qM4V/F6PE8Nl9cDptresp5WQzfhBs44cQjj?= =?us-ascii?Q?GKXqr4HUXw+w5Q1InZjBks4AdxLiko79mYoy6Tp4YKiBwSah+l4GhuF6voTU?= =?us-ascii?Q?RodubKvLcMeLJ5gcCoKZlnNazyYcx5Vw9lk+6A6+kHR2mnGPfI+HibjEHI9n?= =?us-ascii?Q?KmuzoV0njsjIRs5vQdyHRDRueBQe/hVC7Zbq/ZUxG+JMU26kXLlW8z6LGPcS?= =?us-ascii?Q?LMnYKHvmAynfkz4CtHplULMOrzsfttGtwHyMiR6agj1rcqOzpWeGiy4w5WrY?= =?us-ascii?Q?5mYjkKTNfpopswt7fwXrcXwRRLlh0tJ7sNvW0CTc1z3DsS/LAUlqtjWk0pKj?= =?us-ascii?Q?XcrBdmWN4YcLZM3WXRlqw0NJWb6+LryeOzI13puLZAEtZuvqsnjL3bS6aRGn?= =?us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NOS/os6oasiWQ?= =?us-ascii?Q?KTFRxh8sb3v1lCEj3vcbYjf5rshHXVgZNhrbD0UR?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4594.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58ab5e55-3adb-496b-fbf8-08dc7887431e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2024 04:42:32.1439 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WixMw2r81kNjCtwWPNRRj/+sGfYUFU+YTrSxOSYqy07NDLyT9CGdy8HlZtim/EO5SpliUabWFtUVU1vKAme5xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4313 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: Tue, 21 May 2024 17:53:52 -0700 Resent-From: sountharyan@ami.com Reply-To: devel@edk2.groups.io,sountharyan@ami.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: iemedIMr1MIRmP03Nn0F1bBEx7686176AA= 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=Ap81rrG0; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io +Srinivasan Mani, +Prarthana Sagar, +Gayathri Thunuguntla -----Original Message----- From: Li, Yi1 Sent: Sunday, May 19, 2024 6:41 PM To: Sountharya N Cc: Yao, Jiewen ; devel@edk2.groups.io; Li, Yi1 ; Shang, Qingyu Subject: [EXTERNAL] RE: [edk2-devel] [PATCH 1/1] CryptoPkg: Fix bug for cor= rect return value checking when get X509Cert **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** Hi @sountharyan@ami.com, I already asked Qingyu to help raise patch. Will merge it after hard freeze. Thanks, Yi -----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); - if (((Inf & 0x80) =3D=3D 0x00) && (Asn1Tag !=3D V_ASN1_SEQUENCE)) { + if (((Inf & 0x80) =3D=3D 0x80) && (Asn1Tag !=3D V_ASN1_SEQUENCE)) { return FALSE; } *TBSCert =3D (UINT8 *)Temp; - ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjCla= ss, (long)Length); + Inf =3D ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int + *)&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; } -- 2.44.0.windows.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= . -=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 (#119109): https://edk2.groups.io/g/devel/message/119109 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-