From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.8390.1687924425066183644 for ; Tue, 27 Jun 2023 20:53:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=AR2/VU9t; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: michael.d.kinney@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687924425; x=1719460425; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=z3MF2ErFMF6fodqe3vyn7Urze7bTsISceHBCBVUoAQo=; b=AR2/VU9tGtZqXLRr/1foYuIznndPtH2+IL35UgdE+BDoA6+YhvEA42mb ZAAzFr9G1EnHcMflSyjwZJtB3gVnFHdk/eyil47ZbXMkaGYzlmzXg6Tkn Uzd3j/x1ycwueJ8O1141ISP8+fUP0sxPg5VN7kY2Sw+pHiBRPE1OkzkxP u8TGbXWetREL6VDMsm2IA1jsrhqO0TfrtD+Kx/CcUMGoZmbcG9uDYDrYe Qe5D2StVySDBzWuuDaRp0lxNsC5JvboiytPGgqS6mNLVl+UhEePh+raxF cN691vZwYa038Ll1Tw1QmeOIN28z/HHeMuLVPILgK4ATF3A7hMEDh6hmH g==; X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="365197190" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="365197190" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2023 20:52:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="716779458" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="716779458" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 27 Jun 2023 20:52:27 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 27 Jun 2023 20:52:27 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Tue, 27 Jun 2023 20:52:27 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 27 Jun 2023 20:52:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbWGYF6YOD0AQvgTzRZSFr6CpHL/FQUlXd9G79G2xfldUwJnLiDnonHRj2OV9g31HxjchSg68DY5H3tEzeH8mpPcVpaqoqXMvPIuACsJETTTvCq+V+NK5lmJ4ApmERHigzk30ma6vlfG6qXUo9vAaqYa6zwVzBsM+GvSPovLq0Fjhe6yUj/UbOImHF5GUIpM61lhNT1h8Sz8lVWoXu1zlLl7p3uNHlBo1wegHqmyS3jvPtujY3GN+KqV6YGfG8Tim+LSzJzNq/NVrcOd87bTv7AdsHle5VOdBJUnmMcJLffVfjBXllk/hSgLPLUxoiUMP8RMci9VtdOzowu9zKk2fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FYzklf4UlBCaPXo1WDWK4n7ee3vdImbiR7c2buTAx0A=; b=YTZFtfXjqQIPNBlGh7do8GpA8BjgI2IOb4z0AObbjSw8G7TQk7rZJJ+bsgn5CXKjz/QNXTe5UQk8MBDWL3C5NbUVjpQP1Wpeag+a54tKvbdOF89hvNBWdJ7i3CNgvB7vNMhC8sNy3Tl0mFusHBqWXvpd/gkHnyUMbHRYzRaTRybnedQE2km+IMsc/lGRaNhEB5E/sMgo1ho+AeIesckFd7WwHLFID4B8SQJQgz0etRPtG4u/vEQhr/uEYnSrNWJzmgbGHvD/CPGNbn0TJgRTARK5BjM5nnh5qKUNOqyQUsujeDxujyHC8aimGuWC52by8/k4Ciw1y7OgpuzRgFBTrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SA2PR11MB4938.namprd11.prod.outlook.com (2603:10b6:806:fb::14) by SJ0PR11MB5645.namprd11.prod.outlook.com (2603:10b6:a03:3b9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 03:52:23 +0000 Received: from SA2PR11MB4938.namprd11.prod.outlook.com ([fe80::f7a7:8a51:7ca5:4784]) by SA2PR11MB4938.namprd11.prod.outlook.com ([fe80::f7a7:8a51:7ca5:4784%7]) with mapi id 15.20.6521.024; Wed, 28 Jun 2023 03:52:22 +0000 From: "Michael D Kinney" To: "Clark-williams, Zachary" , "Li, Yi1" , "devel@edk2.groups.io" , "Andrew Fish" , Leif Lindholm CC: Maciej Rabeda , "Kinney, Michael D" Subject: Re: [PATCH V3] NetworkPkg: Correct the length of EAP Identity when in ASCII format Thread-Topic: [PATCH V3] NetworkPkg: Correct the length of EAP Identity when in ASCII format Thread-Index: AQHZqUDHyHkbnSnXiEOiYGrAr5ZJ4a+fYkGwgAAzB1A= Date: Wed, 28 Jun 2023 03:52:22 +0000 Message-ID: References: <20230626054034.2346-1-yi1.li@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA2PR11MB4938:EE_|SJ0PR11MB5645:EE_ x-ms-office365-filtering-correlation-id: 61681386-b236-4eb5-b61e-08db778b142a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aL6JuCSL/j75iM9S3WrGZ3uXfmOr4APvdl0U1WsyejxBxTa/UX75iXyEGuxf0XxPdrrMKbU8+gq9Bn5uqX5VwOBTJ1Cn8s4lhQKSO0PukImcuJumEuQePK3fEB7MusIX5y1SmwN2plsLdfrMQMv/htlnr5n5b95bj1TG6lbJAgxVwNYoG51/qbIN4U1fGKb7lOd8RytEcZxixXT768NsUBM6lwXEacQpskZoR1h/plXThPjxX8Egw6C0yz5luHj9kTh4PRGvKqP+s+vMwbnprA0jKwDTQ2+O4vY+TTgD1hR9DekFRyXGvAXyxmaCUXM1DRekJDbup4aD3VB3es7LWyh50Ax6WH8Ih5wjCsixtI1l5aBlFA8qVN2n6hphcR0g8ULThD5cAiPCfaQySd5gKE/Zs7go0/a+blbvTbFZurNTDPJ+LwMpe6FL8NIBBdIzHntOnY/2P6bxJj580r2zc0Fw34WL/viqQhvGbiKo+5Dk6I/qw2M8Ld8o9B0tnl3qJFMcKZ9O+D5HyeqBGKF2I1GFLWP0waV3Te0tjkaZ7FEV/GL5zbjD9ghAeT/HOW0jdsjC/aO3s+yL98270AJg5SJj10jkd/19fTCRhMTq4tpLbnfSGKbUe63cSjB6lJmNsRYTyU0JJNzJwV87IP1c5A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR11MB4938.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(39860400002)(346002)(376002)(84040400005)(451199021)(66446008)(38070700005)(26005)(66556008)(66476007)(33656002)(122000001)(5660300002)(52536014)(86362001)(8936002)(41300700001)(4326008)(316002)(8676002)(82960400001)(66946007)(76116006)(55016003)(64756008)(38100700002)(110136005)(966005)(6506007)(2940100002)(53546011)(9686003)(186003)(2906002)(71200400001)(83380400001)(54906003)(7696005)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Sq+KUJ64Xrv7CYr5UrST+ETmBSzD73k/uAhLqJtP+R4nhYczGW+4w2P8VhPx?= =?us-ascii?Q?g6ePIR7NJ+LK5uiXzw8v4SOGNy2RCXJ7sBbAWDgEGb+dEyhAGDlFBHW1sMB0?= =?us-ascii?Q?lxcm5lbxzi147ZsOUh+ViaBJ2TvRHC5907J25kuSPZ7F6hvqSuukJ5vcMyK1?= =?us-ascii?Q?GiHqAeisCxhMZtEs3IR3ofW09b8Tli467OrZ86wYn65hfcQqHAVv0NTr8y0j?= =?us-ascii?Q?Y0WlOsRnDCZU1KDPVvDsCH5ovzlsN3T89DziaZSjrzP4wQi7DV5iy+ntwixC?= =?us-ascii?Q?qSvwCnRwGpIxUpH3SJz5Tu8J8rvsQad7YGlmJ90CskDPmgjbMxaTDEHi9NWd?= =?us-ascii?Q?E9nbdp7BUjhzCpZZOU7NV5N0tMB8a18pL2aDY8Fk1WQX3LDvQX9lVZlOfzu4?= =?us-ascii?Q?cHqf+rxFCfKpILCBXry9A7WOjKuQUUiqoDSLGsw7ykJlc61TataOq09BhoVd?= =?us-ascii?Q?pROYpMfaok6sDcMHz09Qwhw69kTZGVk+/shjIBJHvQBmw0O+jS6BAJuA2bBt?= =?us-ascii?Q?t3vO4ylSxIZYLKgYX9qbOJi3WnXLdPBBOx44m9/G8rw+M4NU4DBFm3ZjgsCa?= =?us-ascii?Q?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2Up7PxiYL/UsO/JD0yp0?= =?us-ascii?Q?pRKuxRzTX8eb58OMMi6/tQyn/ABLVubaKVwLibfLY5JJc9IaX7Sm+b2Zz+f6?= =?us-ascii?Q?iehR0fH95Awq2sBrHjl6uVfz062I/7ygS3uO8j7cEv3H9kJ5c2AL0rLW0Ost?= =?us-ascii?Q?kQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR11MB4938.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61681386-b236-4eb5-b61e-08db778b142a X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2023 03:52:22.4999 (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: mBX0UD7pdkzVXPkA4qJIa62FLM8FAEc8l+HODS2YkFIX6QhBlzVDkNzm5QZ5AJq9kgS5aRR28ropmKcO0z/7YlA6GS704wp+vjhhipjOQLw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5645 Return-Path: michael.d.kinney@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Merged: https://github.com/tianocore/edk2/pull/4584 > -----Original Message----- > From: Kinney, Michael D > Sent: Tuesday, June 27, 2023 5:50 PM > To: Clark-williams, Zachary ; Li, Yi1 > ; devel@edk2.groups.io; Andrew Fish ; > Leif Lindholm > Cc: Maciej Rabeda ; Kinney, Michael D > > Subject: RE: [PATCH V3] NetworkPkg: Correct the length of EAP Identity wh= en > in ASCII format >=20 > Working on it: >=20 > https://github.com/tianocore/edk2/pull/4584 >=20 >=20 > > -----Original Message----- > > From: Clark-williams, Zachary > > Sent: Tuesday, June 27, 2023 2:46 PM > > To: Li, Yi1 ; devel@edk2.groups.io; Kinney, Michael D > > ; Andrew Fish ; Leif > Lindholm > > > > Cc: Maciej Rabeda > > Subject: RE: [PATCH V3] NetworkPkg: Correct the length of EAP Identity > when > > in ASCII format > > > > Reviewed-by: Zachary Clark-Williams > > > > Hey Michael, > > Can you help with this change merge? > > > > Thanks, > > Zack > > > > > > -----Original Message----- > > From: Li, Yi1 > > Sent: Sunday, June 25, 2023 10:41 PM > > To: devel@edk2.groups.io > > Cc: Li, Yi1 ; Maciej Rabeda > > ; Clark-williams, Zachary > williams@intel.com> > > Subject: [PATCH V3] NetworkPkg: Correct the length of EAP Identity when > in > > ASCII format > > > > FIX: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4477 > > > > Tls connection fail over WiFi in AMT OCR flow due to invalid identity. > > > > This was due to missing conversion between unicode and ascii string whi= ch > > resulted in invalid strlen. > > > > Cc: Maciej Rabeda > > Cc: Zachary Clark-Williams > > Signed-off-by: Yi Li > > --- > > .../WifiConnectionMgrImpl.c | 21 +++++++++++++++---- > > 1 file changed, 17 insertions(+), 4 deletions(-) > > > > diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.= c > > b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c > > index 2e596c1981..d1182e52bd 100644 > > --- a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c > > +++ b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c > > @@ -572,15 +572,28 @@ WifiMgrConfigEap ( > > // Set Identity to Eap peer, Mandatory field for PEAP and TTLS > > // > > if (StrLen (Profile->EapIdentity) > 0) { > > - IdentitySize =3D sizeof (CHAR8) * (StrLen (Profile->EapIdentity) += 1); > > - Identity =3D AllocateZeroPool (IdentitySize); > > + Status =3D gBS->LocateProtocol (&gEdkiiWiFiProfileSyncProtocolGuid= , > > NULL, (VOID **)&WiFiProfileSyncProtocol); > > + if (!EFI_ERROR (Status)) { > > + // > > + // Max size of EapIdentity ::=3D sizeof (CHAR16) * sizeof (Profi= le- > > >EapIdentity) ::=3D 2 * EAP_IDENTITY_SIZE > > + // > > + IdentitySize =3D sizeof (CHAR8) * (AsciiStrnLenS ((CHAR8 *)Profi= le- > > >EapIdentity, sizeof (CHAR16) * sizeof (Profile->EapIdentity)) + 1); > > + } else { > > + IdentitySize =3D sizeof (CHAR8) * (StrLen (Profile->EapIdentity)= + > 1); > > + } > > + > > + Identity =3D AllocateZeroPool (IdentitySize); > > if (Identity =3D=3D NULL) { > > return EFI_OUT_OF_RESOURCES; > > } > > > > - Status =3D gBS->LocateProtocol (&gEdkiiWiFiProfileSyncProtocolGuid= , > > NULL, (VOID **)&WiFiProfileSyncProtocol); > > if (!EFI_ERROR (Status)) { > > - CopyMem (Identity, &Profile->EapIdentity, IdentitySize); > > + // > > + // The size of Identity from Username may equal > > + // to the max size of EapIdentity(EAP_IDENTITY_SIZE*2=3D128 byte= s), > > + // so here only valid characters except NULL characters are > copied. > > + // > > + CopyMem (Identity, &Profile->EapIdentity, IdentitySize - 1); > > } else { > > UnicodeStrToAsciiStrS (Profile->EapIdentity, Identity, > > IdentitySize); > > } > > -- > > 2.31.1.windows.1