]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg, NetworkPkg: Refine the coding style.
authorJiaxin Wu <jiaxin.wu@intel.com>
Thu, 5 Jan 2017 03:34:07 +0000 (11:34 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Fri, 6 Jan 2017 03:59:26 +0000 (11:59 +0800)
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
MdePkg/Include/IndustryStandard/Tls1.h
NetworkPkg/HttpDxe/HttpProto.c
NetworkPkg/HttpDxe/HttpsSupport.c
NetworkPkg/TlsDxe/TlsImpl.c
NetworkPkg/TlsDxe/TlsProtocol.c

index 14eb2654a50d3cc16506799e580c8dbac5299aef..019ff617de22d14e152a1a004848a3b076927d2c 100644 (file)
@@ -3,7 +3,7 @@
 
   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.<BR>
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
   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
 /// 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;
 
 ///
index 2e784def4c01e7f4f6927f394e644b842c2ea9e6..2e8c42e62999154ed62cd1ff4ce5bca1f5bb15a8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for HttpDxe driver.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -1491,7 +1491,7 @@ HttpTransmitTcp (
       Status = EFI_OUT_OF_RESOURCES;\r
       return Status;\r
     }\r
-    ((TLS_RECORD_HEADER *) Buffer)->ContentType = TLS_CONTENT_TYPE_APPLICATION_DATA;\r
+    ((TLS_RECORD_HEADER *) Buffer)->ContentType = TlsContentTypeApplicationData;\r
     ((TLS_RECORD_HEADER *) Buffer)->Version.Major = HttpInstance->TlsConfigData.Version.Major;\r
     ((TLS_RECORD_HEADER *) Buffer)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor;\r
     ((TLS_RECORD_HEADER *) Buffer)->Length = (UINT16) (TxStringLen);\r
index c9e6988968c1895213e1736706d34d983914b484..77e5371242ef65ed7d6955a8774db48823aadf39 100644 (file)
@@ -1,7 +1,7 @@
 /** @file
   Miscellaneous routines specific to Https for HttpDxe driver.
 
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
@@ -883,10 +883,10 @@ TlsReceiveOnePdu (
   }
 
   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 ||
@@ -1497,7 +1497,7 @@ HttpsReceive (
   //
   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 ||
@@ -1587,7 +1587,7 @@ 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);
@@ -1603,7 +1603,7 @@ HttpsReceive (
     //
     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 ||
index bb71bd8dfddd30f25decb214a8556aae6a0a7844..efdec2d92dd56816b17eb0658f0b457f7f065998 100644 (file)
@@ -1,7 +1,7 @@
 /** @file
   The Miscellaneous Routines for TlsDxe driver.
 
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
@@ -105,7 +105,7 @@ TlsEncryptPacket (
   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;
     }
@@ -256,7 +256,7 @@ TlsDecryptPacket (
   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;
     }
index ee1c496239b10410289482ab36b1f9f813611182..58a83c3ab7d5b182891ed726f714d68e81da501f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file
   Implementation of EFI TLS Protocol Interfaces.
 
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -523,7 +523,7 @@ TlsBuildResponsePacket (
       //
       // 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,