From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.1244.1573088265898140865 for ; Wed, 06 Nov 2019 16:57:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jiewen.yao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 16:57:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,276,1569308400"; d="scan'208";a="353648640" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 06 Nov 2019 16:57:45 -0800 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 6 Nov 2019 16:57:25 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 6 Nov 2019 16:57:24 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.108]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.213]) with mapi id 14.03.0439.000; Thu, 7 Nov 2019 08:57:22 +0800 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Yao, Jiewen" , "Gao, Liming" CC: "Kinney, Michael D" , "Lou, Yun" Subject: Re: [edk2-devel] [PATCH V2 1/4] MdePkg/Include: Add DMTF SPDM definition. Thread-Topic: [edk2-devel] [PATCH V2 1/4] MdePkg/Include: Add DMTF SPDM definition. Thread-Index: AQHVj+b9J/lkzKPqpkKe2Vvlg+RrUad+P11AgACkdjCAAAjiwA== Date: Thu, 7 Nov 2019 00:57:21 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F84112A@shsmsx102.ccr.corp.intel.com> References: <20191031123012.16020-1-jiewen.yao@intel.com> <20191031123012.16020-2-jiewen.yao@intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E5389A0@SHSMSX104.ccr.corp.intel.com> <15D4B9B24059B4F1.19610@groups.io> In-Reply-To: <15D4B9B24059B4F1.19610@groups.io> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWJjMDM4NzgtZTlmNS00ZWI3LTkzZjUtYTRiNWNkOWUyZGE4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidmJ0VThocklqZzFVa0k5RHBISytldno0MUlIV3laYkNxeTBlelJWVzZSQXZ0SytKWXF5cTZhK2dGdlNLTmo4KyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiewen.yao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I will update to 0.99 in V3. > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Yao, Jiew= en > Sent: Thursday, November 7, 2019 8:26 AM > To: Gao, Liming ; devel@edk2.groups.io > Cc: Kinney, Michael D ; Lou, Yun > > Subject: Re: [edk2-devel] [PATCH V2 1/4] MdePkg/Include: Add DMTF SPDM > definition. >=20 > Thanks. Agree. > Will do that. It is 0.95 now. >=20 > > -----Original Message----- > > From: Gao, Liming > > Sent: Wednesday, November 6, 2019 10:38 PM > > To: Yao, Jiewen ; devel@edk2.groups.io > > Cc: Kinney, Michael D ; Lou, Yun > > > > Subject: RE: [PATCH V2 1/4] MdePkg/Include: Add DMTF SPDM definition. > > > > Jiewen: > > I have one minor comment. Can you specify the spec version in file h= eader? > > With this update, Reviewed-by: Liming Gao > > > > Thanks > > Liming > > > -----Original Message----- > > > From: Yao, Jiewen > > > Sent: Thursday, October 31, 2019 8:30 PM > > > To: devel@edk2.groups.io > > > Cc: Kinney, Michael D ; Gao, Liming > > ; Lou, Yun > > > Subject: [PATCH V2 1/4] MdePkg/Include: Add DMTF SPDM definition. > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2303 > > > > > > Cc: Michael D Kinney > > > Cc: Liming Gao > > > Cc: Yun Lou > > > Signed-off-by: Jiewen Yao > > > --- > > > MdePkg/Include/IndustryStandard/Spdm.h | 203 ++++++++++++++++++++ > > > 1 file changed, 203 insertions(+) > > > > > > diff --git a/MdePkg/Include/IndustryStandard/Spdm.h > > b/MdePkg/Include/IndustryStandard/Spdm.h > > > new file mode 100644 > > > index 0000000000..d62b24e9ef > > > --- /dev/null > > > +++ b/MdePkg/Include/IndustryStandard/Spdm.h > > > @@ -0,0 +1,203 @@ > > > +/** @file > > > + Definitions of Security Protocol & Data Model Specification (SPDM= ) > > > + in Distributed Management Task Force (DMTF). > > > + > > > +Copyright (c) 2019, Intel Corporation. All rights reserved.
> > > +SPDX-License-Identifier: BSD-2-Clause-Patent > > > + > > > +**/ > > > + > > > + > > > +#ifndef __SPDM_H__ > > > +#define __SPDM_H__ > > > + > > > +#pragma pack(1) > > > + > > > +#define SPDM_DIGESTS 0x01 > > > +#define SPDM_CERTIFICATE 0x02 > > > +#define SPDM_CHALLENGE_AUTH 0x03 > > > +#define SPDM_MEASUREMENTS 0x60 > > > +#define SPDM_CAPABILITIES 0x61 > > > +#define SPDM_SET_CERT_RESPONSE 0x62 > > > +#define SPDM_ALGORITHMS 0x63 > > > +#define SPDM_ERROR 0x7F > > > +#define SPDM_GET_DIGESTS 0x81 > > > +#define SPDM_GET_CERTIFICATE 0x82 > > > +#define SPDM_CHALLENGE 0x83 > > > +#define SPDM_GET_MEASUREMENTS 0xE0 > > > +#define SPDM_GET_CAPABILITIES 0xE1 > > > +#define SPDM_SET_CERTIFICATE 0xE2 > > > +#define SPDM_NEGOTIATE_ALGORITHMS 0xE3 > > > +#define SPDM_RESPOND_IF_READY 0xFF > > > + > > > +typedef struct { > > > + UINT8 SPDMVersion; > > > + UINT8 RequestResponseCode; > > > + UINT8 Param1; > > > + UINT8 Param2; > > > +} SPDM_MESSAGE_HEADER; > > > + > > > +#define SPDM_VERSION 0x10 > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > +} SPDM_GET_CAPABILITIES_REQUEST; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + UINT8 DetailedVersion; > > > + UINT8 CryptographicTimeout; > > > + UINT16 Reserved; > > > + UINT32 Flags; > > > + UINT16 SPDMMajorVersions; > > > + UINT16 Reserved2; > > > +} SPDM_CAPABILITIES_RESPONSE; > > > + > > > +#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_AUTH_CAP BIT1 > > > +#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP BIT3 > > > +#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_FRESH_CAP > > BIT4 > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + UINT16 Length; > > > + UINT8 MeasurementSpecification; > > > + UINT8 Reserved; > > > + UINT32 BaseAsymAlgo; > > > + UINT32 BaseHashAlgo; > > > + UINT64 Reserved2; > > > + UINT8 ExtAsymCount; > > > + UINT8 ExtHashCount; > > > + UINT16 Reserved3; > > > +//UINT32 ExtAsym[ExtAsymCount]; > > > +//UINT32 ExtHash[ExtHashCount]; > > > +} SPDM_NEGOTIATE_ALGORITHMS_REQUEST; > > > + > > > +#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_2048 > > BIT0 > > > +#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_3072 > > BIT1 > > > +#define > > SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_ECDSA_ECC_NIST_P256 > > BIT2 > > > +#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_4096 > > BIT3 > > > +#define > > SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_ECDSA_ECC_NIST_P384 > > BIT4 > > > +#define > > SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_ECDSA_ECC_NIST_P521 > > BIT5 > > > + > > > +#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA2_256 > > BIT0 > > > +#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 > > BIT1 > > > +#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA2_384 > > BIT2 > > > +#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 > > BIT3 > > > +#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA2_512 > > BIT4 > > > +#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 > > BIT5 > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + UINT16 Length; > > > + UINT8 MeasurementSpecification; > > > + UINT8 MeasurementHashAlgo; > > > + UINT32 BaseAsymSel; > > > + UINT32 BaseHashSel; > > > + UINT64 Reserved; > > > + UINT8 ExtAsymSelCount; > > > + UINT8 ExtHashSelCount; > > > + UINT16 Reserved2; > > > +//UINT32 ExtAsymSel[ExtAsymSelCount]; > > > +//UINT32 ExtHashSel[ExtHashSelCount]; > > > +} SPDM_ALGORITHMS_RESPONSE; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > +} SPDM_GET_DIGESTS_REQUEST; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > +//UINT8 Digest[DigestSize]; > > > +} SPDM_DIGESTS_RESPONSE; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + UINT16 Offset; > > > + UINT16 Length; > > > +} SPDM_GET_CERTIFICATE_REQUEST; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > +//UINT8 CertChain[CertChainSize]; > > > +} SPDM_CERTIFICATE_RESPONSE; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > +//UINT8 Nonce[DigestSize]; > > > +} SPDM_CHALLENGE_REQUEST; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + UINT8 MinSPDMVersion; > > > + UINT8 MaxSPDMVersion; > > > + UINT8 Capabilities; > > > + UINT8 Reserved; > > > +//UINT8 CertChainHash[DigestSize]; > > > +//UINT8 Salt[DigestSize]; > > > +//UINT8 ContextHash[DigestSize]; > > > + // > > > + // M1 =3D Concatenate( > > > + // GET_CAPABILITIES_REQUEST1, CAPABILITIES_RESPONSE1, > > > + // NEGOTIATE_ALGORITHMS_REQUEST1, ALGORITHMS_RESPONSE1, > > CHALLENGE_REQUEST1, > > > + // CHALLENGE_AUTH_RESPONSE_WITHOUT_SIGNATURE1) > > > + // Signature =3D Sign(SK, Hash1(M1)) > > > + // > > > +//UINT8 Signature[KeySize]; > > > +} SPDM_CHALLENGE_AUTH_RESPONSE; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + // Param1 =3D=3D Request Type > > > + // Param2 =3D=3D Measurement Index (0xFF =3D=3D all) > > > +//UINT8 Nonce[DigestSize]; > > > +} SPDM_GET_MEASUREMENTS_REQUEST; > > > + > > > +typedef struct { > > > + UINT8 Index; > > > + UINT8 MeasurementType; > > > + UINT8 MeasurementSpecification; > > > + UINT8 Reserved; > > > +} SPDM_MEASUREMENT_BLOCK_HEADER; > > > + > > > +#define > > SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_IMMUTABLE_ROM > > 1 > > > +#define > > SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_MUTABLE_FIRMWARE > > 2 > > > +#define > > > SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_HARDWARE_CONFIGUR > > ATION 3 > > > +#define > > > SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_FIRMWARE_CONFIGUR > > ATION 4 > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + UINT8 NumberOfBlocks; > > > +//SPDM_MEASUREMENT_BLOCK_STRUCT > > MeasurementRecord[NumberOfBlocks]; > > > +//UINT8 Salt[DigestSize]; > > > +//UINT8 ContextHash[DigestSize]; > > > + // > > > + // L1 =3D Concatenate( > > > + // GET_MEASUREMENTS_REQUEST1, > > MEASUREMENTS_RESPONSE_WITHOUT_SIGNATURE1) > > > + // Signature =3D Sign(SK, Hash1(L1)) > > > + // > > > +//UINT8 Signature[KeySize]; > > > +} SPDM_MEASUREMENTS_RESPONSE; > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > + // Param1 =3D=3D Error Code > > > + // Param2 =3D=3D Error Data > > > +//UINT8 ExtendedErrorData[]; > > > +} SPDM_ERROR_RESPONSE; > > > + > > > +#define SPDM_ERROR_CODE_INVALID_REQUEST 0x01 > > > +#define SPDM_ERROR_CODE_BUSY 0x03 > > > +#define SPDM_ERROR_CODE_UNEXPECTED_REQUEST 0x04 > > > +#define SPDM_ERROR_CODE_UNINITIALIZED 0x05 > > > +#define SPDM_ERROR_CODE_REQUESTED_INFO_TOO_LONG 0x40 > > > +#define SPDM_ERROR_CODE_MAJOR_VERSION_MISMATCH 0x41 > > > +#define SPDM_ERROR_CODE_RESPONSE_NOT_READY 0x42 > > > + > > > +typedef struct { > > > + SPDM_MESSAGE_HEADER Header; > > > +} SPDM_RESPONSE_IF_READY_REQUEST; > > > + > > > +#pragma pack() > > > + > > > +#endif > > > + > > > -- > > > 2.19.2.windows.1 >=20 >=20 >=20