From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web08.999.1667156184436139854 for ; Sun, 30 Oct 2022 11:56:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=K7frUUZo; spf=pass (domain: ami.com, ip: 40.107.236.40, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mDwk6/loXpXf144et4gAI3TYkK1w2N77Tkm3V4RvCvr/sHPg0w8+Dt3dzFaXtiRV0M1Yf3pPVupuLP2Oa2HAS7e7/j8LU7Fu29xS453TYTOSvgOklktiLbCgyXEfqROTK4KGfH4zzHAnaQTs7aa/ONskHVAwxWCAPpysjeIq59xN+Yv3ypeRwIv4vmv3qENY5eP+3/coL/vbf0jWV9eGoQcpH7N1l0arvlsreuA1zcHe8Qs1lu3LceiBSAruIKX3aTC1PGToiKTj+mWU6JAl1LjU/g5h0r/ZRsbjMUVsSC2VhhvNzKI/ZefwnNrxcFzgbyO+cQXNA3dvEkvjC7gaKg== 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=9sjDYI+Mm9L87bikxRJH++OnNDR/vce6wXhKMWEtZzs=; b=lMKKICUyg/LsE+gz7kzbXkCutZN+OfRPaV12z3V115GFdCJ6VylaNGKZYGJuqlrH8XYD6e7P2L+bnTZstnbbIeYGPNmi1LkdXplqO3FqsOoKrBtot8IAF3OI99NPCzqojA2H5kaOeT0LD5bsfTkNJxcZkP2P95CIvqD59qC1bFu4ijB+/kTcbbiAwLzXjLbZ+hJTEbsV7CJium057wei0m4yFYFUFptL9Vrw/Nnh795vy/EenrpDqLPiO/hbUy+llmYGWZDiNK3XLNQHR5eHtzZsh7XHDTffRpzU/RvHMzpu6vra1J48cPQfaX767RVYHgnF+RWFna1XYMRWbb2t4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ami.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9sjDYI+Mm9L87bikxRJH++OnNDR/vce6wXhKMWEtZzs=; b=K7frUUZoSMA+OXrB16TyNPMctuH06ix7fEjs+0qMedhjG+YLkCraZWCVQTKpGitlIBDlHNss5pbzTKdfnkRn6gj4SktI9AbE8d4CYgKbNDBpWUMiqNCSLhAN6NOMZ5yy6FEazrQPt+8fQlpxh53kqa6zEYnauzFv8qW7gGL/1h0= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by DM6PR10MB4203.namprd10.prod.outlook.com (2603:10b6:5:219::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Sun, 30 Oct 2022 18:56:13 +0000 Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::473b:192f:7fa7:8bbf]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::473b:192f:7fa7:8bbf%6]) with mapi id 15.20.5769.019; Sun, 30 Oct 2022 18:56:13 +0000 From: "Igor Kulchytskyy" To: "Chang, Abner" , Nickle Wang , "devel@edk2.groups.io" CC: Nick Ramirez Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation Thread-Topic: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation Thread-Index: AQHY6EsYXS94wpev0kC4g3CHzmE5HK4gwjhAgAF8cICAAApJAIABKbEAgABkfNCAABJXgIAABJ3AgACLjQCAAp+yAIAANti4 Date: Sun, 30 Oct 2022 18:56:12 +0000 Message-ID: References: <20221020025434.29969-1-nicklew@nvidia.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=ami.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|DM6PR10MB4203:EE_ x-ms-office365-filtering-correlation-id: d404f3eb-9222-4b0b-9eec-08dabaa86a70 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aU+vz08Y3XVMiL/Tw8LyiGk0ARUxr5ucGs8cx1uxST7wsM1PjkRHKa7pLwsiYoMP8z6BymncZaOJkGJQhjebW65HCE+z69ah0HHyDKdRubjBfVDeX+yG0El+yzWjPf48f2716PjVkOkw+8LNvuFI37meLbHk+KCrrwFFJ5cQiIN4iTckKoff/Eni1/LaRQbvi4fBMRzcOiE/dmliZ+ZW6Lo5Xf+3dzLipVyXmuG8zlZCCmHX3r2kop6qLDZjqeeuUNh/0aprsxa35chkjsqJAia56/CZ6eRPcWk7qqbor6jPWlIA0JO0ov4mvojwHEwQcGX/DxNBp4/Ypw44/ZpZYzdozhoxq5FzUIse7jbWBJtWlSEsEiwvogbF2uWwWlYKkPmkTNXYaiwKx5ywhf+vpq0goKviSIGQ+/jEKswsjKWfMyYVfIDEYlsQMH11nd+o9XveFfxee/E15M0EcjaGPfrnI1bVGgFanpJ2vveJJgH/Yi2WKeR/mjNDJEP5403RYqQq/5p9RQNrfY0RsknvO15OLV8Nh1B950C1dflroJtNbb3W18x7PXCL2PmermOa9isto9aggw+SN4TAevfuwWh6F81e8lQCS5qChRzLBgLC9L4MaEfZ3pZ46hiFlIMyJKv1dBWTzqSSKg6acB/jtT28LI/nSCXukLQ0sCQhv51Rvbs5+t1Ie7gUErIAlU77I4HDzqlX55Iq2OL7TTkEx1Ft9Nq3YeJJrbQyjsPfsj3ua7y+ntW9aosl6mA6sFqKghZASPtwcw+tERO8BkWw3TIUt9/V0Vfz7T6km2AJx9CRYdBl4XGVx/Obq5xJoUGAwVGXJmE87C3Zgs6jlxhXAQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5185.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(366004)(39830400003)(396003)(346002)(451199015)(66899015)(40140700001)(33656002)(86362001)(122000001)(38070700005)(38100700002)(166002)(83380400001)(30864003)(55016003)(2906002)(26005)(6506007)(7696005)(9686003)(186003)(478600001)(53546011)(19627235002)(316002)(966005)(110136005)(52536014)(66946007)(66556008)(66476007)(66446008)(64756008)(41300700001)(4326008)(5660300002)(76116006)(91956017)(8676002)(71200400001)(8936002)(45080400002)(559001)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?wJvwBLQYUgFVDX7Pxt8EJAmJeFns/34hidhB3+yQzjtibXw/bXh64QqU?= =?Windows-1252?Q?olRfyomZT102Kqew2/E7osIDcsgSyUxlFLoUDgVqAdgEqjq1VM3i2ieT?= =?Windows-1252?Q?HVytOW1NpvGNBiRv7HXZb/O6urym1wWhr7IwoZvUICoBHfyO8lNNF/bU?= =?Windows-1252?Q?cr81nUfl6Zoxrr8Oii0vMQPlFgtc6aSYsKD9ESLMfXn+STG7AMZ3Qn9F?= =?Windows-1252?Q?B4vA3zWgzD0sehZ3ERqKoIb//HmhTOT15XM2X5Ckno4zgPEbtSyBe+Qf?= =?Windows-1252?Q?/1lPh9tAobnNi4gwzrZjbXkVi2UJ01sEI5PU8gwOWHmv4J1URiucc/dL?= =?Windows-1252?Q?Xtf+XSghLCUsgJb0MCWCeapmjUYbCUk+aF7OEnmmob9WHy7LSN4TWEnq?= =?Windows-1252?Q?Tv+aypgj6bOx9oU8Zg9E/FTI/bOIyk09J8OoXNvHpHpkdBCXxJGTm4Ih?= =?Windows-1252?Q?yk1+5griSukIlv381/5pzjbymuP/29J9c0RzugBKBs79u9JSDZCzkL05?= =?Windows-1252?Q?7CenhCEcf/zwxcLS14pM24U3PWvHxvwUglaOrVgPpMC+zA2BiiT+pJhk?= =?Windows-1252?Q?GgBZPoDzi2as8OcK0VgdFRyC7tiM5YiCxNy6M6FHKFz/8cHfZhqXqM+Z?= =?Windows-1252?Q?qmR4ZZF3LxrEiwnZu/1rkOFM0W+9DSl1NN726L7OPJ0846YCWbaW4v4i?= =?Windows-1252?Q?CEETDK8xJgFDGTwzvukPnu05FqUL1YIDAN5FpURuZbPKLtQrkRwIpqKO?= =?Windows-1252?Q?6EhovnwtzolB4OCF3efyJPQrMFh4HkkeVb3lEcTUM7OlUlYs/i+FUez0?= =?Windows-1252?Q?mY/tGq/+7GnrQ4KK7pNy5l+DeCsorA7RiqqlX1xF1UaXebqI5rLKE/EU?= =?Windows-1252?Q?laYJdsn/U0sXUqAhQ5tI8PwMlRNbt/l6DD+szydkryGQEktwOvccpEYd?= =?Windows-1252?Q?6iAYWG7/3OPqfjw92tMrKZ93NRskvLIoRF6818yQe5LOtv4SHw7Gm64S?= =?Windows-1252?Q?PVTu5vqK34+eGwNwXM4VrQHQqLZpVd/ElqxYdS3kyoEQv3gvSwSJQ3Pb?= =?Windows-1252?Q?WB7tt8TskdRfA8SuOMz8Ch3NCc8QhkcvqwM1C7Q2xJUXioLTmCd9Osys?= =?Windows-1252?Q?r1VgE+2yWJGkYROHvnDaD785v/pSqQcB7A/m1J8XmwMpemAL3NlYEy5U?= =?Windows-1252?Q?Uc3AlDUo5/HUhSEpoNPOdhrQbuDo7LGnQ4bApdj6A8fAhQfU+a3zZDIA?= =?Windows-1252?Q?bKh2oqqbaKOgzrigN7QVVgzX3pnmIdEO5rQiIZ0EA7AtRRGnDB35bQmW?= =?Windows-1252?Q?x1mjtjQd+vxXKutlyXMTWnVeUKaDWNytZaO6R5Aq4Z82kUz3oe+uRNI4?= =?Windows-1252?Q?CW4EHFpzV2NKDs8GoMmTmBYlzowYp2ESIs6t/mtePu1MrWK9mLHNNTbE?= =?Windows-1252?Q?UxKXyZd6yl6nY5Mv0XincYuPPLtrStjREdxj6mSwDfuAVrJMQ5WvBfJa?= =?Windows-1252?Q?ToB2FZivsWG0JeScE5YZcrYfdD5dPpn9jtVvdb6yY2IXSrqAt25WXj4x?= =?Windows-1252?Q?8QbPMMQD4hxHAoYgho33nmEu5JaBq3aqLGyTwhizjT8YYw+io4yr+w5g?= =?Windows-1252?Q?W4qhLtOw07MWFwsVh8tp/13L8R0rwVmpj2BoqFPYLbiecmF2Rli7Uhgi?= =?Windows-1252?Q?zxUsG+KbI+d+Mw1lV3et9J7Pkm2rLY8/?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5185.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d404f3eb-9222-4b0b-9eec-08dabaa86a70 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2022 18:56:12.9071 (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: JIQTUi5DtTQFLVWem4e/Da6Lv/9HNt1INfH9znM0Uich7JXSaHnVY5tMrVN02hDv X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4203 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BLAPR10MB51859FAFE5D7C7F9EB545118A8349BLAPR10MB5185namp_" --_000_BLAPR10MB51859FAFE5D7C7F9EB545118A8349BLAPR10MB5185namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Abner, "redfish/v1" does not require any authentication. But "redfish/v1" json res= ponse contains the links to high level resources - systems, chassis etc. My point was to get the URI to systems from that json response, rather than= have it hard coded. If both auth methods supported, we should go with more secured one - sessio= n authentication. In this case we do not need to send username and password= within each request. Thank you, Igor Get Outlook for Android ________________________________ From: Chang, Abner Sent: Sunday, October 30, 2022 11:33:26 AM To: Nickle Wang ; Igor Kulchytskyy ; dev= el@edk2.groups.io Cc: Nick Ramirez Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation [AMD Official Use Only - General] Does "/redfish/v1=94 require authentication? I think this solution is ok if= "/redfish/v1=94 requires the authentication. Another thing is how do we determine to use Basic authentication or the ses= sion token? Abner From: Nickle Wang Sent: Saturday, October 29, 2022 7:29 AM To: Igor Kulchytskyy ; Chang, Abner ; d= evel@edk2.groups.io Cc: Nick Ramirez Subject: Re: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. Hi Igor, Yes, we should get the URI to computer system collection by parsing "/redfi= sh/v1". Hi Abner, What do you think about this? And if we like to select authentication metho= d for Redfish communication in this way, we need to update RedfishCredentia= lLib.h because now the authentication method is not decided by this low-lev= el library. Thanks, Nickle ________________________________ From: Igor Kulchytskyy > Sent: Saturday, October 29, 2022 12:03 AM To: Nickle Wang >; Chang, Abn= er >; devel@edk2.groups.io<= mailto:devel@edk2.groups.io> > Cc: Nick Ramirez > Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation External email: Use caution opening links or attachments Hi Nickle, I think this is a good idea to send a request to the URI which requires the= authentication and then analyze the header of response. The only thing I would like to discuss is a hardcoded URI - "/redfish/v1/Sy= stems". Shouldn't we parse "redfish/v1" json response and get the URI from "Systems= " attribute. That, I think, would be more universal method. And that is what Redfish specification said, that user should be able to it= erate from Redfish service root "redfish/v1" to any redfish resource. Thank you, Igor -----Original Message----- From: Nickle Wang > Sent: Friday, October 28, 2022 10:53 AM To: Igor Kulchytskyy >; Chang, Abner >; devel@edk2.groups.io Cc: Nick Ramirez > Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation Hi Igor, Abner, Thanks for your comments. A quick summary as below: - BIOS is not supported to disable bootstrap credential service. For securi= ty purposes, BIOS should shutdown credential service with its internal cont= rol mechanism. - Credential libraries need a cache mechanism to prevent multiple queries t= o BMC. All applications in BIOS share the same credentials. - The storage of keeping credentials should be deleted before the end of th= e DXE event. So that the credential will not be retrieved by unauthorized u= ser or application. (e.g. user can read variable under UEFI shell with dmps= tore command) There is one thing remained and I like to have further discussion. For the = authentication method, do we think that client user can decide what authent= ication method to use regardless of the requirement from server? I am think= ing a detection mechanism as below: Issue HTTP GET to "/redfish/v1/Systems" (which normally require authenticat= ion) without authentication method. a) if client receive 200 OK, "No Auth" is used and we don't need to get cre= dentials b) if client receive 401 Unauthorized, check the "WWW-Authenticate" field i= n returned HTTP header. "Basic realm" or "X-Auh-Token realm" or both two me= thods will be specified. Then client can know what method to use. Two metho= ds all require credential. Above mechanism can be placed in RedfishCredentailDxe driver so driver will= know if it needs to call credential lib or not. Thanks, Nickle -----Original Message----- From: Igor Kulchytskyy > Sent: Friday, October 28, 2022 9:54 PM To: Chang, Abner >; devel@e= dk2.groups.io; Nickle Wang > Cc: Nick Ramirez > Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation External email: Use caution opening links or attachments Hi Abner, Yes, you are right that NVRAM variables were deprecated by DMTF. But we can use our own boot time NVRAM variable to keep FW credentials. Tha= t variable will not be accessible from OS, but since we agreed not to disab= le bootstrap credentials service on exit boot event, then OS may get its ow= n credentials. Or we can save the credentials in memory variable. But in this case if we h= ave several instances of the library linked with different modules they wil= l have to send their own IPMI command to get credentials. So, I think it is better to use our own NVRAM boot time variable. Thank you, Igor -----Original Message----- From: Chang, Abner > Sent: Friday, October 28, 2022 3:48 AM To: devel@edk2.groups.io; Igor Kulchytskyy >; nicklew@nvidia.com Cc: Nick Ramirez > Subject: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCred= entialLib: IPMI implementation **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** [AMD Official Use Only - General] > -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Igor > Kulchytskyy via groups.io > Sent: Thursday, October 27, 2022 10:42 PM > To: devel@edk2.groups.io; nicklew@nvidia.com= ; Chang, Abner > > > Cc: Nick Ramirez > > Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib= : > IPMI implementation > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Hi Nickle, > Pleased, see my comments on your questions below. > > Another point I missed in my previous mail. > You have that function in the library to get credentials and it is > used by RedfishCredentialsDxe driver to create the protocol which in > its turn will be used by other Redfish modules. > We do not know how many modules and how many times will call this > function during boot. Right? > And on each call of this function you call IPMI command. That command > will create new Redfish account on BMC side according to Redfish HI speci= fication: > > " If the Get Bootstrap Account Credentials command has been issued and > responds with the completion code 00h, a bootstrap account shall be > added to the manager's account collection and enabled. If the Get > Bootstrap Account Credentials command is sent subsequent times and > responds with the completion code 00h, a new account shall be created > based on the newly generated credentials. Any existing bootstrap accounts= shall remain active." > > As I know BMC may have some restrictions on the number of Redfish > accounts they can support. > And because of that BOS may hit this limit. Which is not good. > On the other hand I'm not sure we need to have different credentials > for different modules? All those modules are part of FW. And all of > them will be associated with the same RoleID (FW role) on BMC side. > So, all of them may use the same credentials. > Could we cash the credentials on first call of that Yes, this is something we have to avoid. Many accounts will be created whil= e each of Redfish client module requests a credential. FW can save it in EF= I variable and delete it at proper timing. Unfortunately the credential del= ivering via EFI variable section was deprecated, otherwise we can deliver t= he credential to OS through EFI variable with disabling the bootstrap crede= ntial at exit boot service. Abner > RedfishCredentialGetAuthInfo and then use those cashed credentials on > subsequential calls? > It will also may save a boot time, since there is no need to send IPMI > command. > > Thank you, > Igor > > -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Nickle > Wang via groups.io > Sent: Thursday, October 27, 2022 9:26 AM > To: devel@edk2.groups.io; Igor Kulchytskyy <= igork@ami.com>; > abner.chang@amd.com > Cc: Nick Ramirez > > Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] > RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation > > > **CAUTION: The e-mail below is from an external source. Please > exercise caution before opening attachments, clicking links, or > following guidance.** > > Hi Igor, > > Thank you for your help to review my changes. > > > And it will be blocked by our IPMI call. > > I see your point. So, BIOS should never be the person to shutdown > credential service because BIOS always get executed prior to OS, right? > > Igor: Yes, my point is that we should not shutdown credential service > from BIOS. Even if OS sends that IPMI command, new account will be > created and BIOS credentials will not be compromised. > > > Should it be configured with some PCD? Maybe user may select in > > Setup > what method should be used? Or it could be build time configuration? > > I have below assumption while I implemented the library. I admit this > is not always true. > > No Auth: I think this is rare case for Redfish service which gives > anonymous privilege to change BIOS settings. > Basic Auth: this is the authentication method which uses username and > password to build base64 encoded string. > Session Auth: I assume that client must have a session token first and > then use this authentication method. Can we use username and password > to generate session token on our own? If my memory serves me > correctly, client has to do a login with username and password first > and then client can receive session token from server. > > Igor: BIOS will use the credentials to create session. It should send > POST request to the session URI with user name and password to create ses= sion. > If a session created successfully then on response BMC returns header > "X- Auth-Token" which then used for the subsequential calls. > > If we really like to know what authentication method that Redfish > service used, we can issue a HTTP query to "/redfish/v1/Systems" with "No= Auth". > Then we can know what authentication method is required by reading the > "WWW-Authenticate " filed in returned HTTP header. > > Igor: As my understanding, even if you include authentication header > (Base64 encoded) in the request to BMC and BMC has NoAuth > configuration, then that authentication header would be just ignored by B= MC. > > Thanks, > Nickle > > -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Igor > Kulchytskyy via groups.io > Sent: Wednesday, October 26, 2022 11:26 PM > To: Nickle Wang >; devel@ed= k2.groups.io; > abner.chang@amd.com > Cc: Nick Ramirez > > Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib= : > IPMI implementation > > External email: Use caution opening links or attachments > > > Hi Nickle, > I would like to discuss that DisableBootstrapControl flag and how it > is used in our implementation. > According to Redfish HI specification we can use this flag to disable > credential bootstrapping control. > It can be disabled permanently or till next reboot of the host or > service. That depend on the EnableAfterReset setting on BMC side: > CredentialBootstrapping (v1.3+) > { object The credential bootstrapping settings for this interface. > EnableAfterReset (v1.3+) Boolean read-write (null) An > indication of whether credential bootstrapping is enabled after a reset f= or this interface. > Enabled (v1.3+) Boolean read-write (null) An indication of > whether credential bootstrapping is enabled for this interface. > RoleId (v1.3+) string read-write The role used for the > bootstrap account created for this interface. > } > So, if EnableAfterReset set to false, that means BMC will response > with 0x80 error and will not return any credentials after reboot. And > BIOS BMC communication will fail. > Another concern with disabling credential bootstrapping control is > that we do it on Exit Boot event before passing a control to OS. > But OS may also need to communicate to BMC through Redfish Host > Interface to post some information. And it will be blocked by our IPMI ca= ll. > We create that SMBIOS Type 42 table with Redfish Host Interface > settings which can be used by OS to communicate with BMC. But without > the credentials it will not be possible. > > Another question is AuthMethod parameter you initialize in this library: > *AuthMethod =3D AuthMethodHttpBasic; > According to Redfish HI specification 3 methods may be used - No Auth, > Basic Auth and Session Auth. > Basic Auth and Session Auth methods are required the credentials to be > used by BIOS. And both of them should be supported by BMC. > And your high level function RedfishCreateLibredfishService also > supports of creation Basic or Session Auth service. > I'm not sure why low level library which is created to get credentials > from BMC should decide what Authentication method should be used? > Should it be configured with some PCD? Maybe user may select in Setup > what method should be used? Or it could be build time configuration? > > Thank you, > Igor > > -----Original Message----- > From: Nickle Wang > > Sent: Tuesday, October 25, 2022 4:24 AM > To: devel@edk2.groups.io; abner.chang@amd.co= m > Cc: Nick Ramirez >; Igor = Kulchytskyy > > > Subject: [EXTERNAL] RE: [edk2-devel] [PATCH] > RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation > > > **CAUTION: The e-mail below is from an external source. Please > exercise caution before opening attachments, clicking links, or > following guidance.** > > Thanks for your review comments, Abner! I will update new version > patch later. The CI build error will be handled together. > > > please add Igor as reviewer too > Sure! > > > > + *UserId =3D AllocateZeroPool (sizeof (CHAR8) * USERNAME_MAX_SIZE); > > + if > [Chang, Abner] > Allocation memory with the size (USERNAME_MAX_LENGTH + 1) for both > BootUsername and BootstrapPassword? Because the maximum number of > characters defined in the spec is USERNAME_MAX_LENGTH for the > user/password. > > Yes, the additional one byte is for NULL terminator. > USERNAME_MAX_LENGTH is defined as 16 and follow host interface > specification. > > Regards, > Nickle > > -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Chang, > Abner via groups.io > Sent: Saturday, October 22, 2022 3:01 PM > To: Nickle Wang >; devel@ed= k2.groups.io > Cc: Nick Ramirez >; Igor = Kulchytskyy > > > Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib= : > IPMI implementation > > External email: Use caution opening links or attachments > > > [AMD Official Use Only - General] > > Hi Nickle, please add Igor as reviewer too. My comments is in below, > > > -----Original Message----- > > From: Nickle Wang > > > Sent: Thursday, October 20, 2022 10:55 AM > > To: devel@edk2.groups.io > > Cc: Chang, Abner >; Nic= k Ramirez > > > > > Subject: [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI > > implementation > > > > Caution: This message originated from an External Source. Use proper > > caution when opening attachments, clicking links, or responding. > > > > > > This library follows Redfish Host Interface specification and use > > IPMI command to get bootstrap account credential(NetFn 2Ch, Command > > 02h) > from BMC. > > RedfishHostInterfaceDxe will use this credential for the following > > communication between BIOS and BMC. > > > > Cc: Abner Chang > > > Cc: Nick Ramirez > > > Signed-off-by: Nickle Wang > > > --- > > .../RedfishPlatformCredentialLib.c | 273 ++++++++++++++++++ > > .../RedfishPlatformCredentialLib.h | 75 +++++ > > .../RedfishPlatformCredentialLib.inf | 37 +++ > [Chang, Abner] > Could we name this library RedfishPlatformCredentialIpmi so the naming > style is consistent with RedfishPlatformCredentialNull? > > > 3 files changed, 385 insertions(+) > > create mode 100644 > > > RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredent > ial > Lib. > > c > > create mode 100644 > > > RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredent > ial > Lib. > > h > > create mode 100644 > > RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCrede > > nt > > ialLib.i > > nf > > > > diff --git > > a/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCre > > de > > ntialLi > > b.c > > b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCre > > de > > ntialLi > > b.c > > new file mode 100644 > > index 0000000000..23a15ab1fa > > --- /dev/null > > +++ b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatfor > > +++ mC > > +++ re > > +++ dentialLib.c > > @@ -0,0 +1,273 @@ > > +/** @file > > +* > > +* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > > +* > > +* SPDX-License-Identifier: BSD-2-Clause-Patent > [Chang, Abner] > We can have "@par Revision Reference:" in the file header to point > out the spec. > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fnam12= .safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam1&d= ata=3D05%7C01%7Cnicklew%40nvidia.com%7C3f7c98d402b8471f95d408dab8fdeb00%7C4= 3083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638025697967855556%7CUnknown%7CTW= FpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3= D%7C3000%7C%7C%7C&sdata=3D90NlFqDGaEtk5kMibeuQ3%2FzQNn3ANJn1LcF6RNqsJJ0= %3D&reserved=3D0 > 1.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam1 > &data=3D05%7C01%7Cigork%40ami.com%7C224e78526d7d45a7b31108dab8f42ac1 > %7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638025656093102767%7CUnk > nown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWw > iLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DYN52FOx%2F%2F1YYG8Nl86vu7zlz > M%2BpLMk3Ym0RNPLxLKqw%3D&reserved=3D0 > 2.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam1 > &data=3D05%7C01%7Cnicklew%40nvidia.com%7C90696ea8811e49e371a708dab8e > be2d8%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638025620543993279% > 7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik > 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DCyvRgMZREOk5Yf0hU3CmH%2 > B08ktxMYw%2Bixr4UVywfrAQ%3D&reserved=3D0 > 1.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fww&a > mp;data=3D05%7C01%7Cigork%40ami.com%7C2b5b562c02c04c90d51208dab8b8c0fd%7 > C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638025400915295621%7CUnkno > wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL > CJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DUy%2B3HS336N3rgNSESPcyOPGX3eOR > 48hekdz08nLtJU4%3D&reserved=3D0 > w.dmtf.org%2Fsites%2Fdefault%2Ffiles%2Fstandards%2Fdocuments%2FDSP > 0270_1.3.0.pdf&data=3D05%7C01%7Cabner.chang%40amd.com%7C074aa > e162fba49409af408dab8297c03%7C3dd8961fe4884e608e11a82d994e183d%7C > 0%7C0%7C638024786060127888%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM > C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000 > %7C%7C%7C&sdata=3DyY6hhKjQfVqmNuufbeDNk%2B2FKrebHyIAyS9Ya4 > szE3Y%3D&reserved=3D0 > > > +* > > +**/ > > + > > +#include "RedfishPlatformCredentialLib.h" > > + > > +// > > +// Global flag of controlling credential service // BOOLEAN > > +mRedfishServiceStopped =3D FALSE; > > + > > +/** > > + Notify the Redfish service provide to stop provide configuration > > +service to this > > platform. > > + > > + This function should be called when the platfrom is about to > > + leave the safe > > environment. > > + It will notify the Redfish service provider to abort all logined > > + session, and prohibit further login with original auth info. > > + GetAuthInfo() will return EFI_UNSUPPORTED once this function is > returned. > > + > > + @param[in] This Pointer to > > EDKII_REDFISH_CREDENTIAL_PROTOCOL instance. > > + @param[in] ServiceStopType Reason of stopping Redfish service. > > + > > + @retval EFI_SUCCESS Service has been stoped successfull= y. > > + @retval EFI_INVALID_PARAMETER This is NULL. > > + @retval Others Some error happened. > > + > > +**/ > > +EFI_STATUS > > +EFIAPI > > +LibStopRedfishService ( > > + IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This, > > + IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE > ServiceStopType > > + ) > > +{ > > + EFI_STATUS Status; > > + > > + if ((ServiceStopType <=3D ServiceStopTypeNone) || (ServiceStopType > > + >=3D > > ServiceStopTypeMax)) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + // > > + // Raise flag first > > + // > > + mRedfishServiceStopped =3D TRUE; > > + > > + // > > + // Notify BMC to disable credential bootstrapping support. > > + // > > + Status =3D GetBootstrapAccountCredentials (TRUE, NULL, NULL); if > > + (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: fail to disable bootstrap credential: > > + %r\n", > > __FUNCTION__, Status)); > > + return Status; > > + } > > + > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + Notification of Exit Boot Service. > > + > > + @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL. > > +**/ > > +VOID > > +EFIAPI > > +LibCredentialExitBootServicesNotify ( > > + IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This > > + ) > > +{ > > + // > > + // Stop the credential support when system is about to enter OS. > > + // > > + LibStopRedfishService (This, ServiceStopTypeExitBootService); } > > + > > +/** > > + Notification of End of DXe. > > + > > + @param[in] This Pointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL. > > +**/ > > +VOID > > +EFIAPI > > +LibCredentialEndOfDxeNotify ( > > + IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This > > + ) > > +{ > > + // > > + // Do nothing now. > > + // We can stop credential support when system reach end-of-dxe > > +for security > > reason. > > + // > > +} > > + > > +/** > > + Function to retrieve temporary use credentials for the UEFI > > +redfish client > [Chang, Abner] > We miss the functionality to disable bootstrap credential service in > the function description. > > > + > > + @param[in] DisableBootstrapControl > > + TRUE - Tell the BMC to disable t= he bootstrap credential > > + service to ensure no one = else gains credentials > > + FALSE Allow the bootstrap > > + credential service to continue @param[out] BootstrapUsername > > + A pointer to a UTF-8 encoded > > + string for the credential > > username > > + When DisableBootstrapControl > > + is TRUE, this pointer can be NULL > > + > > + @param[out] BootstrapPassword > > + A pointer to a UTF-8 encoded > > + string for the credential > > password > > + When DisableBootstrapControl > > + is TRUE, this pointer can be NULL > > + > > + @retval EFI_SUCCESS Credentials were successfully fe= tched and > > returned > > + @retval EFI_INVALID_PARAMETER BootstrapUsername or > > BootstrapPassword is NULL when DisableBootstrapControl > > + is set to FALSE > > + @retval EFI_DEVICE_ERROR An IPMI failure occurred > [Chang, Abner] > The return status should also include the status of disabling > bootstrap credential. > > > > +**/ > > +EFI_STATUS > > +GetBootstrapAccountCredentials ( > > + IN BOOLEAN DisableBootstrapControl, > > + IN OUT CHAR8 *BootstrapUsername, OPTIONAL > > + IN OUT CHAR8 *BootstrapPassword OPTIONAL > > + ) > > +{ > > + EFI_STATUS Status; > > + IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA CommandData; > > + IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE ResponseData; > > + UINT32 ResponseSize; > > + > > + if (!PcdGetBool (PcdIpmiFeatureEnable)) { > > + DEBUG ((DEBUG_ERROR, "%a: IPMI is not enabled! Unable to fetch > > + Redfish > > credentials\n", __FUNCTION__)); > > + return EFI_UNSUPPORTED; > > + } > > + > > + // > > + // NULL buffer check > > + // > > + if (!DisableBootstrapControl && ((BootstrapUsername =3D=3D NULL) || > > (BootstrapPassword =3D=3D NULL))) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + DEBUG ((DEBUG_VERBOSE, "%a: Disable bootstrap control: 0x%x\n", > > + __FUNCTION__, DisableBootstrapControl)); > > + > > + // > > + // IPMI callout to NetFn 2C, command 02 > > + // Request data: > > + // Byte 1: REDFISH_IPMI_GROUP_EXTENSION > > + // Byte 2: DisableBootstrapControl > > + // > > + CommandData.GroupExtensionId =3D > REDFISH_IPMI_GROUP_EXTENSION; > > + CommandData.DisableBootstrapControl =3D (DisableBootstrapControl ? > > + REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_DISABLE : > > + REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE); > > + > > + ResponseSize =3D sizeof (ResponseData); > > + > > + // > > + // Response data: > > + // Byte 1 : Completion code > > + // Byte 2 : REDFISH_IPMI_GROUP_EXTENSION > > + // Byte 3-18 : Username > > + // Byte 19-34: Password > > + // > > + Status =3D IpmiSubmitCommand ( > > + IPMI_NETFN_GROUP_EXT, > > + REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD, > > + (UINT8 *)&CommandData, > > + sizeof (CommandData), > > + (UINT8 *)&ResponseData, > > + &ResponseSize > > + ); > > + > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: IPMI transaction failure. > > + Returning\n", > > __FUNCTION__)); > > + ASSERT_EFI_ERROR (Status); > > + return Status; > > + } else { > > + if (ResponseData.CompletionCode !=3D IPMI_COMP_CODE_NORMAL) { > > + if (ResponseData.CompletionCode =3D=3D > > REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED) { > > + DEBUG ((DEBUG_ERROR, "%a: bootstrap credential support was > > disabled\n", __FUNCTION__)); > > + return EFI_ACCESS_DENIED; > > + } > > + > > + DEBUG ((DEBUG_ERROR, "%a: Completion code =3D 0x%x. > > + Returning\n", > > __FUNCTION__, ResponseData.CompletionCode)); > > + return EFI_PROTOCOL_ERROR; > > + } else if (ResponseData.GroupExtensionId !=3D > > REDFISH_IPMI_GROUP_EXTENSION) { > > + DEBUG ((DEBUG_ERROR, "%a: Group Extension Response =3D 0x%x. > > Returning\n", __FUNCTION__, ResponseData.GroupExtensionId)); > > + return EFI_DEVICE_ERROR; > > + } else { > > + if (BootstrapUsername !=3D NULL) { > > + CopyMem (BootstrapUsername, ResponseData.Username, > > USERNAME_MAX_LENGTH); > > + // > > + // Manually append null-terminator in case 16 characters > > + username > > returned. > > + // > > + BootstrapUsername[USERNAME_MAX_LENGTH] =3D '\0'; > > + } > > + > > + if (BootstrapPassword !=3D NULL) { > > + CopyMem (BootstrapPassword, ResponseData.Password, > > PASSWORD_MAX_LENGTH); > > + // > > + // Manually append null-terminator in case 16 characters > > + password > > returned. > > + // > > + BootstrapPassword[PASSWORD_MAX_LENGTH] =3D '\0'; > > + } > > + } > > + } > > + > > + return Status; > > +} > > + > > +/** > > + Retrieve platform's Redfish authentication information. > > + > > + This functions returns the Redfish authentication method together > > + with the user Id and password. > > + - For AuthMethodNone, the UserId and Password could be used for > > + HTTP > > header authentication > > + as defined by RFC7235. > > + - For AuthMethodRedfishSession, the UserId and Password could be > > + used for > > Redfish > > + session login as defined by Redfish API specification (DSP0266). > > + > > + Callers are responsible for and freeing the returned string storage. > > + > > + @param[in] This Pointer to > > EDKII_REDFISH_CREDENTIAL_PROTOCOL instance. > > + @param[out] AuthMethod Type of Redfish authentication meth= od. > > + @param[out] UserId The pointer to store the returned U= serId > string. > > + @param[out] Password The pointer to store the returned > Password > > string. > > + > > + @retval EFI_SUCCESS Get the authentication information > successfully. > > + @retval EFI_ACCESS_DENIED SecureBoot is disabled after EndOfD= xe. > > + @retval EFI_INVALID_PARAMETER This or AuthMethod or UserId or > > Password is NULL. > > + @retval EFI_OUT_OF_RESOURCES There are not enough memory > resources. > > + @retval EFI_UNSUPPORTED Unsupported authentication method i= s > > found. > > + > > +**/ > > +EFI_STATUS > > +EFIAPI > > +LibCredentialGetAuthInfo ( > > + IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This, > > + OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod, > > + OUT CHAR8 **UserId, > > + OUT CHAR8 **Password > > + ) > > +{ > > + EFI_STATUS Status; > > + > > + if ((AuthMethod =3D=3D NULL) || (UserId =3D=3D NULL) || (Password = =3D=3D NULL)) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + *UserId =3D NULL; > > + *Password =3D NULL; > > + > > + if (mRedfishServiceStopped) { > > + DEBUG ((DEBUG_ERROR, "%a: credential service is stopped due to > > + security > > reason\n", __FUNCTION__)); > > + return EFI_ACCESS_DENIED; > > + } > > + > > + *AuthMethod =3D AuthMethodHttpBasic; > > + > > + *UserId =3D AllocateZeroPool (sizeof (CHAR8) * USERNAME_MAX_SIZE); > > + if > [Chang, Abner] > Allocation memory with the size (USERNAME_MAX_LENGTH + 1) for both > BootUsername and BootstrapPassword? Because the maximum number of > characters defined in the spec is USERNAME_MAX_LENGTH for the > user/password. > > > > + (*UserId =3D=3D NULL) { > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + *Password =3D AllocateZeroPool (sizeof (CHAR8) * > > + PASSWORD_MAX_SIZE); if (*Password =3D=3D NULL) { > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + Status =3D GetBootstrapAccountCredentials (FALSE, *UserId, > > + *Password); if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: fail to get bootstrap credential: > > + %r\n", > > __FUNCTION__, Status)); > > + return Status; > > + } > > + > > + return EFI_SUCCESS; > > +} > > diff --git > > a/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCre > > de > > ntialLi > > b.h > > b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCre > > de > > ntialLi > > b.h > > new file mode 100644 > > index 0000000000..5b448e01be > > --- /dev/null > > +++ b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatfor > > +++ mC > > +++ re > > +++ dentialLib.h > > @@ -0,0 +1,75 @@ > > +/** @file > > +* > > +* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > > +* > > +* SPDX-License-Identifier: BSD-2-Clause-Patent > > +* > > +**/ > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include #include > > + > > + > > +#define REDFISH_IPMI_GROUP_EXTENSION 0x52 > > +#define REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD 0x02 > > +#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE 0xA5 > > +#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_DISABLE 0x00 > > +#define > REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED > > 0x80 > > + > > +// > > +// Per Redfish Host Interface Specification 1.3, The maximum lenght > > +of // username and password is 16 characters long. > > +// > > +#define USERNAME_MAX_LENGTH 16 > > +#define PASSWORD_MAX_LENGTH 16 > > +#define USERNAME_MAX_SIZE (USERNAME_MAX_LENGTH + 1) // > NULL > > terminator > > +#define PASSWORD_MAX_SIZE (PASSWORD_MAX_LENGTH + 1) // > NULL > > terminator > > + > > +#pragma pack(1) > > +/// > > +/// The definition of IPMI command to get bootstrap account > > +credentials /// typedef struct { > > + UINT8 GroupExtensionId; > > + UINT8 DisableBootstrapControl; > > +} IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA; > > + > > +/// > > +/// The response data of getting bootstrap credential /// typedef > > +struct { > > + UINT8 CompletionCode; > > + UINT8 GroupExtensionId; > > + CHAR8 Username[USERNAME_MAX_LENGTH]; > > + CHAR8 Password[PASSWORD_MAX_LENGTH]; > > +} IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE; > > + > > +#pragma pack() > > + > > +/** > > + Function to retrieve temporary use credentials for the UEFI > > +redfish client > [Chang, Abner] > We miss the functionality to disable bootstrap credential service in > the function description. > > > + > > + @param[in] DisableBootstrapControl > > + TRUE - Tell the BMC to disable t= he bootstrap credential > > + service to ensure no one = else gains credentials > > + FALSE Allow the bootstrap > > + credential service to continue @param[out] BootstrapUsername > > + A pointer to a UTF-8 encoded > > + string for the credential username > > + > > + @param[out] BootstrapPassword > > + A pointer to a UTF-8 encoded > > + string for the credential password > > + > > + @retval EFI_SUCCESS Credentials were successfully fe= tched and > > returned > [Chang, Abner] > Or the bootstrap credential service is disabled successfully, right? > > > + @retval EFI_DEVICE_ERROR An IPMI failure occurred > > +**/ > > +EFI_STATUS > > +GetBootstrapAccountCredentials ( > > + IN BOOLEAN DisableBootstrapControl, > > + IN OUT CHAR8 *BootstrapUsername, > > + IN OUT CHAR8 *BootstrapPassword > > + ); > > diff --git > > a/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCre > > de > > ntialLi > > b.inf > > b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCre > > de > > ntialLi > > b.inf > > new file mode 100644 > > index 0000000000..a990d28363 > > --- /dev/null > > +++ b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatfor > > +++ mC > > +++ re > > +++ dentialLib.inf > > @@ -0,0 +1,37 @@ > > +## @file > > +# > > +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > > +# > > +# SPDX-License-Identifier: BSD-2-Clause-Patent # ## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001000b > > + BASE_NAME =3D RedfishPlatformCredentialLib > > + FILE_GUID =3D 9C45D622-4C66-417F-814C-F76246D97= 233 > > + MODULE_TYPE =3D DXE_DRIVER > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D RedfishPlatformCredentialLib > > + > > +[Sources] > > + RedfishPlatformCredentialLib.c > > + > > +[Packages] > > + MdePkg/MdePkg.dec > > + MdeModulePkg/MdeModulePkg.dec > > + RedfishPkg/RedfishPkg.dec > > + IpmiFeaturePkg/IpmiFeaturePkg.dec > [Chang, Abner] > Could you please add a comment to the reference of IpmiFeaturePkg? We > have to give customers a notice that the dependence of "edk2- > platforms/Features/Intel/OutOfBandManagement/". They have to add the > path to PACKAGES_PATH. You also have to skip this dependence in the > RedfishPkg.yaml to avoid the CI error. > > Another thing is I propose to move out IpmiFeaturePkg from edk2- > platforms/Features/Intel/OutOfBandManagement to edk2- > platforms/Features/ManageabilityPkg that also provides the > implementation of PLDM/MCTP/IPMI/KCS. I had an initial talk with > IpmiFeaturePkg owner and get the positive response on this proposal. I > will kick off the discussion on the dev mailing list. That is to say > this module may need a little bit change later, however that is good > to me having this implementation now. > Thanks > Abner > > + > > +[LibraryClasses] > > + UefiLib > > + DebugLib > > + IpmiBaseLib > > + MemoryAllocationLib > > + BaseMemoryLib > > + > > +[Pcd] > > + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable > > + > > +[Depex] > > + TRUE > > -- > > 2.17.1 > > > > > > -The information contained in this message may be confidential and > proprietary 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 designee. If the reader of this message is not > the intended recipient, you are on notice that any distribution of > this message, in any form, is strictly prohibited. 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. > > > > > > > > > > > -The information contained in this message may be confidential and > proprietary 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 designee. If the reader of this message is not > the intended recipient, you are on notice that any distribution of > this message, in any form, is strictly prohibited. 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. > > >=20 > -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= . -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= . -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= . --_000_BLAPR10MB51859FAFE5D7C7F9EB545118A8349BLAPR10MB5185namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi Abner,
"redfish/v1" does not require any authenticatio= n. But "redfish/v1" json response contains the links to high leve= l resources - systems, chassis etc.
My point was to get the URI to systems from that json res= ponse, rather than have it hard coded.

