]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/TlsDxe/TlsProtocol.c
PcAtChipsetPkg/ResetSystemLib: Add new API ResetSystem
[mirror_edk2.git] / NetworkPkg / TlsDxe / TlsProtocol.c
index a5f95a09834516e9ca7f90e0726216c3f22c2f25..a7a993fc6fc5fb002f6d34559e1407257a48eebd 100644 (file)
@@ -3,13 +3,7 @@
 \r
   Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -60,6 +54,7 @@ TlsSetSessionData (
   EFI_STATUS                Status;\r
   TLS_INSTANCE              *Instance;\r
   UINT16                    *CipherId;\r
+  CONST EFI_TLS_CIPHER      *TlsCipherList;\r
   UINTN                     CipherCount;\r
   UINTN                     Index;\r
 \r
@@ -113,9 +108,11 @@ TlsSetSessionData (
       goto ON_EXIT;\r
     }\r
 \r
+    TlsCipherList = (CONST EFI_TLS_CIPHER *) Data;\r
     CipherCount = DataSize / sizeof (EFI_TLS_CIPHER);\r
     for (Index = 0; Index < CipherCount; Index++) {\r
-      *(CipherId +Index) = HTONS (*(((UINT16 *) Data) + Index));\r
+      CipherId[Index] = ((TlsCipherList[Index].Data1 << 8) |\r
+                         TlsCipherList[Index].Data2);\r
     }\r
 \r
     Status = TlsSetCipherList (Instance->TlsConn, CipherId, CipherCount);\r