Changeset 80721 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/TlsDxe/TlsProtocol.c
- Timestamp:
- Sep 11, 2019 8:46:37 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-129237 /vendor/edk2/current 103735-103757,103769-103776,129194-133213
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/TlsDxe/TlsProtocol.c
r77662 r80721 4 4 Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR> 5 5 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ … … 39 33 Data is NULL. 40 34 DataSize is 0. 35 DataSize is invalid for DataType. 41 36 @retval EFI_UNSUPPORTED The DataType is unsupported. 42 37 @retval EFI_ACCESS_DENIED If the DataType is one of below: … … 60 55 TLS_INSTANCE *Instance; 61 56 UINT16 *CipherId; 57 CONST EFI_TLS_CIPHER *TlsCipherList; 58 UINTN CipherCount; 62 59 UINTN Index; 63 60 … … 101 98 break; 102 99 case EfiTlsCipherList: 100 if (DataSize % sizeof (EFI_TLS_CIPHER) != 0) { 101 Status = EFI_INVALID_PARAMETER; 102 goto ON_EXIT; 103 } 104 103 105 CipherId = AllocatePool (DataSize); 104 106 if (CipherId == NULL) { … … 107 109 } 108 110 109 for (Index = 0; Index < DataSize / sizeof (EFI_TLS_CIPHER); Index++) { 110 *(CipherId +Index) = HTONS (*(((UINT16 *) Data) + Index)); 111 } 112 113 Status = TlsSetCipherList (Instance->TlsConn, CipherId, DataSize / sizeof (EFI_TLS_CIPHER)); 111 TlsCipherList = (CONST EFI_TLS_CIPHER *) Data; 112 CipherCount = DataSize / sizeof (EFI_TLS_CIPHER); 113 for (Index = 0; Index < CipherCount; Index++) { 114 CipherId[Index] = ((TlsCipherList[Index].Data1 << 8) | 115 TlsCipherList[Index].Data2); 116 } 117 118 Status = TlsSetCipherList (Instance->TlsConn, CipherId, CipherCount); 114 119 115 120 FreePool (CipherId);
Note:
See TracChangeset
for help on using the changeset viewer.