If both auth methods supported, we should go with more secured one - sessio= n authentication. In this case we do not need to send username and password= within each request.

Thank you,
Igor


From: Chang, Abner <Abne= r.Chang@amd.com>
Sent: Sunday, October 30, 2022 11:33:26 AM
To: Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igo= rk@ami.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Nick Ramirez <nramirez@nvidia.com>
Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishP= latformCredentialLib: IPMI implementation
 

[AMD Off= icial Use Only - General]

 

Does "/redfish/v1=94 require authentication? I think this solution is ok i= f "/redfish/v1=94 requires the authentication.

Anot= her thing is how do we determine to use Basic authentication or the session= token?

&nbs= p;

Abne= r

 

From: Nickle Wang <nicklew@nvidia.com>= ;
Sent: Saturday, October 29, 2022 7:29 AM
To: Igor Kulchytskyy <igork@ami.com>; Chang, Abner <Abner.C= hang@amd.com>; devel@edk2.groups.io
Cc: Nick Ramirez <nramirez@nvidia.com>
Subject: Re: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishP= latformCredentialLib: IPMI implementation

 

Cautio= n: This message originated from an= External Source. Use proper caution when opening attachments, clicking lin= ks, or responding.

 

Hi Igor,

 

Yes, we should get the URI to computer system collec= tion by parsing "/redfish/v1".

 

