From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 BE9E981789 for ; Wed, 4 Jan 2017 19:51:40 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 04 Jan 2017 19:51:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,319,1477983600"; d="scan'208";a="1090088501" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.99]) by fmsmga001.fm.intel.com with ESMTP; 04 Jan 2017 19:51:39 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Liming Gao , Wu Jiaxin Date: Thu, 5 Jan 2017 11:51:34 +0800 Message-Id: <1483588295-194860-2-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1483588295-194860-1-git-send-email-jiaxin.wu@intel.com> References: <1483588295-194860-1-git-send-email-jiaxin.wu@intel.com> Subject: [Patch 1/2] MdePkg, NetworkPkg: Refine the coding style. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2017 03:51:40 -0000 Cc: Ye Ting Cc: Fu Siyuan Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- MdePkg/Include/IndustryStandard/Tls1.h | 10 +++++----- NetworkPkg/HttpDxe/HttpProto.c | 4 ++-- NetworkPkg/HttpDxe/HttpsSupport.c | 16 ++++++++-------- NetworkPkg/TlsDxe/TlsImpl.c | 6 +++--- NetworkPkg/TlsDxe/TlsProtocol.c | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/Tls1.h b/MdePkg/Include/IndustryStandard/Tls1.h index 14eb265..019ff61 100644 --- a/MdePkg/Include/IndustryStandard/Tls1.h +++ b/MdePkg/Include/IndustryStandard/Tls1.h @@ -1,11 +1,11 @@ /** @file Transport Layer Security -- TLS 1.0/1.1/1.2 Standard definitions, from RFC 2246/4346/5246 This file contains common TLS 1.0/1.1/1.2 definitions from RFC 2246/4346/5246 - Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -70,14 +70,14 @@ /// /// TLS Content Type, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246. /// typedef enum { - TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC = 20, - TLS_CONTENT_TYPE_ALERT = 21, - TLS_CONTENT_TYPE_HANDSHAKE = 22, - TLS_CONTENT_TYPE_APPLICATION_DATA = 23, + TlsContentTypeChangeCipherSpec = 20, + TlsContentTypeAlert = 21, + TlsContentTypeHandshake = 22, + TlsContentTypeApplicationData = 23, } TLS_CONTENT_TYPE; /// /// TLS Record Header, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246. /// diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 2e784de..2e8c42e 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -1,9 +1,9 @@ /** @file Miscellaneous routines for HttpDxe driver. -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -1489,11 +1489,11 @@ HttpTransmitTcp ( Buffer = AllocateZeroPool (BufferSize); if (Buffer == NULL) { Status = EFI_OUT_OF_RESOURCES; return Status; } - ((TLS_RECORD_HEADER *) Buffer)->ContentType = TLS_CONTENT_TYPE_APPLICATION_DATA; + ((TLS_RECORD_HEADER *) Buffer)->ContentType = TlsContentTypeApplicationData; ((TLS_RECORD_HEADER *) Buffer)->Version.Major = HttpInstance->TlsConfigData.Version.Major; ((TLS_RECORD_HEADER *) Buffer)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor; ((TLS_RECORD_HEADER *) Buffer)->Length = (UINT16) (TxStringLen); CopyMem (Buffer + sizeof (TLS_RECORD_HEADER), TxString, TxStringLen); diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c index c9e6988..77e5371 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -1,9 +1,9 @@ /** @file Miscellaneous routines specific to Https for HttpDxe driver. -Copyright (c) 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -881,14 +881,14 @@ TlsReceiveOnePdu ( if (EFI_ERROR (Status)) { goto ON_EXIT; } RecordHeader = *(TLS_RECORD_HEADER *) Header; - if ((RecordHeader.ContentType == TLS_CONTENT_TYPE_HANDSHAKE || - RecordHeader.ContentType == TLS_CONTENT_TYPE_ALERT || - RecordHeader.ContentType == TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC || - RecordHeader.ContentType == TLS_CONTENT_TYPE_APPLICATION_DATA) && + if ((RecordHeader.ContentType == TlsContentTypeHandshake || + RecordHeader.ContentType == TlsContentTypeAlert || + RecordHeader.ContentType == TlsContentTypeChangeCipherSpec || + RecordHeader.ContentType == TlsContentTypeApplicationData) && (RecordHeader.Version.Major == 0x03) && /// Major versions are same. (RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR || RecordHeader.Version.Minor ==TLS11_PROTOCOL_VERSION_MINOR || RecordHeader.Version.Minor == TLS12_PROTOCOL_VERSION_MINOR) ) { @@ -1495,11 +1495,11 @@ HttpsReceive ( // // Handle Receive data. // RecordHeader = *(TLS_RECORD_HEADER *) BufferIn; - if ((RecordHeader.ContentType == TLS_CONTENT_TYPE_APPLICATION_DATA) && + if ((RecordHeader.ContentType == TlsContentTypeApplicationData) && (RecordHeader.Version.Major == 0x03) && (RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR || RecordHeader.Version.Minor == TLS11_PROTOCOL_VERSION_MINOR || RecordHeader.Version.Minor == TLS12_PROTOCOL_VERSION_MINOR) ) { @@ -1585,11 +1585,11 @@ HttpsReceive ( } // // Parsing buffer. // - ASSERT (((TLS_RECORD_HEADER *) (TempFragment.Bulk))->ContentType == TLS_CONTENT_TYPE_APPLICATION_DATA); + ASSERT (((TLS_RECORD_HEADER *) (TempFragment.Bulk))->ContentType == TlsContentTypeApplicationData); BufferInSize = ((TLS_RECORD_HEADER *) (TempFragment.Bulk))->Length; BufferIn = AllocateZeroPool (BufferInSize); if (BufferIn == NULL) { Status = EFI_OUT_OF_RESOURCES; @@ -1601,11 +1601,11 @@ HttpsReceive ( // // Free the buffer in TempFragment. // FreePool (TempFragment.Bulk); - } else if ((RecordHeader.ContentType == TLS_CONTENT_TYPE_ALERT) && + } else if ((RecordHeader.ContentType == TlsContentTypeAlert) && (RecordHeader.Version.Major == 0x03) && (RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR || RecordHeader.Version.Minor == TLS11_PROTOCOL_VERSION_MINOR || RecordHeader.Version.Minor == TLS12_PROTOCOL_VERSION_MINOR) ) { diff --git a/NetworkPkg/TlsDxe/TlsImpl.c b/NetworkPkg/TlsDxe/TlsImpl.c index bb71bd8..efdec2d 100644 --- a/NetworkPkg/TlsDxe/TlsImpl.c +++ b/NetworkPkg/TlsDxe/TlsImpl.c @@ -1,9 +1,9 @@ /** @file The Miscellaneous Routines for TlsDxe driver. -Copyright (c) 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -103,11 +103,11 @@ TlsEncryptPacket ( BufferInPtr = BufferIn; TempRecordHeader = (TLS_RECORD_HEADER *) BufferOut; while ((UINTN) BufferInPtr < (UINTN) BufferIn + BufferInSize) { RecordHeaderIn = (TLS_RECORD_HEADER *) BufferInPtr; - if (RecordHeaderIn->ContentType != TLS_CONTENT_TYPE_APPLICATION_DATA) { + if (RecordHeaderIn->ContentType != TlsContentTypeApplicationData) { Status = EFI_INVALID_PARAMETER; goto ERROR; } ThisPlainMessageSize = RecordHeaderIn->Length; @@ -254,11 +254,11 @@ TlsDecryptPacket ( BufferInPtr = BufferIn; TempRecordHeader = (TLS_RECORD_HEADER *) BufferOut; while ((UINTN) BufferInPtr < (UINTN) BufferIn + BufferInSize) { RecordHeaderIn = (TLS_RECORD_HEADER *) BufferInPtr; - if (RecordHeaderIn->ContentType != TLS_CONTENT_TYPE_APPLICATION_DATA) { + if (RecordHeaderIn->ContentType != TlsContentTypeApplicationData) { Status = EFI_INVALID_PARAMETER; goto ERROR; } ThisCipherMessageSize = NTOHS (RecordHeaderIn->Length); diff --git a/NetworkPkg/TlsDxe/TlsProtocol.c b/NetworkPkg/TlsDxe/TlsProtocol.c index ee1c496..58a83c3 100644 --- a/NetworkPkg/TlsDxe/TlsProtocol.c +++ b/NetworkPkg/TlsDxe/TlsProtocol.c @@ -1,9 +1,9 @@ /** @file Implementation of EFI TLS Protocol Interfaces. - Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. @@ -521,11 +521,11 @@ TlsBuildResponsePacket ( } } else { // // Must be alert message, Decrypt it and build the ResponsePacket. // - ASSERT (((TLS_RECORD_HEADER *) RequestBuffer)->ContentType == TLS_CONTENT_TYPE_ALERT); + ASSERT (((TLS_RECORD_HEADER *) RequestBuffer)->ContentType == TlsContentTypeAlert); Status = TlsHandleAlert ( Instance->TlsConn, RequestBuffer, RequestSize, -- 1.9.5.msysgit.1