From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9BB6B2267F0F8 for ; Mon, 9 Apr 2018 18:51:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2018 18:51:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,429,1517904000"; d="scan'208";a="44862713" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 09 Apr 2018 18:51:11 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Apr 2018 18:51:11 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Apr 2018 18:51:10 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.151]) by shsmsx102.ccr.corp.intel.com ([169.254.2.184]) with mapi id 14.03.0319.002; Tue, 10 Apr 2018 09:51:09 +0800 From: "Fu, Siyuan" To: Laszlo Ersek , edk2-devel-01 CC: "Wu, Jiaxin" , "Gao, Liming" , "Kinney, Michael D" Thread-Topic: [PATCH 02/13] MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC Thread-Index: AQHTy1tUYaQGTj46ikiOSPUI4VkV/6P5Rgvg Date: Tue, 10 Apr 2018 01:51:09 +0000 Message-ID: References: <20180403145149.8925-1-lersek@redhat.com> <20180403145149.8925-3-lersek@redhat.com> In-Reply-To: <20180403145149.8925-3-lersek@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjdiMGEwOGMtZTY1Ni00ZDFmLWIyMjgtMWY3MDQyYTE1Y2JlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJmNHpqNmlCUGRnRlwvZ21rVjcrbWVocFNGMTg1dmFkd3FzYkltcUN3MkdqQmtnWmo5SUo4VnFzV1l4Uk9Oa01SUyJ9 dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 02/13] MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 01:51:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Tuesday, April 3, 2018 10:52 PM > To: edk2-devel-01 > Cc: Wu, Jiaxin ; Gao, Liming ; > Kinney, Michael D ; Fu, Siyuan > > Subject: [PATCH 02/13] MdePkg/Include/Protocol/Tls.h: pack structures fro= m > the TLS RFC >=20 > The structures defined in RFC 5246 are not to have any padding between > fields or at the end; use the "pack" pragma as necessary. >=20 > Cc: Jiaxin Wu > Cc: Liming Gao > Cc: Michael D Kinney > Cc: Siyuan Fu > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D915 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- > MdePkg/Include/Protocol/Tls.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/MdePkg/Include/Protocol/Tls.h b/MdePkg/Include/Protocol/Tls.= h > index 2119f33c0f5b..dafaabcd2a8b 100644 > --- a/MdePkg/Include/Protocol/Tls.h > +++ b/MdePkg/Include/Protocol/Tls.h > @@ -138,33 +138,37 @@ typedef enum { > /// > /// EFI_TLS_CIPHER > /// Note: The definition of EFI_TLS_CIPHER definition is from "RFC 5246, > A.4.1. > /// Hello Messages". The value of EFI_TLS_CIPHER is from TLS Ciphe= r > /// Suite Registry of IANA. > /// > +#pragma pack (1) > typedef struct { > UINT8 Data1; > UINT8 Data2; > } EFI_TLS_CIPHER; > +#pragma pack () >=20 > /// > /// EFI_TLS_COMPRESSION > /// Note: The value of EFI_TLS_COMPRESSION definition is from "RFC 3749"= . > /// > typedef UINT8 EFI_TLS_COMPRESSION; >=20 > /// > /// EFI_TLS_EXTENSION > /// Note: The definition of EFI_TLS_EXTENSION if from "RFC 5246 A.4.1. > /// Hello Messages". > /// > +#pragma pack (1) > typedef struct { > UINT16 ExtensionType; > UINT16 Length; > UINT8 Data[1]; > } EFI_TLS_EXTENSION; > +#pragma pack () >=20 > /// > /// EFI_TLS_VERIFY > /// Use either EFI_TLS_VERIFY_NONE or EFI_TLS_VERIFY_PEER, the last two > options > /// are 'ORed' with EFI_TLS_VERIFY_PEER if they are desired. > /// > @@ -191,35 +195,41 @@ typedef UINT32 EFI_TLS_VERIFY; >=20 > /// > /// EFI_TLS_RANDOM > /// Note: The definition of EFI_TLS_RANDOM is from "RFC 5246 A.4.1. > /// Hello Messages". > /// > +#pragma pack (1) > typedef struct { > UINT32 GmtUnixTime; > UINT8 RandomBytes[28]; > } EFI_TLS_RANDOM; > +#pragma pack () >=20 > /// > /// EFI_TLS_MASTER_SECRET > /// Note: The definition of EFI_TLS_MASTER_SECRET is from "RFC 5246 8.1. > /// Computing the Master Secret". > /// > +#pragma pack (1) > typedef struct { > UINT8 Data[48]; > } EFI_TLS_MASTER_SECRET; > +#pragma pack () >=20 > /// > /// EFI_TLS_SESSION_ID > /// Note: The definition of EFI_TLS_SESSION_ID is from "RFC 5246 A.4.1. > Hello Messages". > /// > #define MAX_TLS_SESSION_ID_LENGTH 32 > +#pragma pack (1) > typedef struct { > UINT16 Length; > UINT8 Data[MAX_TLS_SESSION_ID_LENGTH]; > } EFI_TLS_SESSION_ID; > +#pragma pack () >=20 > /// > /// EFI_TLS_SESSION_STATE > /// > typedef enum { > /// > -- > 2.14.1.3.gb7cf6e02401b >=20