Hi Abner,

 

What do you think about this? And if we like to sele= ct authentication method for Redfish communication in this way, we need to = update RedfishCredentialLib.h because now the authentication method is not decided by this low-level library.

 

Thanks,

Nickle


From: Igor Kulchytskyy <igork@ami.com>
Sent: Saturday, October 29, 2022 12:03 AM
To: Nickle Wang <nicklew@nv= idia.com>; Chang, Abner <A= bner.Chang@amd.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Nick Ramirez <nramirez= @nvidia.com>
Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishP= latformCredentialLib: IPMI implementation

 

External email: Use caution opening links or attac= hments


Hi Nickle,
I think this is a good idea to send a request to the URI which requires the= authentication and then analyze the header of response.
The only thing I would like to discuss is a hardcoded URI - "/redfish/= v1/Systems".
Shouldn't we parse "redfish/v1" json response and get the URI fro= m "Systems" attribute.
That, I think, would be more universal method.
And that is what Redfish specification said, that user should be able to it= erate from Redfish service root "redfish/v1" to any redfish resou= rce.
Thank you,
Igor



-----Original Message-----
From: Nickle Wang <nicklew@nvidia.= com>
Sent: Friday, October 28, 2022 10:53 AM
To: Igor Kulchytskyy <igork@ami.com= >; Chang, Abner <Abner.Chang@a= md.com>; devel@edk2.groups.io
Cc: Nick Ramirez <nramirez@nvidia= .com>
Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation

Hi Igor, Abner,

Thanks for your comments. A quick summary as below:

- BIOS is not supported to disable bootstrap credential service. For securi= ty purposes, BIOS should shutdown credential service with its internal cont= rol mechanism.
- Credential libraries need a cache mechanism to prevent multiple queries t= o BMC. All applications in BIOS share the same credentials.
- The storage of keeping credentials should be deleted before the end of th= e DXE event. So that the credential will not be retrieved by unauthorized u= ser or application. (e.g. user can read variable under UEFI shell with dmps= tore command)

There is one thing remained and I like to have further discussion. For the = authentication method, do we think that client user can decide what authent= ication method to use regardless of the requirement from server? I am think= ing a detection mechanism as below:

Issue HTTP GET to "/redfish/v1/Systems" (which normally require a= uthentication) without authentication method.
a) if client receive 200 OK, "No Auth" is used and we don't need = to get credentials
b) if client receive 401 Unauthorized, check the "WWW-Authenticate&quo= t; field in returned HTTP header. "Basic realm" or "X-Auh-To= ken realm" or both two methods will be specified. Then client can know= what method to use. Two methods all require credential.

Above mechanism can be placed in RedfishCredentailDxe driver so driver will= know if it needs to call credential lib or not.

Thanks,
Nickle

-----Original Message-----
From: Igor Kulchytskyy <igork@ami.com>
Sent: Friday, October 28, 2022 9:54 PM
To: Chang, Abner <
Abner.Chang@amd= .com>; devel@edk2.groups.io; Nickle Wang <nicklew@nvidia.com>
Cc: Nick Ramirez <nramirez@nvidia= .com>
Subject: RE: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatform= CredentialLib: IPMI implementation

External email: Use caution opening links or attachments


Hi Abner,
Yes, you are right that NVRAM variables were deprecated by DMTF.
But we can use our own boot time NVRAM variable to keep FW credentials. Tha= t variable will not be accessible from OS, but since we agreed not to disab= le bootstrap credentials service on exit boot event, then OS may get its ow= n credentials.
Or we can save the credentials in memory variable. But in this case if we h= ave several instances of the library linked with different modules they wil= l have to send their own IPMI command to get credentials.
So, I think it is better to use our own NVRAM boot time variable.
Thank you,
Igor


-----Original Message-----
From: Chang, Abner <Abner.Chang@a= md.com>
Sent: Friday, October 28, 2022 3:48 AM
To: devel@edk2.groups.io; Igor = Kulchytskyy <igork@ami.com>; nicklew@nvidia.com
Cc: Nick Ramirez <nramirez@nvidia= .com>
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCred= entialLib: IPMI implementation


**CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.**
[AMD Official Use Only - General]



> -----Original Message-----
> From: devel@edk2.groups.io= <devel@edk2.groups.io> O= n Behalf Of Igor
> Kulchytskyy via groups.io
> Sent: Thursday, October 27, 2022 10:42 PM
> To: devel@edk2.groups.io; = nicklew@nvidia.com; Chang, Abner
> <Abner.Chang@amd.com>=
> Cc: Nick Ramirez <nramirez@n= vidia.com>
> Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredential= Lib:
> IPMI implementation
>
> Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding.
>
>
> Hi Nickle,
> Pleased, see my comments on your questions below.
>
> Another point I missed in my previous mail.
> You have that function in the library to get credentials and it is
> used by RedfishCredentialsDxe driver to create the protocol which in > its turn will be used by other Redfish modules.
> We do not know how many modules and how many times will call this
> function during boot. Right?
> And on each call of this function you call IPMI command. That command<= br> > will create new Redfish account on BMC side according to Redfish HI sp= ecification:
>
> " If the Get Bootstrap Account Credentials command has been issue= d and
> responds with the completion code 00h, a bootstrap account shall be > added to the manager's account collection and enabled. If the Get
> Bootstrap Account Credentials command is sent subsequent times and
> responds with the completion code 00h, a new account shall be created<= br> > based on the newly generated credentials. Any existing bootstrap accou= nts shall remain active."
>
> As I know BMC may have some restrictions on the number of Redfish
> accounts they can support.
> And because of that BOS may hit this limit. Which is not good.
> On the other hand I'm not sure we need to have different credentials > for different modules? All those modules are part of FW. And all of > them will be associated with the same RoleID (FW role) on BMC side. > So, all of them may use the same credentials.
> Could we cash the credentials on first call of that
Yes, this is something we have to avoid. Many accounts will be created whil= e each of Redfish client module requests a credential. FW can save it in EF= I variable and delete it at proper timing. Unfortunately the credential del= ivering via EFI variable section was deprecated, otherwise we can deliver the credential to OS through EFI = variable with disabling the bootstrap credential at exit boot service.

Abner

> RedfishCredentialGetAuthInfo and then use those cashed credentials on<= br> > subsequential calls?
> It will also may save a boot time, since there is no need to send IPMI=
> command.
>
> Thank you,
> Igor
>
> -----Original Message-----
> From: devel@edk2.groups.io= <devel@edk2.groups.io> O= n Behalf Of Nickle
> Wang via groups.io
> Sent: Thursday, October 27, 2022 9:26 AM
> To: devel@edk2.groups.io; = Igor Kulchytskyy <igork@ami.com>= ;
> abner.chang@amd.com
> Cc: Nick Ramirez <nramirez@n= vidia.com>
> Subject: [EXTERNAL] Re: [edk2-devel] [PATCH]
> RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation
>
>
> **CAUTION: The e-mail below is from an external source. Please
> exercise caution before opening attachments, clicking links, or
> following guidance.**
>
> Hi Igor,
>
> Thank you for your help to review my changes.
>
> > And it will be blocked by our IPMI call.
>
> I see your point. So, BIOS should never be the person to shutdown
> credential service because BIOS always get executed prior to OS, right= ?
>
> Igor: Yes, my point is that we should not shutdown credential service<= br> > from BIOS. Even if OS sends that IPMI command, new account will be
> created and BIOS credentials will not be compromised.
>
> > Should it be configured with some PCD? Maybe user may select in > > Setup
> what method should be used? Or it could be build time configuration? >
> I have below assumption while I implemented the library. I admit this<= br> > is not always true.
>
> No Auth: I think this is rare case for Redfish service which gives
> anonymous privilege to change BIOS settings.
> Basic Auth: this is the authentication method which uses username and<= br> > password to build base64 encoded string.
> Session Auth: I assume that client must have a session token first and=
> then use this authentication method. Can we use username and password<= br> > to generate session token on our own? If my memory serves me
> correctly, client has to do a login with username and password first > and then client can receive session token from server.
>
> Igor: BIOS will use the credentials to create session. It should send<= br> > POST request to the session URI with user name and password to create = session.
> If a session created successfully then on response BMC returns header<= br> > "X- Auth-Token" which then used for the subsequential calls.=
>
> If we really like to know what authentication method that Redfish
> service used, we can issue a HTTP query to "/redfish/v1/Systems&q= uot; with "No Auth".
> Then we can know what authentication method is required by reading the=
> "WWW-Authenticate " filed in returned HTTP header.
>
> Igor: As my understanding, even if you include authentication header > (Base64 encoded) in the request to BMC and BMC has NoAuth
> configuration, then that authentication header would be just ignored b= y BMC.
>
> Thanks,
> Nickle
>
> -----Original Message-----
> From: devel@edk2.groups.io= <devel@edk2.groups.io> O= n Behalf Of Igor
> Kulchytskyy via groups.io
> Sent: Wednesday, October 26, 2022 11:26 PM
> To: Nickle Wang <nicklew@nvid= ia.com>; devel@edk2.groups.io;
> abner.chang@amd.com
> Cc: Nick Ramirez <nramirez@n= vidia.com>
> Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredential= Lib:
> IPMI implementation
>
> External email: Use caution opening links or attachments
>
>
> Hi Nickle,
> I would like to discuss that DisableBootstrapControl flag and how it > is used in our implementation.
> According to Redfish HI specification we can use this flag to disable<= br> > credential bootstrapping control.
> It can be disabled permanently or till next reboot of the host or
> service. That depend on the  EnableAfterReset  setting on BM= C side:
> CredentialBootstrapping (v1.3+)
> { object The credential bootstrapping settings for this interface.
>         EnableAfterReset (v1.3= +) Boolean read-write (null) An
> indication of whether credential bootstrapping is enabled after a rese= t for this interface.
>         Enabled (v1.3+) Boolea= n read-write (null) An indication of
> whether credential bootstrapping is enabled for this interface.
>         RoleId (v1.3+) string = read-write The role used for the
> bootstrap account created for this interface.
> }
> So, if EnableAfterReset set to false, that means BMC will response
> with 0x80 error and will not return any credentials after reboot. And<= br> > BIOS BMC communication will fail.
> Another concern with  disabling credential bootstrapping control = is
> that we do it on Exit Boot event before passing a control to OS.
> But OS may also need to communicate to BMC through Redfish Host
> Interface to post some information. And it will be blocked by our IPMI= call.
> We create that SMBIOS Type 42 table with Redfish Host Interface
> settings which can be used by OS to communicate with BMC. But without<= br> > the credentials it will not be possible.
>
> Another question is AuthMethod parameter you initialize in this librar= y:
> *AuthMethod =3D AuthMethodHttpBasic;
> According to Redfish HI specification 3 methods may be used - No Auth,=
> Basic Auth and Session Auth.
> Basic Auth and Session Auth methods are required the credentials to be=
> used by BIOS. And both of them should be supported by BMC.
> And your high level function RedfishCreateLibredfishService also
> supports of creation Basic or Session Auth service.
> I'm not sure why low level library which is created to get credentials=
> from BMC should decide what Authentication method should be used?
> Should it be configured with some PCD? Maybe user may select in Setup<= br> > what method should be used? Or it could be build time configuration? >
> Thank you,
> Igor
>
> -----Original Message-----
> From: Nickle Wang <nicklew@nv= idia.com>
> Sent: Tuesday, October 25, 2022 4:24 AM
> To: devel@edk2.groups.io; = abner.chang@amd.com
> Cc: Nick Ramirez <nramirez@n= vidia.com>; Igor Kulchytskyy
> <igork@ami.com>
> Subject: [EXTERNAL] RE: [edk2-devel] [PATCH]
> RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation
>
>
> **CAUTION: The e-mail below is from an external source. Please
> exercise caution before opening attachments, clicking links, or
> following guidance.**
>
> Thanks for your review comments, Abner! I will update new version
> patch later. The CI build error will be handled together.
>
> > please add Igor as reviewer too
> Sure!
>
>
> > +  *UserId =3D AllocateZeroPool (sizeof (CHAR8) * USERNAME_M= AX_SIZE);
> > + if
> [Chang, Abner]
> Allocation memory with the size (USERNAME_MAX_LENGTH + 1)  for bo= th
> BootUsername and BootstrapPassword?   Because the maximum nu= mber of
> characters defined in the spec is USERNAME_MAX_LENGTH for the
> user/password.
>
> Yes, the additional one byte is for NULL terminator.
> USERNAME_MAX_LENGTH is defined as 16 and follow host interface
> specification.
>
> Regards,
> Nickle
>
> -----Original Message-----
> From: devel@edk2.groups.io= <devel@edk2.groups.io> O= n Behalf Of Chang,
> Abner via groups.io
> Sent: Saturday, October 22, 2022 3:01 PM
> To: Nickle Wang <nicklew@nvid= ia.com>; devel@edk2.groups.io
> Cc: Nick Ramirez <nramirez@n= vidia.com>; Igor Kulchytskyy
> <igork@ami.com>
> Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredential= Lib:
> IPMI implementation
>
> External email: Use caution opening links or attachments
>
>
> [AMD Official Use Only - General]
>
> Hi Nickle, please add Igor as reviewer too. My comments is in below, >
> > -----Original Message-----
> > From: Nickle Wang <nickl= ew@nvidia.com>
> > Sent: Thursday, October 20, 2022 10:55 AM
> > To: devel@edk2.groups.io<= /a>
> > Cc: Chang, Abner <
Abner= .Chang@amd.com>; Nick Ramirez
> > <nramirez@nvidia.com>
> > Subject: [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI > > implementation
> >
> > Caution: This message originated from an External Source. Use pro= per
> > caution when opening attachments, clicking links, or responding.<= br> > >
> >
> > This library follows Redfish Host Interface specification and use=
> > IPMI command to get bootstrap account credential(NetFn 2Ch, Comma= nd
> > 02h)
> from BMC.
> > RedfishHostInterfaceDxe will use this credential for the followin= g
> > communication between BIOS and BMC.
> >
> > Cc: Abner Chang <
abner.= chang@amd.com>
> > Cc: Nick Ramirez <nrami= rez@nvidia.com>
> > Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> > ---
> >  .../RedfishPlatformCredentialLib.c    &= nbsp;       | 273 ++++++++++++++++++
> >  .../RedfishPlatformCredentialLib.h    &= nbsp;       |  75 +++++
> >  .../RedfishPlatformCredentialLib.inf    = ;      |  37 +++
> [Chang, Abner]
> Could we name this library RedfishPlatformCredentialIpmi so the naming=
> style is consistent with RedfishPlatformCredentialNull?
>
> >  3 files changed, 385 insertions(+)
> >  create mode 100644
> >
> RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredent=
> ial
> Lib.
> > c
> >  create mode 100644
> >
> RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredent=
> ial
> Lib.
> > h
> >  create mode 100644
> > RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCr= ede
> > nt
> > ialLib.i
> > nf
> >
> > diff --git
> > a/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatform= Cre
> > de
> > ntialLi
> > b.c
> > b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatform= Cre
> > de
> > ntialLi
> > b.c
> > new file mode 100644
> > index 0000000000..23a15ab1fa
> > --- /dev/null
> > +++ b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlat= for
> > +++ mC
> > +++ re
> > +++ dentialLib.c
> > @@ -0,0 +1,273 @@
> > +/** @file
> > +*
> > +*  Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. = All rights
> reserved.
> > +*
> > +*  SPDX-License-Identifier: BSD-2-Clause-Patent
> [Chang, Abner]
> We can have "@par Revision Reference:"  in the file hea= der to point
> out the spec.
> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fnam12.s= afelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam1&amp= ;data=3D05%7C01%7Cnicklew%40nvidia.com%7C3f7c98d402b8471f95d408dab8fdeb00%7= C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638025697967855556%7CUnknown%7C= TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0= %3D%7C3000%7C%7C%7C&amp;sdata=3D90NlFqDGaEtk5kMibeuQ3%2FzQNn3ANJn1LcF6R= NqsJJ0%3D&amp;reserved=3D0
> 1.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam1=
> &amp;data=3D05%7C01%7Cigork%40ami.com%7C224e78526d7d45a7b31108dab8= f42ac1
> %7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638025656093102767%7CUnk=
> nown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWw=
> iLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3DYN52FOx%2F%2F1YYG8Nl86= vu7zlz
> M%2BpLMk3Ym0RNPLxLKqw%3D&amp;reserved=3D0
> 2.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fnam1=
> &amp;data=3D05%7C01%7Cnicklew%40nvidia.com%7C90696ea8811e49e371a70= 8dab8e
> be2d8%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638025620543993279%=
> 7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik=
> 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3DCyvRgMZREOk5Yf0hU= 3CmH%2
> B08ktxMYw%2Bixr4UVywfrAQ%3D&amp;reserved=3D0
> 1.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fww&a= mp;a
> mp;data=3D05%7C01%7Cigork%40ami.com%7C2b5b562c02c04c90d51208dab8b8c0fd= %7
> C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C638025400915295621%7CUnkno=
> wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL=
> CJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3DUy%2B3HS336N3rgNSESPcyOP= GX3eOR
> 48hekdz08nLtJU4%3D&amp;reserved=3D0
> w.dmtf.org%2Fsites%2Fdefault%2Ffiles%2Fstandards%2Fdocuments%2FDSP
> 0270_1.3.0.pdf&amp;data=3D05%7C01%7Cabner.chang%40amd.com%7C074aa<= br> > e162fba49409af408dab8297c03%7C3dd8961fe4884e608e11a82d994e183d%7C
> 0%7C0%7C638024786060127888%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
> %7C%7C%7C&amp;sdata=3DyY6hhKjQfVqmNuufbeDNk%2B2FKrebHyIAyS9Ya4
> szE3Y%3D&amp;reserved=3D0
>
> > +*
> > +**/
> > +
> > +#include "RedfishPlatformCredentialLib.h"
> > +
> > +//
> > +// Global flag of controlling credential service // BOOLEAN
> > +mRedfishServiceStopped =3D FALSE;
> > +
> > +/**
> > +  Notify the Redfish service provide to stop provide config= uration
> > +service to this
> > platform.
> > +
> > +  This function should be called when the platfrom is about= to
> > + leave the safe
> > environment.
> > +  It will notify the Redfish service provider to abort all = logined
> > + session, and prohibit  further login with original auth in= fo.
> > + GetAuthInfo() will return EFI_UNSUPPORTED once this  funct= ion is
> returned.
> > +
> > +  @param[in]   This     =            Pointer to
> > EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
> > +  @param[in]   ServiceStopType   &= nbsp; Reason of stopping Redfish service.
> > +
> > +  @retval EFI_SUCCESS      &n= bsp;       Service has been stoped successful= ly.
> > +  @retval EFI_INVALID_PARAMETER    This is N= ULL.
> > +  @retval Others       &= nbsp;           Some erro= r happened.
> > +
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +LibStopRedfishService (
> > +  IN     EDKII_REDFISH_CREDENTIAL_PROTO= COL           *This,
> > +  IN     EDKII_REDFISH_CREDENTIAL_STOP_= SERVICE_TYPE
> ServiceStopType
> > +  )
> > +{
> > +  EFI_STATUS  Status;
> > +
> > +  if ((ServiceStopType <=3D ServiceStopTypeNone) || (Ser= viceStopType
> > + >=3D
> > ServiceStopTypeMax)) {
> > +    return EFI_INVALID_PARAMETER;
> > +  }
> > +
> > +  //
> > +  // Raise flag first
> > +  //
> > +  mRedfishServiceStopped =3D TRUE;
> > +
> > +  //
> > +  // Notify BMC to disable credential bootstrapping support= .
> > +  //
> > +  Status =3D GetBootstrapAccountCredentials (TRUE, NULL, NU= LL);  if
> > + (EFI_ERROR (Status)) {
> > +    DEBUG ((DEBUG_ERROR, "%a: fail to disabl= e bootstrap credential:
> > + %r\n",
> > __FUNCTION__, Status));
> > +    return Status;
> > +  }
> > +
> > +  return EFI_SUCCESS;
> > +}
> > +
> > +/**
> > +  Notification of Exit Boot Service.
> > +
> > +  @param[in]  This    Pointer to EDKII_= REDFISH_CREDENTIAL_PROTOCOL.
> > +**/
> > +VOID
> > +EFIAPI
> > +LibCredentialExitBootServicesNotify (
> > +  IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This > > +  )
> > +{
> > +  //
> > +  // Stop the credential support when system is about to en= ter OS.
> > +  //
> > +  LibStopRedfishService (This, ServiceStopTypeExitBootServi= ce); }
> > +
> > +/**
> > +  Notification of End of DXe.
> > +
> > +  @param[in]  This    Pointer to EDKII_= REDFISH_CREDENTIAL_PROTOCOL.
> > +**/
> > +VOID
> > +EFIAPI
> > +LibCredentialEndOfDxeNotify (
> > +  IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This > > +  )
> > +{
> > +  //
> > +  // Do nothing now.
> > +  // We can stop credential support when system reach end-o= f-dxe
> > +for security
> > reason.
> > +  //
> > +}
> > +
> > +/**
> > +  Function to retrieve temporary use credentials for the UE= FI
> > +redfish client
> [Chang, Abner]
> We miss the functionality to disable bootstrap credential service in > the function description.
>
> > +
> > +  @param[in]  DisableBootstrapControl
> > +          &nbs= p;            &= nbsp;           &nbs= p;  TRUE - Tell the BMC to disable the bootstrap credential
> > +          &nbs= p;            &= nbsp;           &nbs= p;         service to ensure no one= else gains credentials
> > +          &nbs= p;            &= nbsp;           &nbs= p;  FALSE  Allow the bootstrap
> > + credential service to continue  @param[out] BootstrapUsern= ame
> > +          &nbs= p;            &= nbsp;           &nbs= p;  A pointer to a UTF-8 encoded
> > + string for the credential
> > username
> > +          &nbs= p;            &= nbsp;           &nbs= p;  When DisableBootstrapControl
> > + is TRUE, this pointer can be NULL
> > +
> > +  @param[out] BootstrapPassword
> > +          &nbs= p;            &= nbsp;           &nbs= p;  A pointer to a UTF-8 encoded
> > + string for the credential
> > password
> > +          &nbs= p;            &= nbsp;           &nbs= p;  When DisableBootstrapControl
> > + is TRUE, this pointer can be NULL
> > +
> > +  @retval  EFI_SUCCESS     &n= bsp;          Credentials were= successfully fetched and
> > returned
> > +  @retval  EFI_INVALID_PARAMETER   &nbs= p;  BootstrapUsername or
> > BootstrapPassword is NULL when DisableBootstrapControl
> > +          &nbs= p;            &= nbsp;           &nbs= p;  is set to FALSE
> > +  @retval  EFI_DEVICE_ERROR    &nb= sp;      An IPMI failure occurred
> [Chang, Abner]
> The return status should also include the status of disabling
> bootstrap credential.
>
>
> > +**/
> > +EFI_STATUS
> > +GetBootstrapAccountCredentials (
> > +  IN BOOLEAN DisableBootstrapControl,
> > +  IN OUT CHAR8 *BootstrapUsername, OPTIONAL
> > +  IN OUT CHAR8  *BootstrapPassword    O= PTIONAL
> > +  )
> > +{
> > +  EFI_STATUS        = ;            &n= bsp;            = ; Status;
> > +  IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA   =   CommandData;
> > +  IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE  Response= Data;
> > +  UINT32        &nb= sp;            =             &nb= sp;    ResponseSize;
> > +
> > +  if (!PcdGetBool (PcdIpmiFeatureEnable)) {
> > +    DEBUG ((DEBUG_ERROR, "%a: IPMI is not en= abled! Unable to fetch
> > + Redfish
> > credentials\n", __FUNCTION__));
> > +    return EFI_UNSUPPORTED;
> > +  }
> > +
> > +  //
> > +  // NULL buffer check
> > +  //
> > +  if (!DisableBootstrapControl && ((BootstrapUserna= me =3D=3D NULL) ||
> > (BootstrapPassword =3D=3D NULL))) {
> > +    return EFI_INVALID_PARAMETER;
> > +  }
> > +
> > +  DEBUG ((DEBUG_VERBOSE, "%a: Disable bootstrap contro= l: 0x%x\n",
> > + __FUNCTION__, DisableBootstrapControl));
> > +
> > +  //
> > +  // IPMI callout to NetFn 2C, command 02
> > +  //    Request data:
> > +  //      Byte 1: REDFISH_IPMI_GRO= UP_EXTENSION
> > +  //      Byte 2: DisableBootstrap= Control
> > +  //
> > +  CommandData.GroupExtensionId     = ;   =3D
> REDFISH_IPMI_GROUP_EXTENSION;
> > +  CommandData.DisableBootstrapControl =3D (DisableBootstrap= Control ?
> > + REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_DISABLE :
> > + REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE);
> > +
> > +  ResponseSize =3D sizeof (ResponseData);
> > +
> > +  //
> > +  //    Response data:
> > +  //      Byte 1   = : Completion code
> > +  //      Byte 2   = : REDFISH_IPMI_GROUP_EXTENSION
> > +  //      Byte 3-18 : Username
> > +  //      Byte 19-34: Password
> > +  //
> > +  Status =3D IpmiSubmitCommand (
> > +          &nbs= p;  IPMI_NETFN_GROUP_EXT,
> > +          &nbs= p;  REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD,
> > +          &nbs= p;  (UINT8 *)&CommandData,
> > +          &nbs= p;  sizeof (CommandData),
> > +          &nbs= p;  (UINT8 *)&ResponseData,
> > +          &nbs= p;  &ResponseSize
> > +          &nbs= p;  );
> > +
> > +  if (EFI_ERROR (Status)) {
> > +    DEBUG ((DEBUG_ERROR, "%a: IPMI transacti= on failure.
> > + Returning\n",
> > __FUNCTION__));
> > +    ASSERT_EFI_ERROR (Status);
> > +    return Status;
> > +  } else {
> > +    if (ResponseData.CompletionCode !=3D IPMI_COM= P_CODE_NORMAL) {
> > +      if (ResponseData.CompletionCode = =3D=3D
> > REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED) {
> > +        DEBUG ((DEBUG_ERROR, = "%a: bootstrap credential support was
> > disabled\n", __FUNCTION__));
> > +        return EFI_ACCESS_DEN= IED;
> > +      }
> > +
> > +      DEBUG ((DEBUG_ERROR, "%a: Co= mpletion code =3D 0x%x.
> > + Returning\n",
> > __FUNCTION__, ResponseData.CompletionCode));
> > +      return EFI_PROTOCOL_ERROR;
> > +    } else if (ResponseData.GroupExtensionId !=3D=
> > REDFISH_IPMI_GROUP_EXTENSION) {
> > +      DEBUG ((DEBUG_ERROR, "%a: Gr= oup Extension Response =3D 0x%x.
> > Returning\n", __FUNCTION__, ResponseData.GroupExtensionId));=
> > +      return EFI_DEVICE_ERROR;
> > +    } else {
> > +      if (BootstrapUsername !=3D NULL) = {
> > +        CopyMem (BootstrapUse= rname, ResponseData.Username,
> > USERNAME_MAX_LENGTH);
> > +        //
> > +        // Manually append nu= ll-terminator in case 16 characters
> > + username
> > returned.
> > +        //
> > +        BootstrapUsername[USE= RNAME_MAX_LENGTH] =3D '\0';
> > +      }
> > +
> > +      if (BootstrapPassword !=3D NULL) = {
> > +        CopyMem (BootstrapPas= sword, ResponseData.Password,
> > PASSWORD_MAX_LENGTH);
> > +        //
> > +        // Manually append nu= ll-terminator in case 16 characters
> > + password
> > returned.
> > +        //
> > +        BootstrapPassword[PAS= SWORD_MAX_LENGTH] =3D '\0';
> > +      }
> > +    }
> > +  }
> > +
> > +  return Status;
> > +}
> > +
> > +/**
> > +  Retrieve platform's Redfish authentication information. > > +
> > +  This functions returns the Redfish authentication method = together
> > + with the user Id and  password.
> > +  - For AuthMethodNone, the UserId and Password could be us= ed for
> > + HTTP
> > header authentication
> > +    as defined by RFC7235.
> > +  - For AuthMethodRedfishSession, the UserId and Password c= ould be
> > + used for
> > Redfish
> > +    session login as defined by  Redfish API= specification (DSP0266).
> > +
> > +  Callers are responsible for and freeing the returned stri= ng storage.
> > +
> > +  @param[in]   This     =            Pointer to
> > EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
> > +  @param[out]  AuthMethod     = ;     Type of Redfish authentication method.
> > +  @param[out]  UserId     &nb= sp;        The pointer to store the retu= rned UserId
> string.
> > +  @param[out]  Password     &= nbsp;      The pointer to store the returned
> Password
> > string.
> > +
> > +  @retval EFI_SUCCESS      &n= bsp;       Get the authentication information=
> successfully.
> > +  @retval EFI_ACCESS_DENIED     &n= bsp;  SecureBoot is disabled after EndOfDxe.
> > +  @retval EFI_INVALID_PARAMETER    This or A= uthMethod or UserId or
> > Password is NULL.
> > +  @retval EFI_OUT_OF_RESOURCES     Ther= e are not enough memory
> resources.
> > +  @retval EFI_UNSUPPORTED     &nbs= p;    Unsupported authentication method is
> > found.
> > +
> > +**/
> > +EFI_STATUS
> > +EFIAPI
> > +LibCredentialGetAuthInfo (
> > +  IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This, > > +  OUT EDKII_REDFISH_AUTH_METHOD    &nbs= p;     *AuthMethod,
> > +  OUT CHAR8        =             &nb= sp;         **UserId,
> > +  OUT CHAR8        =             &nb= sp;         **Password
> > +  )
> > +{
> > +  EFI_STATUS  Status;
> > +
> > +  if ((AuthMethod =3D=3D NULL) || (UserId =3D=3D NULL) || (= Password =3D=3D NULL)) {
> > +    return EFI_INVALID_PARAMETER;
> > +  }
> > +
> > +  *UserId   =3D NULL;
> > +  *Password =3D NULL;
> > +
> > +  if (mRedfishServiceStopped) {
> > +    DEBUG ((DEBUG_ERROR, "%a: credential ser= vice is stopped due to
> > + security
> > reason\n", __FUNCTION__));
> > +    return EFI_ACCESS_DENIED;
> > +  }
> > +
> > +  *AuthMethod =3D AuthMethodHttpBasic;
> > +
> > +  *UserId =3D AllocateZeroPool (sizeof (CHAR8) * USERNAME_M= AX_SIZE);
> > + if
> [Chang, Abner]
> Allocation memory with the size (USERNAME_MAX_LENGTH + 1)  for bo= th
> BootUsername and BootstrapPassword?   Because the maximum nu= mber of
> characters defined in the spec is USERNAME_MAX_LENGTH for the
> user/password.
>
>
> > + (*UserId =3D=3D NULL) {
> > +    return EFI_OUT_OF_RESOURCES;
> > +  }
> > +
> > +  *Password =3D AllocateZeroPool (sizeof (CHAR8) *
> > + PASSWORD_MAX_SIZE); if (*Password =3D=3D NULL) {
> > +    return EFI_OUT_OF_RESOURCES;
> > +  }
> > +
> > +  Status =3D GetBootstrapAccountCredentials (FALSE, *UserId= ,
> > + *Password); if (EFI_ERROR (Status)) {
> > +    DEBUG ((DEBUG_ERROR, "%a: fail to get bo= otstrap credential:
> > + %r\n",
> > __FUNCTION__, Status));
> > +    return Status;
> > +  }
> > +
> > +  return EFI_SUCCESS;
> > +}
> > diff --git
> > a/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatform= Cre
> > de
> > ntialLi
> > b.h
> > b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatform= Cre
> > de
> > ntialLi
> > b.h
> > new file mode 100644
> > index 0000000000..5b448e01be
> > --- /dev/null
> > +++ b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlat= for
> > +++ mC
> > +++ re
> > +++ dentialLib.h
> > @@ -0,0 +1,75 @@
> > +/** @file
> > +*
> > +*  Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. = All rights
> reserved.
> > +*
> > +*  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +*
> > +**/
> > +#include <Uefi.h>
> > +#include <IndustryStandard/Ipmi.h>
> > +#include <Protocol/EdkIIRedfishCredential.h>
> > +#include <Library/BaseLib.h>
> > +#include <Library/BaseMemoryLib.h>
> > +#include <Library/DebugLib.h>
> > +#include <Library/IpmiBaseLib.h>
> > +#include <Library/MemoryAllocationLib.h> #include
> > +<Library/RedfishCredentialLib.h>
> > +
> > +#define REDFISH_IPMI_GROUP_EXTENSION    &nbs= p;            &= nbsp;        0x52
> > +#define REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD  &n= bsp;         0x02
> > +#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE  &nbs= p;           0xA5
> > +#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_DISABLE  &nb= sp;          0x00
> > +#define
> REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED
> > 0x80
> > +
> > +//
> > +// Per Redfish Host Interface Specification 1.3, The maximum len= ght
> > +of // username and password is 16 characters long.
> > +//
> > +#define USERNAME_MAX_LENGTH  16
> > +#define PASSWORD_MAX_LENGTH  16
> > +#define USERNAME_MAX_SIZE    (USERNAME_MAX_LENGTH= + 1)  //
> NULL
> > terminator
> > +#define PASSWORD_MAX_SIZE    (PASSWORD_MAX_LENGTH= + 1)  //
> NULL
> > terminator
> > +
> > +#pragma pack(1)
> > +///
> > +/// The definition of IPMI command to get bootstrap account
> > +credentials /// typedef struct {
> > +  UINT8    GroupExtensionId;
> > +  UINT8    DisableBootstrapControl;
> > +} IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA;
> > +
> > +///
> > +/// The response data of getting bootstrap credential /// typede= f
> > +struct {
> > +  UINT8    CompletionCode;
> > +  UINT8    GroupExtensionId;
> > +  CHAR8    Username[USERNAME_MAX_LENGTH]; > > +  CHAR8    Password[PASSWORD_MAX_LENGTH]; > > +} IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE;
> > +
> > +#pragma pack()
> > +
> > +/**
> > +  Function to retrieve temporary use credentials for the UE= FI
> > +redfish client
> [Chang, Abner]
> We miss the functionality to disable bootstrap credential service in > the function description.
>
> > +
> > +  @param[in]  DisableBootstrapControl
> > +          &nbs= p;            &= nbsp;           &nbs= p;  TRUE - Tell the BMC to disable the bootstrap credential
> > +          &nbs= p;            &= nbsp;           &nbs= p;         service to ensure no one= else gains credentials
> > +          &nbs= p;            &= nbsp;           &nbs= p;  FALSE  Allow the bootstrap
> > + credential service to continue  @param[out] BootstrapUsern= ame
> > +          &nbs= p;            &= nbsp;           &nbs= p;  A pointer to a UTF-8 encoded
> > + string for the credential username
> > +
> > +  @param[out] BootstrapPassword
> > +          &nbs= p;            &= nbsp;           &nbs= p;  A pointer to a UTF-8 encoded
> > + string for the credential password
> > +
> > +  @retval  EFI_SUCCESS     &n= bsp;          Credentials were= successfully fetched and
> > returned
> [Chang, Abner]
> Or the bootstrap credential service is disabled successfully, right? >
> > +  @retval  EFI_DEVICE_ERROR    &nb= sp;      An IPMI failure occurred
> > +**/
> > +EFI_STATUS
> > +GetBootstrapAccountCredentials (
> > +  IN BOOLEAN    DisableBootstrapControl,
> > +  IN OUT CHAR8  *BootstrapUsername,
> > +  IN OUT CHAR8  *BootstrapPassword
> > +  );
> > diff --git
> > a/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatform= Cre
> > de
> > ntialLi
> > b.inf
> > b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlatform= Cre
> > de
> > ntialLi
> > b.inf
> > new file mode 100644
> > index 0000000000..a990d28363
> > --- /dev/null
> > +++ b/RedfishPkg/Library/RedfishPlatformCredentialLib/RedfishPlat= for
> > +++ mC
> > +++ re
> > +++ dentialLib.inf
> > @@ -0,0 +1,37 @@
> > +## @file
> > +#
> > +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All ri= ghts
> reserved.
> > +#
> > +#  SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> > +
> > +[Defines]
> > +  INF_VERSION       &nbs= p;            =3D 0x= 0001000b
> > +  BASE_NAME        =             &nb= sp; =3D RedfishPlatformCredentialLib
> > +  FILE_GUID        =             &nb= sp; =3D 9C45D622-4C66-417F-814C-F76246D97233
> > +  MODULE_TYPE       &nbs= p;            =3D DX= E_DRIVER
> > +  VERSION_STRING       &= nbsp;         =3D 1.0
> > +  LIBRARY_CLASS       &n= bsp;          =3D RedfishPlatf= ormCredentialLib
> > +
> > +[Sources]
> > +  RedfishPlatformCredentialLib.c
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  MdeModulePkg/MdeModulePkg.dec
> > +  RedfishPkg/RedfishPkg.dec
> > +  IpmiFeaturePkg/IpmiFeaturePkg.dec
> [Chang, Abner]
> Could you please add a comment to the reference  of IpmiFeaturePk= g? We
> have to give customers a notice that the dependence of "edk2-
> platforms/Features/Intel/OutOfBandManagement/". They have to add = the
> path to PACKAGES_PATH. You also have to skip this dependence in the > RedfishPkg.yaml to avoid the CI error.
>
> Another thing is I propose to move out IpmiFeaturePkg from edk2-
> platforms/Features/Intel/OutOfBandManagement to edk2-
> platforms/Features/ManageabilityPkg  that also provides the
> implementation of PLDM/MCTP/IPMI/KCS.  I had an initial talk with=
> IpmiFeaturePkg owner and get the positive response on this proposal. I=
> will kick off the discussion on the dev mailing list. That is to say > this module may need a little bit change later, however that is good > to me having this implementation now.
> Thanks
> Abner
> > +
> > +[LibraryClasses]
> > +  UefiLib
> > +  DebugLib
> > +  IpmiBaseLib
> > +  MemoryAllocationLib
> > +  BaseMemoryLib
> > +
> > +[Pcd]
> > +  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable
> > +
> > +[Depex]
> > +  TRUE
> > --
> > 2.17.1
>
>
>
>
>
> -The information contained in this message may be confidential and
> proprietary 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 designee. If the reader of this message is not > the intended recipient, you are on notice that any distribution of
> this message, in any form, is strictly prohibited. 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.
>
>
>
>
>
>
>
>
>
>
> -The information contained in this message may be confidential and
> proprietary 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 designee. If the reader of this message is not > the intended recipient, you are on notice that any distribution of
> this message, in any form, is strictly prohibited. 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.
>
>
>
>
-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 on notice that any distribution of = this message, in any form, is strictly prohibited. Please promptly notify t= he sender by reply e-mail or by telephone at 770-246-8600, and then delete = or destroy all copies of the transmission.
-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 on notice that any distribution of = this message, in any form, is strictly prohibited. Please promptly notify t= he sender by reply e-mail or by telephone at 770-246-8600, and then delete = or destroy all copies of the transmission.

-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 on notice that any distribution of = this message, in any form, is strictly prohibited. Please promptly notify t= he sender by reply e-mail or by telephone at 770-246-8600, and then delete = or destroy all copies of the transmission. --_000_BLAPR10MB51859FAFE5D7C7F9EB545118A8349BLAPR10MB5185namp_--