VirtualBox

Ignore:
Timestamp:
Aug 12, 2020 4:09:12 PM (4 years ago)
Author:
vboxsync
Message:

Devices/EFI: Merge edk-stable202005 and make it build, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
81 added
10 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/CryptoPkg.dec

    r80721 r85718  
    55#  It also provides a test application to test libraries.
    66#
    7 #  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     7#  Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
    88#  SPDX-License-Identifier: BSD-2-Clause-Patent
    99#
     
    2121
    2222[Includes.Common.Private]
     23  Private
    2324  Library/Include
    2425  Library/OpensslLib/openssl/include
     
    3435  TlsLib|Include/Library/TlsLib.h
    3536
     37  ##  @libraryclass  Provides Unified API for different hash implementations.
     38  #
     39  HashApiLib|Include/Library/HashApiLib.h
     40
     41[Protocols]
     42  ## EDK II Crypto DXE protocol
     43  # 2C2275C9-3A7B-426F-BE54-2D22BD9D1092
     44  gEdkiiCryptoProtocolGuid =  { 0x2C2275C9, 0x3A7B, 0x426F, { 0xBE, 0x54, 0x2D, 0x22, 0xBD, 0x9D, 0x10, 0x92 }}
     45
     46  ## EDK II Crypto SMM protocol
     47  # F46B2EB2-E0D7-4C96-A3B1-CB7C572EB300
     48  gEdkiiSmmCryptoProtocolGuid =  { 0xF46B2EB2, 0xE0D7, 0x4C96, { 0xA3, 0xB1, 0xc, 0x61, 0xbb, 0x24, 0x5c, 0x42 }}
     49
     50[Ppis]
     51  ## EDK II Crypto PPI
     52  # 7DCE671B-C223-446A-A705-ED637AAF6771
     53  gEdkiiCryptoPpiGuid =  { 0x7DCE671B, 0xC223, 0x446A, { 0xA7, 0x05, 0xED, 0x63, 0x7A, 0xAF, 0x67, 0x71 }}
     54
     55[Guids]
     56  ## Crypto package token space guid.
     57  gEfiCryptoPkgTokenSpaceGuid      = { 0x6bd7de60, 0x9ef7, 0x4899, { 0x97, 0xd0, 0xab, 0xff, 0xfd, 0xe9, 0x70, 0xf2 } }
     58
     59[PcdsFixedAtBuild]
     60  ## Enable/Disable the families and individual services produced by the
     61  #  EDK II Crypto Protocols/PPIs.  The default is all services disabled.
     62  #  This Structured PCD is associated with PCD_CRYPTO_SERVICE_FAMILY_ENABLE
     63  #  structure that is defined in Include/Pcd/PcdCryptoServiceFamilyEnable.h.
     64  # @Prompt Enable/Disable EDK II Crypto Protocol/PPI services
     65  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable|{0x00}|PCD_CRYPTO_SERVICE_FAMILY_ENABLE|0x00000002 {
     66    <Packages>
     67      CryptoPkg/CryptoPkg.dec
     68    <HeaderFiles>
     69      Pcd/PcdCryptoServiceFamilyEnable.h
     70  }
     71
     72  ## This PCD indicates the HASH algorithm to calculate hash of data
     73  #  Based on the value set, the required algorithm is chosen to calculate
     74  #  the hash of data.<BR>
     75  #  The default hashing algorithm for BaseHashApiLib is set to SHA256.<BR>
     76  #     0x00000001    - HASH_ALG_SHA1.<BR>
     77  #     0x00000002    - HASH_ALG_SHA256.<BR>
     78  #     0x00000004    - HASH_ALG_SHA384.<BR>
     79  #     0x00000008    - HASH_ALG_SHA512.<BR>
     80  #     0x00000010    - HASH_ALG_SM3_256.<BR>
     81  # @Prompt Set policy for hashing unsigned image for Secure Boot.
     82  # @ValidList 0x80000001 | 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010
     83  gEfiCryptoPkgTokenSpaceGuid.PcdHashApiLibPolicy|0x00000002|UINT32|0x00000001
     84
    3685[UserExtensions.TianoCore."ExtraFiles"]
    3786  CryptoPkgExtra.uni
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/CryptoPkg.dsc

    r80721 r85718  
    11## @file
    22#  Cryptographic Library Package for UEFI Security Implementation.
    3 #
    4 #  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     3#  PEIM, DXE Driver, and SMM Driver with all crypto services enabled.
     4#
     5#  Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
     6#  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
    57#  SPDX-License-Identifier: BSD-2-Clause-Patent
    68#
     
    1820  DSC_SPECIFICATION              = 0x00010005
    1921  OUTPUT_DIRECTORY               = Build/CryptoPkg
    20   SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64
     22  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64|RISCV64
    2123  BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
    2224  SKUID_IDENTIFIER               = DEFAULT
     25
     26  #
     27  # Flavor of PEI, DXE, SMM modules to build.
     28  # Must be one of ALL, NONE, MIN_PEI, MIN_DXE_MIN_SMM.
     29  # Default is ALL that is used for package build verification.
     30  #   PACKAGE         - Package verification build of all components.  Null
     31  #                     versions of libraries are used to minimize build times.
     32  #   ALL             - Build PEIM, DXE, and SMM drivers.  Protocols and PPIs
     33  #                     publish all services.
     34  #   NONE            - Build PEIM, DXE, and SMM drivers.  Protocols and PPIs
     35  #                     publish no services.  Used to verify compiler/linker
     36  #                     optimizations are working correctly.
     37  #   MIN_PEI         - Build PEIM with PPI that publishes minimum required
     38  #                     services.
     39  #   MIN_DXE_MIN_SMM - Build DXE and SMM drivers with Protocols that publish
     40  #                     minimum required services.
     41  #
     42  DEFINE CRYPTO_SERVICES = PACKAGE
     43!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_PEI MIN_DXE_MIN_SMM"
     44!else
     45  !error CRYPTO_SERVICES must be set to one of PACKAGE ALL NONE MIN_PEI MIN_DXE_MIN_SMM.
     46!endif
    2347
    2448################################################################################
     
    3054  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
    3155  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
    32   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
    3356  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
    3457  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
    35   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
    36   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
    37   UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
    38   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
    3958  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
    40   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
    41   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
    4259  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
    43   UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
    44 
    45   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
    46   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
     60  BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
     61  TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
     62  HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
    4763
    4864[LibraryClasses.ARM, LibraryClasses.AARCH64]
     
    5874  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
    5975
     76[LibraryClasses.common.PEIM]
     77  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
     78  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
     79  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
     80  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
     81  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
     82
     83[LibraryClasses.common.DXE_SMM_DRIVER]
     84  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
     85  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
     86
     87!if $(CRYPTO_SERVICES) IN "ALL NONE MIN_PEI MIN_DXE_MIN_SMM"
     88[LibraryClasses]
     89  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
     90  DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
     91  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
     92  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
     93  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
     94  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
     95  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
     96  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
     97  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf  #???
     98  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf                                          #???
     99  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
     100  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
     101  SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
     102
    60103[LibraryClasses.ARM]
    61104  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
    62105
    63106[LibraryClasses.common.PEIM]
     107  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
     108  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
    64109  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
     110  TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
     111
     112[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
     113  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
     114
     115[LibraryClasses.ARM.PEIM, LibraryClasses.AARCH64.PEIM]
     116  PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
    65117
    66118[LibraryClasses.common.DXE_DRIVER]
     119  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
    67120  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
    68 
    69 [LibraryClasses.common.DXE_RUNTIME_DRIVER]
    70   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
     121  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
    71122
    72123[LibraryClasses.common.DXE_SMM_DRIVER]
     124  ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
    73125  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
    74 
    75 [LibraryClasses.common.UEFI_DRIVER]
    76   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
    77 
    78 [LibraryClasses.common.UEFI_APPLICATION]
    79   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
     126  TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
     127!endif
    80128
    81129################################################################################
     
    84132#
    85133################################################################################
    86 [PcdsFeatureFlag]
    87   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
    88   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
    89 
    90134[PcdsFixedAtBuild]
    91135  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
    92136  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
    93137  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
     138
     139!if $(CRYPTO_SERVICES) IN "PACKAGE ALL"
     140  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family                        | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     141  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family                               | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     142  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     143  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family                                | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     144  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     145  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Family                               | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     146  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     147  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     148  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     149  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     150  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     151  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tdes.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     152  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.GetContextSize              | TRUE
     153  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Init                        | TRUE
     154  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcEncrypt                  | TRUE
     155  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcDecrypt                  | TRUE
     156  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Arc4.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     157  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family                               | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     158  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     159  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family                               | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     160  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     161  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     162!endif
     163
     164!if $(CRYPTO_SERVICES) == MIN_PEI
     165  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family               | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     166  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family                     | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     167  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family                   | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     168  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family                   | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     169  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family                   | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     170  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family                      | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     171  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify        | TRUE
     172  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New                | TRUE
     173  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free               | TRUE
     174  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey             | TRUE
     175  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword | TRUE
     176!endif
     177
     178!if $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
     179  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family                        | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     180  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs1v2Encrypt             | TRUE
     181  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs5HashPassword          | TRUE
     182  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs7Verify                | TRUE
     183  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.VerifyEKUsInPkcs7Signature | TRUE
     184  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs7GetSigners            | TRUE
     185  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.Pkcs7FreeSigners           | TRUE
     186  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Services.AuthenticodeVerify         | TRUE
     187  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     188  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify                 | TRUE
     189  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New                         | TRUE
     190  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free                        | TRUE
     191  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey                      | TRUE
     192  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.GetPublicKeyFromX509        | TRUE
     193  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family                              | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     194  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     195  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.HashAll                  | FALSE
     196  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetSubjectName             | TRUE
     197  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetCommonName              | TRUE
     198  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetOrganizationName        | TRUE
     199  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetTBSCert                 | TRUE
     200  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family                               | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     201  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     202  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family                            | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
     203  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Init                        | TRUE
     204  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcEncrypt                  | TRUE
     205  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcDecrypt                  | TRUE
     206!endif
    94207
    95208###################################################################################################
     
    111224#
    112225###################################################################################################
     226!if $(CRYPTO_SERVICES) == PACKAGE
    113227[Components]
    114228  CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
    115229  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
     230  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
    116231  CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
     232  CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
     233  CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
    117234  CryptoPkg/Library/TlsLib/TlsLib.inf
     235  CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
    118236  CryptoPkg/Library/OpensslLib/OpensslLib.inf
    119237  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
     238  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
     239
     240  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
     241  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
     242  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/SmmCryptLib.inf
     243!endif
     244
     245!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_PEI"
     246[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
     247  CryptoPkg/Driver/CryptoPei.inf {
     248    <Defines>
     249      !if $(CRYPTO_SERVICES) == ALL
     250        FILE_GUID = 8DF53C2E-3380-495F-A8B7-370CFE28E1C6
     251      !elseif $(CRYPTO_SERVICES) == NONE
     252        FILE_GUID = E5A97EE3-71CC-407F-9DA9-6BE0C8A6C7DF
     253      !elseif $(CRYPTO_SERVICES) == MIN_PEI
     254        FILE_GUID = 0F5827A9-35FD-4F41-8D38-9BAFCE594D31
     255      !endif
     256  }
     257!endif
     258
     259!if $(CRYPTO_SERVICES) IN "PACKAGE ALL NONE MIN_DXE_MIN_SMM"
     260[Components.IA32, Components.X64, Components.AARCH64]
     261  CryptoPkg/Driver/CryptoDxe.inf {
     262    <Defines>
     263      !if $(CRYPTO_SERVICES) == ALL
     264        FILE_GUID = D9444B06-060D-42C5-9344-F04707BE0169
     265      !elseif $(CRYPTO_SERVICES) == NONE
     266        FILE_GUID = C7A340F4-A6CC-4F95-A2DA-42BEA4C3944A
     267      !elseif $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
     268        FILE_GUID = DDF5BE9E-159A-4B77-B6D7-82B84B5763A2
     269      !endif
     270  }
    120271
    121272[Components.IA32, Components.X64]
    122   CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
     273  CryptoPkg/Driver/CryptoSmm.inf {
     274    <Defines>
     275      !if $(CRYPTO_SERVICES) == ALL
     276        FILE_GUID = A3542CE8-77F7-49DC-A834-45D37D2EC1FA
     277      !elseif $(CRYPTO_SERVICES) == NONE
     278        FILE_GUID = 6DCB3127-01E7-4131-A487-DC77A965A541
     279      !elseif $(CRYPTO_SERVICES) == MIN_DXE_MIN_SMM
     280        FILE_GUID = 85F7EA15-3A2B-474A-8875-180542CD6BF3
     281      !endif
     282  }
     283!endif
    123284
    124285[BuildOptions]
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/CryptoPkg.uni

    r80721 r85718  
    55// It also provides a test application to test libraries.
    66//
    7 // Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     7// Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
    88//
    99// SPDX-License-Identifier: BSD-2-Clause-Patent
     
    1616#string STR_PACKAGE_DESCRIPTION         #language en-US "This Package provides cryptographic-related libraries for UEFI security modules."
    1717
     18#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdHashApiLibPolicy_PROMPT  #language en-US "HASH algorithm to calculate hash"
    1819
     20#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdHashApiLibPolicy_HELP  #language en-US "This PCD indicates the HASH algorithm to calculate hash of data.<BR><BR>\n"
     21                                                                                        "Based on the value set, the required algorithm is chosen to calculate\n"
     22                                                                                        "the hash of data.<BR>\n"
     23                                                                                        "The default hashing algorithm for BaseHashApiLib is set to SHA256.<BR>\n"
     24                                                                                        "0x00000001  -  HASH_ALG_SHA1.<BR>\n"
     25                                                                                        "0x00000002  -  HASH_ALG_SHA256.<BR>\n"
     26                                                                                        "0x00000004  -  HASH_ALG_SHA384.<BR>\n"
     27                                                                                        "0x00000008  -  HASH_ALG_SHA512.<BR>\n"
     28                                                                                        "0x00000010  -  HASH_ALG_SM3.<BR>"
    1929
     30#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdCryptoServiceFamilyEnable_PROMPT  #language en-US "Enable/Disable EDK II Crypto Protocol/PPI services"
     31
     32#string STR_gEfiCryptoPkgTokenSpaceGuid_PcdCryptoServiceFamilyEnable_HELP  #language en-US "Enable/Disable the families and individual services produced by the EDK II Crypto Protocols/PPIs.  The default is all services disabled.  This Structured PCD is associated with PCD_CRYPTO_SERVICE_FAMILY_ENABLE structure that is defined in Include/Pcd/PcdCryptoServiceFamilyEnable.h."
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Include/Library/BaseCryptLib.h

    r80721 r85718  
    55  functionality enabling.
    66
    7 Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
     7Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
    88SPDX-License-Identifier: BSD-2-Clause-Patent
    99
     
    1414
    1515#include <Uefi/UefiBaseType.h>
    16 
    17 ///
    18 /// MD4 digest size in bytes
    19 ///
    20 #define MD4_DIGEST_SIZE     16
    2116
    2217///
     
    7974
    8075/**
    81   Retrieves the size, in bytes, of the context buffer required for MD4 hash operations.
    82 
    83   If this interface is not supported, then return zero.
    84 
    85   @return  The size, in bytes, of the context buffer required for MD4 hash operations.
    86   @retval  0   This interface is not supported.
    87 
    88 **/
    89 UINTN
    90 EFIAPI
    91 Md4GetContextSize (
    92   VOID
    93   );
    94 
    95 /**
    96   Initializes user-supplied memory pointed by Md4Context as MD4 hash context for
    97   subsequent use.
    98 
    99   If Md4Context is NULL, then return FALSE.
    100   If this interface is not supported, then return FALSE.
    101 
    102   @param[out]  Md4Context  Pointer to MD4 context being initialized.
    103 
    104   @retval TRUE   MD4 context initialization succeeded.
    105   @retval FALSE  MD4 context initialization failed.
    106   @retval FALSE  This interface is not supported.
    107 
    108 **/
    109 BOOLEAN
    110 EFIAPI
    111 Md4Init (
    112   OUT  VOID  *Md4Context
    113   );
    114 
    115 /**
    116   Makes a copy of an existing MD4 context.
    117 
    118   If Md4Context is NULL, then return FALSE.
    119   If NewMd4Context is NULL, then return FALSE.
    120   If this interface is not supported, then return FALSE.
    121 
    122   @param[in]  Md4Context     Pointer to MD4 context being copied.
    123   @param[out] NewMd4Context  Pointer to new MD4 context.
    124 
    125   @retval TRUE   MD4 context copy succeeded.
    126   @retval FALSE  MD4 context copy failed.
    127   @retval FALSE  This interface is not supported.
    128 
    129 **/
    130 BOOLEAN
    131 EFIAPI
    132 Md4Duplicate (
    133   IN   CONST VOID  *Md4Context,
    134   OUT  VOID        *NewMd4Context
    135   );
    136 
    137 /**
    138   Digests the input data and updates MD4 context.
    139 
    140   This function performs MD4 digest on a data buffer of the specified size.
    141   It can be called multiple times to compute the digest of long or discontinuous data streams.
    142   MD4 context should be already correctly initialized by Md4Init(), and should not be finalized
    143   by Md4Final(). Behavior with invalid context is undefined.
    144 
    145   If Md4Context is NULL, then return FALSE.
    146   If this interface is not supported, then return FALSE.
    147 
    148   @param[in, out]  Md4Context  Pointer to the MD4 context.
    149   @param[in]       Data        Pointer to the buffer containing the data to be hashed.
    150   @param[in]       DataSize    Size of Data buffer in bytes.
    151 
    152   @retval TRUE   MD4 data digest succeeded.
    153   @retval FALSE  MD4 data digest failed.
    154   @retval FALSE  This interface is not supported.
    155 
    156 **/
    157 BOOLEAN
    158 EFIAPI
    159 Md4Update (
    160   IN OUT  VOID        *Md4Context,
    161   IN      CONST VOID  *Data,
    162   IN      UINTN       DataSize
    163   );
    164 
    165 /**
    166   Completes computation of the MD4 digest value.
    167 
    168   This function completes MD4 hash computation and retrieves the digest value into
    169   the specified memory. After this function has been called, the MD4 context cannot
    170   be used again.
    171   MD4 context should be already correctly initialized by Md4Init(), and should not be
    172   finalized by Md4Final(). Behavior with invalid MD4 context is undefined.
    173 
    174   If Md4Context is NULL, then return FALSE.
    175   If HashValue is NULL, then return FALSE.
    176   If this interface is not supported, then return FALSE.
    177 
    178   @param[in, out]  Md4Context  Pointer to the MD4 context.
    179   @param[out]      HashValue   Pointer to a buffer that receives the MD4 digest
    180                                value (16 bytes).
    181 
    182   @retval TRUE   MD4 digest computation succeeded.
    183   @retval FALSE  MD4 digest computation failed.
    184   @retval FALSE  This interface is not supported.
    185 
    186 **/
    187 BOOLEAN
    188 EFIAPI
    189 Md4Final (
    190   IN OUT  VOID   *Md4Context,
    191   OUT     UINT8  *HashValue
    192   );
    193 
    194 /**
    195   Computes the MD4 message digest of a input data buffer.
    196 
    197   This function performs the MD4 message digest of a given data buffer, and places
    198   the digest value into the specified memory.
    199 
    200   If this interface is not supported, then return FALSE.
    201 
    202   @param[in]   Data        Pointer to the buffer containing the data to be hashed.
    203   @param[in]   DataSize    Size of Data buffer in bytes.
    204   @param[out]  HashValue   Pointer to a buffer that receives the MD4 digest
    205                            value (16 bytes).
    206 
    207   @retval TRUE   MD4 digest computation succeeded.
    208   @retval FALSE  MD4 digest computation failed.
    209   @retval FALSE  This interface is not supported.
    210 
    211 **/
    212 BOOLEAN
    213 EFIAPI
    214 Md4HashAll (
    215   IN   CONST VOID  *Data,
    216   IN   UINTN       DataSize,
    217   OUT  UINT8       *HashValue
    218   );
    219 
    220 /**
    22176  Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.
    22277
     
    1027882
    1028883/**
    1029   Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
    1030   (NOTE: This API is deprecated.
    1031          Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
    1032 
    1033   If this interface is not supported, then return zero.
    1034 
    1035   @return  The size, in bytes, of the context buffer required for HMAC-MD5 operations.
    1036   @retval  0   This interface is not supported.
    1037 
    1038 **/
    1039 UINTN
    1040 EFIAPI
    1041 HmacMd5GetContextSize (
    1042   VOID
    1043   );
    1044 
    1045 /**
    1046   Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
    1047 
    1048   If this interface is not supported, then return NULL.
    1049 
    1050   @return  Pointer to the HMAC_CTX context that has been initialized.
    1051            If the allocations fails, HmacMd5New() returns NULL.
    1052   @retval  NULL  This interface is not supported.
    1053 
    1054 **/
    1055 VOID *
    1056 EFIAPI
    1057 HmacMd5New (
    1058   VOID
    1059   );
    1060 
    1061 /**
    1062   Release the specified HMAC_CTX context.
    1063 
    1064   If this interface is not supported, then do nothing.
    1065 
    1066   @param[in]  HmacMd5Ctx  Pointer to the HMAC_CTX context to be released.
    1067 
    1068 **/
    1069 VOID
    1070 EFIAPI
    1071 HmacMd5Free (
    1072   IN  VOID  *HmacMd5Ctx
    1073   );
    1074 
    1075 /**
    1076   Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
    1077   subsequent use.
    1078 
    1079   If HmacMd5Context is NULL, then return FALSE.
    1080   If this interface is not supported, then return FALSE.
    1081 
    1082   @param[out]  HmacMd5Context  Pointer to HMAC-MD5 context being initialized.
    1083   @param[in]   Key             Pointer to the user-supplied key.
    1084   @param[in]   KeySize         Key size in bytes.
    1085 
    1086   @retval TRUE   HMAC-MD5 context initialization succeeded.
    1087   @retval FALSE  HMAC-MD5 context initialization failed.
    1088   @retval FALSE  This interface is not supported.
    1089 
    1090 **/
    1091 BOOLEAN
    1092 EFIAPI
    1093 HmacMd5Init (
    1094   OUT  VOID         *HmacMd5Context,
    1095   IN   CONST UINT8  *Key,
    1096   IN   UINTN        KeySize
    1097   );
    1098 
    1099 /**
    1100   Makes a copy of an existing HMAC-MD5 context.
    1101 
    1102   If HmacMd5Context is NULL, then return FALSE.
    1103   If NewHmacMd5Context is NULL, then return FALSE.
    1104   If this interface is not supported, then return FALSE.
    1105 
    1106   @param[in]  HmacMd5Context     Pointer to HMAC-MD5 context being copied.
    1107   @param[out] NewHmacMd5Context  Pointer to new HMAC-MD5 context.
    1108 
    1109   @retval TRUE   HMAC-MD5 context copy succeeded.
    1110   @retval FALSE  HMAC-MD5 context copy failed.
    1111   @retval FALSE  This interface is not supported.
    1112 
    1113 **/
    1114 BOOLEAN
    1115 EFIAPI
    1116 HmacMd5Duplicate (
    1117   IN   CONST VOID  *HmacMd5Context,
    1118   OUT  VOID        *NewHmacMd5Context
    1119   );
    1120 
    1121 /**
    1122   Digests the input data and updates HMAC-MD5 context.
    1123 
    1124   This function performs HMAC-MD5 digest on a data buffer of the specified size.
    1125   It can be called multiple times to compute the digest of long or discontinuous data streams.
    1126   HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
    1127   finalized by HmacMd5Final(). Behavior with invalid context is undefined.
    1128 
    1129   If HmacMd5Context is NULL, then return FALSE.
    1130   If this interface is not supported, then return FALSE.
    1131 
    1132   @param[in, out]  HmacMd5Context  Pointer to the HMAC-MD5 context.
    1133   @param[in]       Data            Pointer to the buffer containing the data to be digested.
    1134   @param[in]       DataSize        Size of Data buffer in bytes.
    1135 
    1136   @retval TRUE   HMAC-MD5 data digest succeeded.
    1137   @retval FALSE  HMAC-MD5 data digest failed.
    1138   @retval FALSE  This interface is not supported.
    1139 
    1140 **/
    1141 BOOLEAN
    1142 EFIAPI
    1143 HmacMd5Update (
    1144   IN OUT  VOID        *HmacMd5Context,
    1145   IN      CONST VOID  *Data,
    1146   IN      UINTN       DataSize
    1147   );
    1148 
    1149 /**
    1150   Completes computation of the HMAC-MD5 digest value.
    1151 
    1152   This function completes HMAC-MD5 hash computation and retrieves the digest value into
    1153   the specified memory. After this function has been called, the HMAC-MD5 context cannot
    1154   be used again.
    1155   HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
    1156   finalized by HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
    1157 
    1158   If HmacMd5Context is NULL, then return FALSE.
    1159   If HmacValue is NULL, then return FALSE.
    1160   If this interface is not supported, then return FALSE.
    1161 
    1162   @param[in, out]  HmacMd5Context  Pointer to the HMAC-MD5 context.
    1163   @param[out]      HmacValue       Pointer to a buffer that receives the HMAC-MD5 digest
    1164                                    value (16 bytes).
    1165 
    1166   @retval TRUE   HMAC-MD5 digest computation succeeded.
    1167   @retval FALSE  HMAC-MD5 digest computation failed.
    1168   @retval FALSE  This interface is not supported.
    1169 
    1170 **/
    1171 BOOLEAN
    1172 EFIAPI
    1173 HmacMd5Final (
    1174   IN OUT  VOID   *HmacMd5Context,
    1175   OUT     UINT8  *HmacValue
    1176   );
    1177 
    1178 /**
    1179   Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
    1180   (NOTE: This API is deprecated.
    1181          Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
    1182 
    1183   If this interface is not supported, then return zero.
    1184 
    1185   @return  The size, in bytes, of the context buffer required for HMAC-SHA1 operations.
    1186   @retval  0   This interface is not supported.
    1187 
    1188 **/
    1189 UINTN
    1190 EFIAPI
    1191 HmacSha1GetContextSize (
    1192   VOID
    1193   );
    1194 
    1195 /**
    1196   Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
    1197 
    1198   If this interface is not supported, then return NULL.
    1199 
    1200   @return  Pointer to the HMAC_CTX context that has been initialized.
    1201            If the allocations fails, HmacSha1New() returns NULL.
    1202   @return  NULL   This interface is not supported.
    1203 
    1204 **/
    1205 VOID *
    1206 EFIAPI
    1207 HmacSha1New (
    1208   VOID
    1209   );
    1210 
    1211 /**
    1212   Release the specified HMAC_CTX context.
    1213 
    1214   If this interface is not supported, then do nothing.
    1215 
    1216   @param[in]  HmacSha1Ctx  Pointer to the HMAC_CTX context to be released.
    1217 
    1218 **/
    1219 VOID
    1220 EFIAPI
    1221 HmacSha1Free (
    1222   IN  VOID  *HmacSha1Ctx
    1223   );
    1224 
    1225 /**
    1226   Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
    1227   subsequent use.
    1228 
    1229   If HmacSha1Context is NULL, then return FALSE.
    1230   If this interface is not supported, then return FALSE.
    1231 
    1232   @param[out]  HmacSha1Context  Pointer to HMAC-SHA1 context being initialized.
    1233   @param[in]   Key              Pointer to the user-supplied key.
    1234   @param[in]   KeySize          Key size in bytes.
    1235 
    1236   @retval TRUE   HMAC-SHA1 context initialization succeeded.
    1237   @retval FALSE  HMAC-SHA1 context initialization failed.
    1238   @retval FALSE  This interface is not supported.
    1239 
    1240 **/
    1241 BOOLEAN
    1242 EFIAPI
    1243 HmacSha1Init (
    1244   OUT  VOID         *HmacSha1Context,
    1245   IN   CONST UINT8  *Key,
    1246   IN   UINTN        KeySize
    1247   );
    1248 
    1249 /**
    1250   Makes a copy of an existing HMAC-SHA1 context.
    1251 
    1252   If HmacSha1Context is NULL, then return FALSE.
    1253   If NewHmacSha1Context is NULL, then return FALSE.
    1254   If this interface is not supported, then return FALSE.
    1255 
    1256   @param[in]  HmacSha1Context     Pointer to HMAC-SHA1 context being copied.
    1257   @param[out] NewHmacSha1Context  Pointer to new HMAC-SHA1 context.
    1258 
    1259   @retval TRUE   HMAC-SHA1 context copy succeeded.
    1260   @retval FALSE  HMAC-SHA1 context copy failed.
    1261   @retval FALSE  This interface is not supported.
    1262 
    1263 **/
    1264 BOOLEAN
    1265 EFIAPI
    1266 HmacSha1Duplicate (
    1267   IN   CONST VOID  *HmacSha1Context,
    1268   OUT  VOID        *NewHmacSha1Context
    1269   );
    1270 
    1271 /**
    1272   Digests the input data and updates HMAC-SHA1 context.
    1273 
    1274   This function performs HMAC-SHA1 digest on a data buffer of the specified size.
    1275   It can be called multiple times to compute the digest of long or discontinuous data streams.
    1276   HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not
    1277   be finalized by HmacSha1Final(). Behavior with invalid context is undefined.
    1278 
    1279   If HmacSha1Context is NULL, then return FALSE.
    1280   If this interface is not supported, then return FALSE.
    1281 
    1282   @param[in, out]  HmacSha1Context Pointer to the HMAC-SHA1 context.
    1283   @param[in]       Data            Pointer to the buffer containing the data to be digested.
    1284   @param[in]       DataSize        Size of Data buffer in bytes.
    1285 
    1286   @retval TRUE   HMAC-SHA1 data digest succeeded.
    1287   @retval FALSE  HMAC-SHA1 data digest failed.
    1288   @retval FALSE  This interface is not supported.
    1289 
    1290 **/
    1291 BOOLEAN
    1292 EFIAPI
    1293 HmacSha1Update (
    1294   IN OUT  VOID        *HmacSha1Context,
    1295   IN      CONST VOID  *Data,
    1296   IN      UINTN       DataSize
    1297   );
    1298 
    1299 /**
    1300   Completes computation of the HMAC-SHA1 digest value.
    1301 
    1302   This function completes HMAC-SHA1 hash computation and retrieves the digest value into
    1303   the specified memory. After this function has been called, the HMAC-SHA1 context cannot
    1304   be used again.
    1305   HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should
    1306   not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
    1307 
    1308   If HmacSha1Context is NULL, then return FALSE.
    1309   If HmacValue is NULL, then return FALSE.
    1310   If this interface is not supported, then return FALSE.
    1311 
    1312   @param[in, out]  HmacSha1Context  Pointer to the HMAC-SHA1 context.
    1313   @param[out]      HmacValue        Pointer to a buffer that receives the HMAC-SHA1 digest
    1314                                     value (20 bytes).
    1315 
    1316   @retval TRUE   HMAC-SHA1 digest computation succeeded.
    1317   @retval FALSE  HMAC-SHA1 digest computation failed.
    1318   @retval FALSE  This interface is not supported.
    1319 
    1320 **/
    1321 BOOLEAN
    1322 EFIAPI
    1323 HmacSha1Final (
    1324   IN OUT  VOID   *HmacSha1Context,
    1325   OUT     UINT8  *HmacValue
    1326   );
    1327 
    1328 /**
    1329   Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
    1330   (NOTE: This API is deprecated.
    1331          Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
    1332 
    1333   If this interface is not supported, then return zero.
    1334 
    1335   @return  The size, in bytes, of the context buffer required for HMAC-SHA256 operations.
    1336   @retval  0   This interface is not supported.
    1337 
    1338 **/
    1339 UINTN
    1340 EFIAPI
    1341 HmacSha256GetContextSize (
    1342   VOID
    1343   );
    1344 
    1345 /**
    1346884  Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
    1347885
     
    1369907
    1370908/**
    1371   Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
    1372   subsequent use.
     909  Set user-supplied key for subsequent use. It must be done before any
     910  calling to HmacSha256Update().
    1373911
    1374912  If HmacSha256Context is NULL, then return FALSE.
    1375913  If this interface is not supported, then return FALSE.
    1376914
    1377   @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context being initialized.
     915  @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context.
    1378916  @param[in]   Key                Pointer to the user-supplied key.
    1379917  @param[in]   KeySize            Key size in bytes.
    1380918
    1381   @retval TRUE   HMAC-SHA256 context initialization succeeded.
    1382   @retval FALSE  HMAC-SHA256 context initialization failed.
    1383   @retval FALSE  This interface is not supported.
    1384 
    1385 **/
    1386 BOOLEAN
    1387 EFIAPI
    1388 HmacSha256Init (
     919  @retval TRUE   The Key is set successfully.
     920  @retval FALSE  The Key is set unsuccessfully.
     921  @retval FALSE  This interface is not supported.
     922
     923**/
     924BOOLEAN
     925EFIAPI
     926HmacSha256SetKey (
    1389927  OUT  VOID         *HmacSha256Context,
    1390928  IN   CONST UINT8  *Key,
     
    1419957  This function performs HMAC-SHA256 digest on a data buffer of the specified size.
    1420958  It can be called multiple times to compute the digest of long or discontinuous data streams.
    1421   HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not
    1422   be finalized by HmacSha256Final(). Behavior with invalid context is undefined.
     959  HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
     960  by HmacSha256Final(). Behavior with invalid context is undefined.
    1423961
    1424962  If HmacSha256Context is NULL, then return FALSE.
     
    1448986  the specified memory. After this function has been called, the HMAC-SHA256 context cannot
    1449987  be used again.
    1450   HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should
    1451   not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
     988  HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
     989  by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
    1452990
    1453991  If HmacSha256Context is NULL, then return FALSE.
     
    14741012//    Symmetric Cryptography Primitive
    14751013//=====================================================================================
    1476 
    1477 /**
    1478   Retrieves the size, in bytes, of the context buffer required for TDES operations.
    1479 
    1480   If this interface is not supported, then return zero.
    1481 
    1482   @return  The size, in bytes, of the context buffer required for TDES operations.
    1483   @retval  0   This interface is not supported.
    1484 
    1485 **/
    1486 UINTN
    1487 EFIAPI
    1488 TdesGetContextSize (
    1489   VOID
    1490   );
    1491 
    1492 /**
    1493   Initializes user-supplied memory as TDES context for subsequent use.
    1494 
    1495   This function initializes user-supplied memory pointed by TdesContext as TDES context.
    1496   In addition, it sets up all TDES key materials for subsequent encryption and decryption
    1497   operations.
    1498   There are 3 key options as follows:
    1499   KeyLength = 64,  Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)
    1500   KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)
    1501   KeyLength = 192  Keying option 3: K1 != K2 != K3 (Strongest)
    1502 
    1503   If TdesContext is NULL, then return FALSE.
    1504   If Key is NULL, then return FALSE.
    1505   If KeyLength is not valid, then return FALSE.
    1506   If this interface is not supported, then return FALSE.
    1507 
    1508   @param[out]  TdesContext  Pointer to TDES context being initialized.
    1509   @param[in]   Key          Pointer to the user-supplied TDES key.
    1510   @param[in]   KeyLength    Length of TDES key in bits.
    1511 
    1512   @retval TRUE   TDES context initialization succeeded.
    1513   @retval FALSE  TDES context initialization failed.
    1514   @retval FALSE  This interface is not supported.
    1515 
    1516 **/
    1517 BOOLEAN
    1518 EFIAPI
    1519 TdesInit (
    1520   OUT  VOID         *TdesContext,
    1521   IN   CONST UINT8  *Key,
    1522   IN   UINTN        KeyLength
    1523   );
    1524 
    1525 /**
    1526   Performs TDES encryption on a data buffer of the specified size in ECB mode.
    1527 
    1528   This function performs TDES encryption on data buffer pointed by Input, of specified
    1529   size of InputSize, in ECB mode.
    1530   InputSize must be multiple of block size (8 bytes). This function does not perform
    1531   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    1532   TdesContext should be already correctly initialized by TdesInit(). Behavior with
    1533   invalid TDES context is undefined.
    1534 
    1535   If TdesContext is NULL, then return FALSE.
    1536   If Input is NULL, then return FALSE.
    1537   If InputSize is not multiple of block size (8 bytes), then return FALSE.
    1538   If Output is NULL, then return FALSE.
    1539   If this interface is not supported, then return FALSE.
    1540 
    1541   @param[in]   TdesContext  Pointer to the TDES context.
    1542   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.
    1543   @param[in]   InputSize    Size of the Input buffer in bytes.
    1544   @param[out]  Output       Pointer to a buffer that receives the TDES encryption output.
    1545 
    1546   @retval TRUE   TDES encryption succeeded.
    1547   @retval FALSE  TDES encryption failed.
    1548   @retval FALSE  This interface is not supported.
    1549 
    1550 **/
    1551 BOOLEAN
    1552 EFIAPI
    1553 TdesEcbEncrypt (
    1554   IN   VOID         *TdesContext,
    1555   IN   CONST UINT8  *Input,
    1556   IN   UINTN        InputSize,
    1557   OUT  UINT8        *Output
    1558   );
    1559 
    1560 /**
    1561   Performs TDES decryption on a data buffer of the specified size in ECB mode.
    1562 
    1563   This function performs TDES decryption on data buffer pointed by Input, of specified
    1564   size of InputSize, in ECB mode.
    1565   InputSize must be multiple of block size (8 bytes). This function does not perform
    1566   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    1567   TdesContext should be already correctly initialized by TdesInit(). Behavior with
    1568   invalid TDES context is undefined.
    1569 
    1570   If TdesContext is NULL, then return FALSE.
    1571   If Input is NULL, then return FALSE.
    1572   If InputSize is not multiple of block size (8 bytes), then return FALSE.
    1573   If Output is NULL, then return FALSE.
    1574   If this interface is not supported, then return FALSE.
    1575 
    1576   @param[in]   TdesContext  Pointer to the TDES context.
    1577   @param[in]   Input        Pointer to the buffer containing the data to be decrypted.
    1578   @param[in]   InputSize    Size of the Input buffer in bytes.
    1579   @param[out]  Output       Pointer to a buffer that receives the TDES decryption output.
    1580 
    1581   @retval TRUE   TDES decryption succeeded.
    1582   @retval FALSE  TDES decryption failed.
    1583   @retval FALSE  This interface is not supported.
    1584 
    1585 **/
    1586 BOOLEAN
    1587 EFIAPI
    1588 TdesEcbDecrypt (
    1589   IN   VOID         *TdesContext,
    1590   IN   CONST UINT8  *Input,
    1591   IN   UINTN        InputSize,
    1592   OUT  UINT8        *Output
    1593   );
    1594 
    1595 /**
    1596   Performs TDES encryption on a data buffer of the specified size in CBC mode.
    1597 
    1598   This function performs TDES encryption on data buffer pointed by Input, of specified
    1599   size of InputSize, in CBC mode.
    1600   InputSize must be multiple of block size (8 bytes). This function does not perform
    1601   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    1602   Initialization vector should be one block size (8 bytes).
    1603   TdesContext should be already correctly initialized by TdesInit(). Behavior with
    1604   invalid TDES context is undefined.
    1605 
    1606   If TdesContext is NULL, then return FALSE.
    1607   If Input is NULL, then return FALSE.
    1608   If InputSize is not multiple of block size (8 bytes), then return FALSE.
    1609   If Ivec is NULL, then return FALSE.
    1610   If Output is NULL, then return FALSE.
    1611   If this interface is not supported, then return FALSE.
    1612 
    1613   @param[in]   TdesContext  Pointer to the TDES context.
    1614   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.
    1615   @param[in]   InputSize    Size of the Input buffer in bytes.
    1616   @param[in]   Ivec         Pointer to initialization vector.
    1617   @param[out]  Output       Pointer to a buffer that receives the TDES encryption output.
    1618 
    1619   @retval TRUE   TDES encryption succeeded.
    1620   @retval FALSE  TDES encryption failed.
    1621   @retval FALSE  This interface is not supported.
    1622 
    1623 **/
    1624 BOOLEAN
    1625 EFIAPI
    1626 TdesCbcEncrypt (
    1627   IN   VOID         *TdesContext,
    1628   IN   CONST UINT8  *Input,
    1629   IN   UINTN        InputSize,
    1630   IN   CONST UINT8  *Ivec,
    1631   OUT  UINT8        *Output
    1632   );
    1633 
    1634 /**
    1635   Performs TDES decryption on a data buffer of the specified size in CBC mode.
    1636 
    1637   This function performs TDES decryption on data buffer pointed by Input, of specified
    1638   size of InputSize, in CBC mode.
    1639   InputSize must be multiple of block size (8 bytes). This function does not perform
    1640   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    1641   Initialization vector should be one block size (8 bytes).
    1642   TdesContext should be already correctly initialized by TdesInit(). Behavior with
    1643   invalid TDES context is undefined.
    1644 
    1645   If TdesContext is NULL, then return FALSE.
    1646   If Input is NULL, then return FALSE.
    1647   If InputSize is not multiple of block size (8 bytes), then return FALSE.
    1648   If Ivec is NULL, then return FALSE.
    1649   If Output is NULL, then return FALSE.
    1650   If this interface is not supported, then return FALSE.
    1651 
    1652   @param[in]   TdesContext  Pointer to the TDES context.
    1653   @param[in]   Input        Pointer to the buffer containing the data to be encrypted.
    1654   @param[in]   InputSize    Size of the Input buffer in bytes.
    1655   @param[in]   Ivec         Pointer to initialization vector.
    1656   @param[out]  Output       Pointer to a buffer that receives the TDES encryption output.
    1657 
    1658   @retval TRUE   TDES decryption succeeded.
    1659   @retval FALSE  TDES decryption failed.
    1660   @retval FALSE  This interface is not supported.
    1661 
    1662 **/
    1663 BOOLEAN
    1664 EFIAPI
    1665 TdesCbcDecrypt (
    1666   IN   VOID         *TdesContext,
    1667   IN   CONST UINT8  *Input,
    1668   IN   UINTN        InputSize,
    1669   IN   CONST UINT8  *Ivec,
    1670   OUT  UINT8        *Output
    1671   );
    16721014
    16731015/**
     
    17141056  IN   CONST UINT8  *Key,
    17151057  IN   UINTN        KeyLength
    1716   );
    1717 
    1718 /**
    1719   Performs AES encryption on a data buffer of the specified size in ECB mode.
    1720 
    1721   This function performs AES encryption on data buffer pointed by Input, of specified
    1722   size of InputSize, in ECB mode.
    1723   InputSize must be multiple of block size (16 bytes). This function does not perform
    1724   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    1725   AesContext should be already correctly initialized by AesInit(). Behavior with
    1726   invalid AES context is undefined.
    1727 
    1728   If AesContext is NULL, then return FALSE.
    1729   If Input is NULL, then return FALSE.
    1730   If InputSize is not multiple of block size (16 bytes), then return FALSE.
    1731   If Output is NULL, then return FALSE.
    1732   If this interface is not supported, then return FALSE.
    1733 
    1734   @param[in]   AesContext  Pointer to the AES context.
    1735   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.
    1736   @param[in]   InputSize   Size of the Input buffer in bytes.
    1737   @param[out]  Output      Pointer to a buffer that receives the AES encryption output.
    1738 
    1739   @retval TRUE   AES encryption succeeded.
    1740   @retval FALSE  AES encryption failed.
    1741   @retval FALSE  This interface is not supported.
    1742 
    1743 **/
    1744 BOOLEAN
    1745 EFIAPI
    1746 AesEcbEncrypt (
    1747   IN   VOID         *AesContext,
    1748   IN   CONST UINT8  *Input,
    1749   IN   UINTN        InputSize,
    1750   OUT  UINT8        *Output
    1751   );
    1752 
    1753 /**
    1754   Performs AES decryption on a data buffer of the specified size in ECB mode.
    1755 
    1756   This function performs AES decryption on data buffer pointed by Input, of specified
    1757   size of InputSize, in ECB mode.
    1758   InputSize must be multiple of block size (16 bytes). This function does not perform
    1759   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    1760   AesContext should be already correctly initialized by AesInit(). Behavior with
    1761   invalid AES context is undefined.
    1762 
    1763   If AesContext is NULL, then return FALSE.
    1764   If Input is NULL, then return FALSE.
    1765   If InputSize is not multiple of block size (16 bytes), then return FALSE.
    1766   If Output is NULL, then return FALSE.
    1767   If this interface is not supported, then return FALSE.
    1768 
    1769   @param[in]   AesContext  Pointer to the AES context.
    1770   @param[in]   Input       Pointer to the buffer containing the data to be decrypted.
    1771   @param[in]   InputSize   Size of the Input buffer in bytes.
    1772   @param[out]  Output      Pointer to a buffer that receives the AES decryption output.
    1773 
    1774   @retval TRUE   AES decryption succeeded.
    1775   @retval FALSE  AES decryption failed.
    1776   @retval FALSE  This interface is not supported.
    1777 
    1778 **/
    1779 BOOLEAN
    1780 EFIAPI
    1781 AesEcbDecrypt (
    1782   IN   VOID         *AesContext,
    1783   IN   CONST UINT8  *Input,
    1784   IN   UINTN        InputSize,
    1785   OUT  UINT8        *Output
    17861058  );
    17871059
     
    18621134  IN   CONST UINT8  *Ivec,
    18631135  OUT  UINT8        *Output
    1864   );
    1865 
    1866 /**
    1867   Retrieves the size, in bytes, of the context buffer required for ARC4 operations.
    1868 
    1869   If this interface is not supported, then return zero.
    1870 
    1871   @return  The size, in bytes, of the context buffer required for ARC4 operations.
    1872   @retval  0   This interface is not supported.
    1873 
    1874 **/
    1875 UINTN
    1876 EFIAPI
    1877 Arc4GetContextSize (
    1878   VOID
    1879   );
    1880 
    1881 /**
    1882   Initializes user-supplied memory as ARC4 context for subsequent use.
    1883 
    1884   This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.
    1885   In addition, it sets up all ARC4 key materials for subsequent encryption and decryption
    1886   operations.
    1887 
    1888   If Arc4Context is NULL, then return FALSE.
    1889   If Key is NULL, then return FALSE.
    1890   If KeySize does not in the range of [5, 256] bytes, then return FALSE.
    1891   If this interface is not supported, then return FALSE.
    1892 
    1893   @param[out]  Arc4Context  Pointer to ARC4 context being initialized.
    1894   @param[in]   Key          Pointer to the user-supplied ARC4 key.
    1895   @param[in]   KeySize      Size of ARC4 key in bytes.
    1896 
    1897   @retval TRUE   ARC4 context initialization succeeded.
    1898   @retval FALSE  ARC4 context initialization failed.
    1899   @retval FALSE  This interface is not supported.
    1900 
    1901 **/
    1902 BOOLEAN
    1903 EFIAPI
    1904 Arc4Init (
    1905   OUT  VOID         *Arc4Context,
    1906   IN   CONST UINT8  *Key,
    1907   IN   UINTN        KeySize
    1908   );
    1909 
    1910 /**
    1911   Performs ARC4 encryption on a data buffer of the specified size.
    1912 
    1913   This function performs ARC4 encryption on data buffer pointed by Input, of specified
    1914   size of InputSize.
    1915   Arc4Context should be already correctly initialized by Arc4Init(). Behavior with
    1916   invalid ARC4 context is undefined.
    1917 
    1918   If Arc4Context is NULL, then return FALSE.
    1919   If Input is NULL, then return FALSE.
    1920   If Output is NULL, then return FALSE.
    1921   If this interface is not supported, then return FALSE.
    1922 
    1923   @param[in, out]  Arc4Context  Pointer to the ARC4 context.
    1924   @param[in]       Input        Pointer to the buffer containing the data to be encrypted.
    1925   @param[in]       InputSize    Size of the Input buffer in bytes.
    1926   @param[out]      Output       Pointer to a buffer that receives the ARC4 encryption output.
    1927 
    1928   @retval TRUE   ARC4 encryption succeeded.
    1929   @retval FALSE  ARC4 encryption failed.
    1930   @retval FALSE  This interface is not supported.
    1931 
    1932 **/
    1933 BOOLEAN
    1934 EFIAPI
    1935 Arc4Encrypt (
    1936   IN OUT  VOID         *Arc4Context,
    1937   IN      CONST UINT8  *Input,
    1938   IN      UINTN        InputSize,
    1939   OUT     UINT8        *Output
    1940   );
    1941 
    1942 /**
    1943   Performs ARC4 decryption on a data buffer of the specified size.
    1944 
    1945   This function performs ARC4 decryption on data buffer pointed by Input, of specified
    1946   size of InputSize.
    1947   Arc4Context should be already correctly initialized by Arc4Init(). Behavior with
    1948   invalid ARC4 context is undefined.
    1949 
    1950   If Arc4Context is NULL, then return FALSE.
    1951   If Input is NULL, then return FALSE.
    1952   If Output is NULL, then return FALSE.
    1953   If this interface is not supported, then return FALSE.
    1954 
    1955   @param[in, out]  Arc4Context  Pointer to the ARC4 context.
    1956   @param[in]       Input        Pointer to the buffer containing the data to be decrypted.
    1957   @param[in]       InputSize    Size of the Input buffer in bytes.
    1958   @param[out]      Output       Pointer to a buffer that receives the ARC4 decryption output.
    1959 
    1960   @retval TRUE   ARC4 decryption succeeded.
    1961   @retval FALSE  ARC4 decryption failed.
    1962   @retval FALSE  This interface is not supported.
    1963 
    1964 **/
    1965 BOOLEAN
    1966 EFIAPI
    1967 Arc4Decrypt (
    1968   IN OUT  VOID   *Arc4Context,
    1969   IN      UINT8  *Input,
    1970   IN      UINTN  InputSize,
    1971   OUT     UINT8  *Output
    1972   );
    1973 
    1974 /**
    1975   Resets the ARC4 context to the initial state.
    1976 
    1977   The function resets the ARC4 context to the state it had immediately after the
    1978   ARC4Init() function call.
    1979   Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context
    1980   should be already correctly initialized by ARC4Init().
    1981 
    1982   If Arc4Context is NULL, then return FALSE.
    1983   If this interface is not supported, then return FALSE.
    1984 
    1985   @param[in, out]  Arc4Context  Pointer to the ARC4 context.
    1986 
    1987   @retval TRUE   ARC4 reset succeeded.
    1988   @retval FALSE  ARC4 reset failed.
    1989   @retval FALSE  This interface is not supported.
    1990 
    1991 **/
    1992 BOOLEAN
    1993 EFIAPI
    1994 Arc4Reset (
    1995   IN OUT  VOID  *Arc4Context
    19961136  );
    19971137
     
    24211561  IN   UINTN        CertSize,
    24221562  OUT  UINT8        **SingleX509Cert
     1563  );
     1564
     1565/**
     1566  Construct a X509 stack object from a list of DER-encoded certificate data.
     1567
     1568  If X509Stack is NULL, then return FALSE.
     1569  If this interface is not supported, then return FALSE.
     1570
     1571  @param[in, out]  X509Stack  On input, pointer to an existing or NULL X509 stack object.
     1572                              On output, pointer to the X509 stack object with new
     1573                              inserted X509 certificate.
     1574  @param[in]       Args       VA_LIST marker for the variable argument list.
     1575                              A list of DER-encoded single certificate data followed
     1576                              by certificate size. A NULL terminates the list. The
     1577                              pairs are the arguments to X509ConstructCertificate().
     1578
     1579  @retval     TRUE            The X509 stack construction succeeded.
     1580  @retval     FALSE           The construction operation failed.
     1581  @retval     FALSE           This interface is not supported.
     1582
     1583**/
     1584BOOLEAN
     1585EFIAPI
     1586X509ConstructCertificateStackV (
     1587  IN OUT  UINT8    **X509Stack,
     1588  IN      VA_LIST  Args
    24231589  );
    24241590
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Include/Library/TlsLib.h

    r80721 r85718  
    398398
    399399/**
     400  Set the specified host name to be verified.
     401
     402  @param[in]  Tls           Pointer to the TLS object.
     403  @param[in]  Flags         The setting flags during the validation.
     404  @param[in]  HostName      The specified host name to be verified.
     405
     406  @retval  EFI_SUCCESS           The HostName setting was set successfully.
     407  @retval  EFI_INVALID_PARAMETER The parameter is invalid.
     408  @retval  EFI_ABORTED           Invalid HostName setting.
     409
     410**/
     411EFI_STATUS
     412EFIAPI
     413TlsSetVerifyHost (
     414  IN     VOID                     *Tls,
     415  IN     UINT32                   Flags,
     416  IN     CHAR8                    *HostName
     417  );
     418
     419/**
    400420  Sets a TLS/SSL session ID to be used during TLS/SSL connect.
    401421
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf

    r80721 r85718  
    77#  buffer overflow or integer overflow.
    88#
    9 #  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
     9#  Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
     10#  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
    1011#  SPDX-License-Identifier: BSD-2-Clause-Patent
    1112#
     
    2425# The following information is for reference only and not required by the build tools.
    2526#
    26 #  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
     27#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64 RISCV64
    2728#
    2829
    2930[Sources]
    3031  InternalCryptLib.h
    31   Hash/CryptMd4.c
    3232  Hash/CryptMd5.c
    3333  Hash/CryptSha1.c
     
    3535  Hash/CryptSha512.c
    3636  Hash/CryptSm3.c
    37   Hmac/CryptHmacMd5.c
    38   Hmac/CryptHmacSha1.c
    3937  Hmac/CryptHmacSha256.c
    4038  Kdf/CryptHkdf.c
    4139  Cipher/CryptAes.c
    42   Cipher/CryptTdes.c
    43   Cipher/CryptArc4.c
    4440  Pk/CryptRsaBasic.c
    4541  Pk/CryptRsaExt.c
     
    5955  SysCall/TimerWrapper.c
    6056  SysCall/BaseMemAllocation.c
     57  SysCall/inet_pton.c
    6158
    6259[Sources.Ia32]
     
    7067
    7168[Sources.AARCH64]
     69  Rand/CryptRand.c
     70
     71[Sources.RISCV64]
    7272  Rand/CryptRand.c
    7373
     
    102102  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
    103103  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
     104  GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
    104105
    105106  XCODE:*_*_*_CC_FLAGS = -std=c99
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c

    r80721 r85718  
    7676    return FALSE;
    7777  }
    78   return TRUE;
    79 }
    80 
    81 /**
    82   Performs AES encryption on a data buffer of the specified size in ECB mode.
    83 
    84   This function performs AES encryption on data buffer pointed by Input, of specified
    85   size of InputSize, in ECB mode.
    86   InputSize must be multiple of block size (16 bytes). This function does not perform
    87   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    88   AesContext should be already correctly initialized by AesInit(). Behavior with
    89   invalid AES context is undefined.
    90 
    91   If AesContext is NULL, then return FALSE.
    92   If Input is NULL, then return FALSE.
    93   If InputSize is not multiple of block size (16 bytes), then return FALSE.
    94   If Output is NULL, then return FALSE.
    95 
    96   @param[in]   AesContext  Pointer to the AES context.
    97   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.
    98   @param[in]   InputSize   Size of the Input buffer in bytes.
    99   @param[out]  Output      Pointer to a buffer that receives the AES encryption output.
    100 
    101   @retval TRUE   AES encryption succeeded.
    102   @retval FALSE  AES encryption failed.
    103 
    104 **/
    105 BOOLEAN
    106 EFIAPI
    107 AesEcbEncrypt (
    108   IN   VOID         *AesContext,
    109   IN   CONST UINT8  *Input,
    110   IN   UINTN        InputSize,
    111   OUT  UINT8        *Output
    112   )
    113 {
    114   AES_KEY  *AesKey;
    115 
    116   //
    117   // Check input parameters.
    118   //
    119   if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Output == NULL) {
    120     return FALSE;
    121   }
    122 
    123   AesKey = (AES_KEY *) AesContext;
    124 
    125   //
    126   // Perform AES data encryption with ECB mode (block-by-block)
    127   //
    128   while (InputSize > 0) {
    129     AES_ecb_encrypt (Input, Output, AesKey, AES_ENCRYPT);
    130     Input     += AES_BLOCK_SIZE;
    131     Output    += AES_BLOCK_SIZE;
    132     InputSize -= AES_BLOCK_SIZE;
    133   }
    134 
    135   return TRUE;
    136 }
    137 
    138 /**
    139   Performs AES decryption on a data buffer of the specified size in ECB mode.
    140 
    141   This function performs AES decryption on data buffer pointed by Input, of specified
    142   size of InputSize, in ECB mode.
    143   InputSize must be multiple of block size (16 bytes). This function does not perform
    144   padding. Caller must perform padding, if necessary, to ensure valid input data size.
    145   AesContext should be already correctly initialized by AesInit(). Behavior with
    146   invalid AES context is undefined.
    147 
    148   If AesContext is NULL, then return FALSE.
    149   If Input is NULL, then return FALSE.
    150   If InputSize is not multiple of block size (16 bytes), then return FALSE.
    151   If Output is NULL, then return FALSE.
    152 
    153   @param[in]   AesContext  Pointer to the AES context.
    154   @param[in]   Input       Pointer to the buffer containing the data to be decrypted.
    155   @param[in]   InputSize   Size of the Input buffer in bytes.
    156   @param[out]  Output      Pointer to a buffer that receives the AES decryption output.
    157 
    158   @retval TRUE   AES decryption succeeded.
    159   @retval FALSE  AES decryption failed.
    160 
    161 **/
    162 BOOLEAN
    163 EFIAPI
    164 AesEcbDecrypt (
    165   IN   VOID         *AesContext,
    166   IN   CONST UINT8  *Input,
    167   IN   UINTN        InputSize,
    168   OUT  UINT8        *Output
    169   )
    170 {
    171   AES_KEY  *AesKey;
    172 
    173   //
    174   // Check input parameters.
    175   //
    176   if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Output == NULL) {
    177     return FALSE;
    178   }
    179 
    180   AesKey = (AES_KEY *) AesContext;
    181 
    182   //
    183   // Perform AES data decryption with ECB mode (block-by-block)
    184   //
    185   while (InputSize > 0) {
    186     AES_ecb_encrypt (Input, Output, AesKey + 1, AES_DECRYPT);
    187     Input     += AES_BLOCK_SIZE;
    188     Output    += AES_BLOCK_SIZE;
    189     InputSize -= AES_BLOCK_SIZE;
    190   }
    191 
    19278  return TRUE;
    19379}
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesNull.c

    r80721 r85718  
    4545  IN   CONST UINT8  *Key,
    4646  IN   UINTN        KeyLength
    47   )
    48 {
    49   ASSERT (FALSE);
    50   return FALSE;
    51 }
    52 
    53 /**
    54   Performs AES encryption on a data buffer of the specified size in ECB mode.
    55 
    56   Return FALSE to indicate this interface is not supported.
    57 
    58   @param[in]   AesContext  Pointer to the AES context.
    59   @param[in]   Input       Pointer to the buffer containing the data to be encrypted.
    60   @param[in]   InputSize   Size of the Input buffer in bytes.
    61   @param[out]  Output      Pointer to a buffer that receives the AES encryption output.
    62 
    63   @retval FALSE  This interface is not supported.
    64 
    65 **/
    66 BOOLEAN
    67 EFIAPI
    68 AesEcbEncrypt (
    69   IN   VOID         *AesContext,
    70   IN   CONST UINT8  *Input,
    71   IN   UINTN        InputSize,
    72   OUT  UINT8        *Output
    73   )
    74 {
    75   ASSERT (FALSE);
    76   return FALSE;
    77 }
    78 
    79 /**
    80   Performs AES decryption on a data buffer of the specified size in ECB mode.
    81 
    82   Return FALSE to indicate this interface is not supported.
    83 
    84   @param[in]   AesContext  Pointer to the AES context.
    85   @param[in]   Input       Pointer to the buffer containing the data to be decrypted.
    86   @param[in]   InputSize   Size of the Input buffer in bytes.
    87   @param[out]  Output      Pointer to a buffer that receives the AES decryption output.
    88 
    89   @retval FALSE  This interface is not supported.
    90 
    91 **/
    92 BOOLEAN
    93 EFIAPI
    94 AesEcbDecrypt (
    95   IN   VOID         *AesContext,
    96   IN   CONST UINT8  *Input,
    97   IN   UINTN        InputSize,
    98   OUT  UINT8        *Output
    9947  )
    10048{
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c

    r80721 r85718  
    22  HMAC-SHA256 Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
    55SPDX-License-Identifier: BSD-2-Clause-Patent
    66
     
    1010#include <openssl/hmac.h>
    1111
    12 //
    13 // NOTE: OpenSSL redefines the size of HMAC_CTX at crypto/hmac/hmac_lcl.h
    14 //       #define HMAC_MAX_MD_CBLOCK_SIZE     144
    15 //
    16 #define HMAC_SHA256_CTX_SIZE    (sizeof(void *) * 4 + sizeof(unsigned int) + \
    17                              sizeof(unsigned char) * 144)
    18 
    19 /**
    20   Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
    21   (NOTE: This API is deprecated.
    22          Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
    23 
    24   @return  The size, in bytes, of the context buffer required for HMAC-SHA256 operations.
    25 
    26 **/
    27 UINTN
    28 EFIAPI
    29 HmacSha256GetContextSize (
    30   VOID
    31   )
    32 {
    33   //
    34   // Retrieves the OpenSSL HMAC-SHA256 Context Size
    35   // NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
    36   //       fixed size as a workaround to make this API work for compatibility.
    37   //       We should retire HmacSha256GetContextSize() in future, and use HmacSha256New()
    38   //       and HmacSha256Free() for context allocation and release.
    39   //
    40   return (UINTN)HMAC_SHA256_CTX_SIZE;
    41 }
    42 
    4312/**
    4413  Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
     
    7948
    8049/**
    81   Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
    82   subsequent use.
    83 
    84   If HmacSha256Context is NULL, then return FALSE.
    85 
    86   @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context being initialized.
     50  Set user-supplied key for subsequent use. It must be done before any
     51  calling to HmacSha256Update().
     52
     53  If HmacSha256Context is NULL, then return FALSE.
     54
     55  @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context.
    8756  @param[in]   Key                Pointer to the user-supplied key.
    8857  @param[in]   KeySize            Key size in bytes.
    8958
    90   @retval TRUE   HMAC-SHA256 context initialization succeeded.
    91   @retval FALSE  HMAC-SHA256 context initialization failed.
    92 
    93 **/
    94 BOOLEAN
    95 EFIAPI
    96 HmacSha256Init (
     59  @retval TRUE   The Key is set successfully.
     60  @retval FALSE  The Key is set unsuccessfully.
     61
     62**/
     63BOOLEAN
     64EFIAPI
     65HmacSha256SetKey (
    9766  OUT  VOID         *HmacSha256Context,
    9867  IN   CONST UINT8  *Key,
     
    10776  }
    10877
    109   //
    110   // OpenSSL HMAC-SHA256 Context Initialization
    111   //
    112   memset(HmacSha256Context, 0, HMAC_SHA256_CTX_SIZE);
    113   if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha256Context) != 1) {
    114     return FALSE;
    115   }
    11678  if (HMAC_Init_ex ((HMAC_CTX *)HmacSha256Context, Key, (UINT32) KeySize, EVP_sha256(), NULL) != 1) {
    11779    return FALSE;
     
    160122  This function performs HMAC-SHA256 digest on a data buffer of the specified size.
    161123  It can be called multiple times to compute the digest of long or discontinuous data streams.
    162   HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not
    163   be finalized by HmacSha256Final(). Behavior with invalid context is undefined.
     124  HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
     125  by HmacSha256Final(). Behavior with invalid context is undefined.
    164126
    165127  If HmacSha256Context is NULL, then return FALSE.
     
    211173  the specified memory. After this function has been called, the HMAC-SHA256 context cannot
    212174  be used again.
    213   HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should
    214   not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
     175  HMAC-SHA256 context should be initialized by HmacSha256New(), and should not be finalized
     176  by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
    215177
    216178  If HmacSha256Context is NULL, then return FALSE.
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c

    r80721 r85718  
    22  HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
    33
    4 Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
    55SPDX-License-Identifier: BSD-2-Clause-Patent
    66
     
    88
    99#include "InternalCryptLib.h"
    10 
    11 /**
    12   Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
    13   (NOTE: This API is deprecated.
    14          Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
    15 
    16   Return zero to indicate this interface is not supported.
    17 
    18   @retval  0   This interface is not supported.
    19 
    20 **/
    21 UINTN
    22 EFIAPI
    23 HmacSha256GetContextSize (
    24   VOID
    25   )
    26 {
    27   ASSERT (FALSE);
    28   return 0;
    29 }
    3010
    3111/**
     
    6646
    6747/**
    68   Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
    69   subsequent use.
     48  Set user-supplied key for subsequent use. It must be done before any
     49  calling to HmacSha256Update().
    7050
    7151  Return FALSE to indicate this interface is not supported.
    7252
    73   @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context being initialized.
     53  @param[out]  HmacSha256Context  Pointer to HMAC-SHA256 context.
    7454  @param[in]   Key                Pointer to the user-supplied key.
    7555  @param[in]   KeySize            Key size in bytes.
     
    8060BOOLEAN
    8161EFIAPI
    82 HmacSha256Init (
     62HmacSha256SetKey (
    8363  OUT  VOID         *HmacSha256Context,
    8464  IN   CONST UINT8  *Key,
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf

    r80721 r85718  
    77#  buffer overflow or integer overflow.
    88#
    9 #  Note: MD4 Digest functions,
    10 #  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external
     9#  Note:
     10#  HMAC-SHA256 functions, AES functions, RSA external
    1111#  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509
    1212#  certificate handler functions, authenticode signature verification functions,
     
    1414#  supported in this instance.
    1515#
    16 #  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
     16#  Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
    1717#  SPDX-License-Identifier: BSD-2-Clause-Patent
    1818#
     
    3636[Sources]
    3737  InternalCryptLib.h
    38   Hash/CryptMd4Null.c
    3938  Hash/CryptMd5.c
    4039  Hash/CryptSha1.c
     
    4241  Hash/CryptSm3.c
    4342  Hash/CryptSha512.c
    44   Hmac/CryptHmacMd5Null.c
    45   Hmac/CryptHmacSha1Null.c
    4643  Hmac/CryptHmacSha256Null.c
    4744  Kdf/CryptHkdfNull.c
    4845  Cipher/CryptAesNull.c
    49   Cipher/CryptTdesNull.c
    50   Cipher/CryptArc4Null.c
    5146  Pk/CryptRsaBasic.c
    5247  Pk/CryptRsaExtNull.c
     
    9792  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
    9893  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
     94  GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
    9995
    10096  XCODE:*_*_*_CC_FLAGS = -std=c99
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.uni

    r80721 r85718  
    77// buffer overflow or integer overflow.
    88//
    9 // Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/
    10 // TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,
     9// Note: AES
     10// functions, RSA external functions, PKCS#7 SignedData sign functions,
    1111// Diffie-Hellman functions, X.509 certificate handler functions, authenticode
    1212// signature verification functions, PEM handler functions, and pseudorandom number
    1313// generator functions are not supported in this instance.
    1414//
    15 // Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     15// Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
    1616//
    1717// SPDX-License-Identifier: BSD-2-Clause-Patent
     
    2222#string STR_MODULE_ABSTRACT             #language en-US "Cryptographic Library Instance for PEIM"
    2323
    24 #string STR_MODULE_DESCRIPTION          #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, and pseudorandom number generator functions are not supported in this instance."
     24#string STR_MODULE_DESCRIPTION          #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: AES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, and pseudorandom number generator functions are not supported in this instance."
    2525
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c

    r80721 r85718  
    22  PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
    55SPDX-License-Identifier: BSD-2-Clause-Patent
    66
     
    8383  //
    8484  // Add possible block-cipher descriptor for PEM data decryption.
    85   // NOTE: Only support most popular ciphers (3DES, AES) for the encrypted PEM.
     85  // NOTE: Only support most popular ciphers AES for the encrypted PEM.
    8686  //
    87   if (EVP_add_cipher (EVP_des_ede3_cbc ()) == 0) {
    88     return FALSE;
    89   }
    9087  if (EVP_add_cipher (EVP_aes_128_cbc ()) == 0) {
    9188    return FALSE;
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c

    r80721 r85718  
    1313#include <openssl/x509v3.h>
    1414#include <openssl/pkcs7.h>
     15
     16/**
     17  Check the contents of PKCS7 is not data.
     18
     19  It is copied from PKCS7_type_is_other() in pk7_doit.c.
     20
     21  @param[in] P7 Pointer to the location at which the PKCS7 is located.
     22
     23  @retval TRUE  If the type is others.
     24  @retval FALSE If the type is expected.
     25**/
     26STATIC
     27BOOLEAN
     28Pkcs7TypeIsOther (
     29  IN PKCS7 *P7
     30  )
     31{
     32  BOOLEAN Others;
     33  INTN    Nid = OBJ_obj2nid (P7->type);
     34
     35  switch (Nid) {
     36    case NID_pkcs7_data:
     37    case NID_pkcs7_signed:
     38    case NID_pkcs7_enveloped:
     39    case NID_pkcs7_signedAndEnveloped:
     40    case NID_pkcs7_encrypted:
     41      Others = FALSE;
     42      break;
     43    default:
     44      Others = TRUE;
     45  }
     46
     47  return Others;
     48}
     49
     50/**
     51  Get the ASN.1 string for the PKCS7.
     52
     53  It is copied from PKCS7_get_octet_string() in pk7_doit.c.
     54
     55  @param[in] P7 Pointer to the location at which the PKCS7 is located.
     56
     57  @return ASN1_OCTET_STRING ASN.1 string.
     58**/
     59STATIC
     60ASN1_OCTET_STRING*
     61Pkcs7GetOctetString (
     62  IN PKCS7 *P7
     63  )
     64{
     65  if (PKCS7_type_is_data (P7)) {
     66    return P7->d.data;
     67  }
     68
     69  if (Pkcs7TypeIsOther(P7) && (P7->d.other != NULL) &&
     70      (P7->d.other->type == V_ASN1_OCTET_STRING)) {
     71    return P7->d.other->value.octet_string;
     72  }
     73
     74  return NULL;
     75}
    1576
    1677/**
     
    99160    // Retrieve the attached content in PKCS7 signedData
    100161    //
    101     OctStr = Pkcs7->d.sign->contents->d.data;
     162    OctStr = Pkcs7GetOctetString (Pkcs7->d.sign->contents);
     163    if (OctStr == NULL) {
     164      goto _Exit;
     165    }
     166
    102167    if ((OctStr->length > 0) && (OctStr->data != NULL)) {
    103168      *ContentSize = OctStr->length;
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasic.c

    r80721 r85718  
    88  4) RsaPkcs1Verify
    99
    10 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     10Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
    1111SPDX-License-Identifier: BSD-2-Clause-Patent
    1212
     
    251251  If MessageHash is NULL, then return FALSE.
    252252  If Signature is NULL, then return FALSE.
    253   If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
     253  If HashSize is not equal to the size of MD5, SHA-1, SHA-256, SHA-384 or SHA-512 digest, then return FALSE.
    254254
    255255  @param[in]  RsaContext   Pointer to RSA context for signature verification.
     
    289289  //
    290290  // Determine the message digest algorithm according to digest size.
    291   //   Only MD5, SHA-1 or SHA-256 algorithm is supported.
     291  //   Only MD5, SHA-1, SHA-256, SHA-384 or SHA-512 algorithm is supported.
    292292  //
    293293  switch (HashSize) {
     
    302302  case SHA256_DIGEST_SIZE:
    303303    DigestType = NID_sha256;
     304    break;
     305
     306  case SHA384_DIGEST_SIZE:
     307    DigestType = NID_sha384;
     308    break;
     309
     310  case SHA512_DIGEST_SIZE:
     311    DigestType = NID_sha512;
    304312    break;
    305313
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExt.c

    r80721 r85718  
    88  4) RsaPkcs1Sign
    99
    10 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     10Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
    1111SPDX-License-Identifier: BSD-2-Clause-Patent
    1212
     
    277277  If RsaContext is NULL, then return FALSE.
    278278  If MessageHash is NULL, then return FALSE.
    279   If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
     279  If HashSize is not equal to the size of MD5, SHA-1, SHA-256, SHA-384 or SHA-512 digest, then return FALSE.
    280280  If SigSize is large enough but Signature is NULL, then return FALSE.
    281281
     
    327327  //
    328328  // Determine the message digest algorithm according to digest size.
    329   //   Only MD5, SHA-1 or SHA-256 algorithm is supported.
     329  //   Only MD5, SHA-1, SHA-256, SHA-384 or SHA-512 algorithm is supported.
    330330  //
    331331  switch (HashSize) {
     
    340340  case SHA256_DIGEST_SIZE:
    341341    DigestType = NID_sha256;
     342    break;
     343
     344  case SHA384_DIGEST_SIZE:
     345    DigestType = NID_sha384;
     346    break;
     347
     348  case SHA512_DIGEST_SIZE:
     349    DigestType = NID_sha512;
    342350    break;
    343351
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c

    r80721 r85718  
    22  X.509 Certificate Handler Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
    55SPDX-License-Identifier: BSD-2-Clause-Patent
    66
     
    6161
    6262  If X509Stack is NULL, then return FALSE.
     63  If this interface is not supported, then return FALSE.
    6364
    6465  @param[in, out]  X509Stack  On input, pointer to an existing or NULL X509 stack object.
    6566                              On output, pointer to the X509 stack object with new
    6667                              inserted X509 certificate.
    67   @param           ...        A list of DER-encoded single certificate data followed
     68  @param[in]       Args       VA_LIST marker for the variable argument list.
     69                              A list of DER-encoded single certificate data followed
    6870                              by certificate size. A NULL terminates the list. The
    6971                              pairs are the arguments to X509ConstructCertificate().
     
    7173  @retval     TRUE            The X509 stack construction succeeded.
    7274  @retval     FALSE           The construction operation failed.
     75  @retval     FALSE           This interface is not supported.
    7376
    7477**/
    7578BOOLEAN
    7679EFIAPI
    77 X509ConstructCertificateStack (
    78   IN OUT  UINT8  **X509Stack,
    79   ...
     80X509ConstructCertificateStackV (
     81  IN OUT  UINT8    **X509Stack,
     82  IN      VA_LIST  Args
    8083  )
    8184{
     
    8588  STACK_OF(X509)  *CertStack;
    8689  BOOLEAN         Status;
    87   VA_LIST         Args;
    8890  UINTN           Index;
    8991
     
    107109    }
    108110  }
    109 
    110   VA_START (Args, X509Stack);
    111111
    112112  for (Index = 0; ; Index++) {
     
    146146  }
    147147
    148   VA_END (Args);
    149 
    150148  if (!Status) {
    151149    sk_X509_pop_free (CertStack, X509_free);
     
    155153
    156154  return Status;
     155}
     156
     157/**
     158  Construct a X509 stack object from a list of DER-encoded certificate data.
     159
     160  If X509Stack is NULL, then return FALSE.
     161
     162  @param[in, out]  X509Stack  On input, pointer to an existing or NULL X509 stack object.
     163                              On output, pointer to the X509 stack object with new
     164                              inserted X509 certificate.
     165  @param           ...        A list of DER-encoded single certificate data followed
     166                              by certificate size. A NULL terminates the list. The
     167                              pairs are the arguments to X509ConstructCertificate().
     168
     169  @retval     TRUE            The X509 stack construction succeeded.
     170  @retval     FALSE           The construction operation failed.
     171
     172**/
     173BOOLEAN
     174EFIAPI
     175X509ConstructCertificateStack (
     176  IN OUT  UINT8  **X509Stack,
     177  ...
     178  )
     179{
     180  VA_LIST  Args;
     181  BOOLEAN  Result;
     182
     183  VA_START (Args, X509Stack);
     184  Result = X509ConstructCertificateStackV (X509Stack, Args);
     185  VA_END (Args);
     186  return Result;
    157187}
    158188
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c

    r80721 r85718  
    33  real capabilities.
    44
    5 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.<BR>
    66SPDX-License-Identifier: BSD-2-Clause-Patent
    77
     
    2828  IN   UINTN        CertSize,
    2929  OUT  UINT8        **SingleX509Cert
     30  )
     31{
     32  ASSERT (FALSE);
     33  return FALSE;
     34}
     35
     36/**
     37  Construct a X509 stack object from a list of DER-encoded certificate data.
     38
     39  If X509Stack is NULL, then return FALSE.
     40  If this interface is not supported, then return FALSE.
     41
     42  @param[in, out]  X509Stack  On input, pointer to an existing or NULL X509 stack object.
     43                              On output, pointer to the X509 stack object with new
     44                              inserted X509 certificate.
     45  @param[in]       Args       VA_LIST marker for the variable argument list.
     46                              A list of DER-encoded single certificate data followed
     47                              by certificate size. A NULL terminates the list. The
     48                              pairs are the arguments to X509ConstructCertificate().
     49
     50  @retval     TRUE            The X509 stack construction succeeded.
     51  @retval     FALSE           The construction operation failed.
     52  @retval     FALSE           This interface is not supported.
     53
     54**/
     55BOOLEAN
     56EFIAPI
     57X509ConstructCertificateStackV (
     58  IN OUT  UINT8    **X509Stack,
     59  IN      VA_LIST  Args
    3060  )
    3161{
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

    r80721 r85718  
    77#  buffer overflow or integer overflow.
    88#
    9 #  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
    10 #  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external
     9#  Note: SHA-384 Digest functions, SHA-512 Digest functions,
     10#  HMAC-SHA256 functions, AES functions, RSA external
    1111#  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
    1212#  authenticode signature verification functions are not supported in this instance.
    1313#
    14 #  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
     14#  Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
     15#  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
    1516#  SPDX-License-Identifier: BSD-2-Clause-Patent
    1617#
     
    3536[Sources]
    3637  InternalCryptLib.h
    37   Hash/CryptMd4Null.c
    3838  Hash/CryptMd5.c
    3939  Hash/CryptSha1.c
     
    4141  Hash/CryptSm3.c
    4242  Hash/CryptSha512Null.c
    43   Hmac/CryptHmacMd5Null.c
    44   Hmac/CryptHmacSha1Null.c
    4543  Hmac/CryptHmacSha256Null.c
    4644  Kdf/CryptHkdfNull.c
    4745  Cipher/CryptAesNull.c
    48   Cipher/CryptTdesNull.c
    49   Cipher/CryptArc4Null.c
    5046  Pk/CryptRsaBasic.c
    5147  Pk/CryptRsaExtNull.c
     
    7672
    7773[Sources.AARCH64]
     74  Rand/CryptRand.c
     75
     76[Sources.RISCV64]
    7877  Rand/CryptRand.c
    7978
     
    108107  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
    109108  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
     109  GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
    110110
    111111  XCODE:*_*_*_CC_FLAGS = -std=c99
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.uni

    r80721 r85718  
    77// buffer overflow or integer overflow.
    88//
    9 // Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/
    10 // TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,
     9// Note: AES
     10// functions, RSA external functions, PKCS#7 SignedData sign functions,
    1111// Diffie-Hellman functions, and authenticode signature verification functions are
    1212// not supported in this instance.
    1313//
    14 // Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     14// Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
    1515//
    1616// SPDX-License-Identifier: BSD-2-Clause-Patent
     
    2121#string STR_MODULE_ABSTRACT             #language en-US "Cryptographic Library Instance for DXE_RUNTIME_DRIVER"
    2222
    23 #string STR_MODULE_DESCRIPTION          #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."
     23#string STR_MODULE_DESCRIPTION          #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: AES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."
    2424
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf

    r80721 r85718  
    77#  buffer overflow or integer overflow.
    88#
    9 #  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
    10 #  HMAC-MD5 functions, HMAC-SHA1 functions, TDES/ARC4 functions, RSA external
    11 #  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
     9#  Note: SHA-384 Digest functions, SHA-512 Digest functions,
     10#  RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
    1211#  authenticode signature verification functions are not supported in this instance.
    1312#
    14 #  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
     13#  Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
    1514#  SPDX-License-Identifier: BSD-2-Clause-Patent
    1615#
     
    3534[Sources]
    3635  InternalCryptLib.h
    37   Hash/CryptMd4Null.c
    3836  Hash/CryptMd5.c
    3937  Hash/CryptSha1.c
     
    4139  Hash/CryptSm3.c
    4240  Hash/CryptSha512Null.c
    43   Hmac/CryptHmacMd5Null.c
    44   Hmac/CryptHmacSha1Null.c
    4541  Hmac/CryptHmacSha256.c
    4642  Kdf/CryptHkdfNull.c
    4743  Cipher/CryptAes.c
    48   Cipher/CryptTdesNull.c
    49   Cipher/CryptArc4Null.c
    5044  Pk/CryptRsaBasic.c
    5145  Pk/CryptRsaExtNull.c
     
    10599  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
    106100  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
     101  GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.uni

    r80721 r85718  
    77// buffer overflow or integer overflow.
    88//
    9 // Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/
    10 // TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,
     9// Note: AES
     10// functions, RSA external functions, PKCS#7 SignedData sign functions,
    1111// Diffie-Hellman functions, and authenticode signature verification functions are
    1212// not supported in this instance.
    1313//
    14 // Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     14// Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
    1515//
    1616// SPDX-License-Identifier: BSD-2-Clause-Patent
     
    2121#string STR_MODULE_ABSTRACT             #language en-US "Cryptographic Library Instance for SMM driver"
    2222
    23 #string STR_MODULE_DESCRIPTION          #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."
     23#string STR_MODULE_DESCRIPTION          #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: AES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."
    2424
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c

    r80721 r85718  
    116116//
    117117
     118char *strchr(const char *str, int ch)
     119{
     120  return ScanMem8 (str, AsciiStrSize (str), (UINT8)ch);
     121}
     122
    118123/* Scan a string for the last occurrence of a character */
    119124char *strrchr (const char *str, int c)
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/Include/CrtLibSupport.h

    r80721 r85718  
    44
    55Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
     6Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
    67SPDX-License-Identifier: BSD-2-Clause-Patent
    78
     
    4445#define CONFIG_HEADER_BN_H
    4546
    46 #if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64)
     47#if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64) || defined(MDE_CPU_RISCV64)
    4748//
    4849// With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs
     
    7576//
    7677#define EINVAL       22               /* Invalid argument */
     78#define EAFNOSUPPORT 47               /* Address family not supported by protocol family */
    7779#define INT_MAX      0x7FFFFFFF       /* Maximum (signed) int value */
    7880#define LONG_MAX     0X7FFFFFFFL      /* max value for a long */
     
    8284
    8385//
     86// Address families.
     87//
     88#define AF_INET   2     /* internetwork: UDP, TCP, etc. */
     89#define AF_INET6  24    /* IP version 6 */
     90
     91//
     92// Define constants based on RFC0883, RFC1034, RFC 1035
     93//
     94#define NS_INT16SZ    2   /*%< #/bytes of data in a u_int16_t */
     95#define NS_INADDRSZ   4   /*%< IPv4 T_A */
     96#define NS_IN6ADDRSZ  16  /*%< IPv6 T_AAAA */
     97
     98//
    8499// Basic types mapping
    85100//
    86101typedef UINTN          size_t;
     102typedef UINTN          u_int;
    87103typedef INTN           ssize_t;
    88104typedef INT32          time_t;
    89105typedef UINT8          __uint8_t;
    90106typedef UINT8          sa_family_t;
     107typedef UINT8          u_char;
    91108typedef UINT32         uid_t;
    92109typedef UINT32         gid_t;
     
    148165int            strcmp      (const char *, const char *);
    149166int            strncasecmp (const char *, const char *, size_t);
     167char           *strchr     (const char *, int);
    150168char           *strrchr    (const char *, int);
    151169unsigned long  strtoul     (const char *, char **, int);
     
    176194void           abort       (void);
    177195#endif
     196int            inet_pton   (int, const char *, void *);
    178197
    179198//
     
    189208#define strncpy(strDest,strSource,count)  AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
    190209#define strcat(strDest,strSource)         AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
    191 #define strchr(str,ch)                    ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)
    192210#define strncmp(string1,string2,count)    (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
    193211#define strcasecmp(str1,str2)             (int)AsciiStriCmp(str1,str2)
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/Include/internal/dso_conf.h

    r77662 r85718  
     1/* WARNING: do not edit! */
     2/* Generated from crypto/include/internal/dso_conf.h.in */
     3/*
     4 * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
     5 *
     6 * Licensed under the OpenSSL license (the "License").  You may not use
     7 * this file except in compliance with the License.  You can obtain a copy
     8 * in the file LICENSE in the source distribution or at
     9 * https://www.openssl.org/source/license.html
     10 */
     11
     12#ifndef HEADER_DSO_CONF_H
     13# define HEADER_DSO_CONF_H
     14# define DSO_NONE
     15# define DSO_EXTENSION ".so"
     16#endif
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/Include/openssl/opensslconf.h

    r80721 r85718  
    5050# define OPENSSL_NO_CT
    5151#endif
     52#ifndef OPENSSL_NO_DES
     53# define OPENSSL_NO_DES
     54#endif
    5255#ifndef OPENSSL_NO_DSA
    5356# define OPENSSL_NO_DSA
     
    6265# define OPENSSL_NO_MD2
    6366#endif
     67#ifndef OPENSSL_NO_MD4
     68# define OPENSSL_NO_MD4
     69#endif
    6470#ifndef OPENSSL_NO_MDC2
    6571# define OPENSSL_NO_MDC2
     
    7177# define OPENSSL_NO_RC2
    7278#endif
     79#ifndef OPENSSL_NO_RC4
     80# define OPENSSL_NO_RC4
     81#endif
    7382#ifndef OPENSSL_NO_RC5
    7483# define OPENSSL_NO_RC5
     
    109118#ifndef OPENSSL_NO_ASYNC
    110119# define OPENSSL_NO_ASYNC
    111 #endif
    112 #ifndef OPENSSL_NO_AUTOALGINIT
    113 # define OPENSSL_NO_AUTOALGINIT
    114120#endif
    115121#ifndef OPENSSL_NO_AUTOERRINIT
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c

    r80721 r85718  
    33  Cryptographic Library.
    44
    5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
    66SPDX-License-Identifier: BSD-2-Clause-Patent
    77
     
    1414typedef UINTN  size_t;
    1515
     16#if defined(__GNUC__) || defined(__clang__)
     17  #define GLOBAL_USED __attribute__((used))
     18#else
     19  #define GLOBAL_USED
     20#endif
     21
    1622/* OpenSSL will use floating point support, and C compiler produces the _fltused
    1723   symbol by default. Simply define this symbol here to satisfy the linker. */
    18 int _fltused = 1;
     24int  GLOBAL_USED _fltused = 1;
    1925
    2026/* Sets buffers to a specified character */
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/OpensslLib/OpensslLib.inf

    r80953 r85718  
    22#  This module provides OpenSSL Library implementation.
    33#
    4 #  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
     5#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
    56#  SPDX-License-Identifier: BSD-2-Clause-Patent
    67#
     
    2324
    2425[Sources]
    25   buildinf.h
    26   rand_pool_noise.h
    2726  $(OPENSSL_PATH)/e_os.h
     27  $(OPENSSL_PATH)/ms/uplink.h
    2828# Autogenerated files list starts here
    2929  $(OPENSSL_PATH)/crypto/aes/aes_cbc.c
    3030  $(OPENSSL_PATH)/crypto/aes/aes_cfb.c
    3131  $(OPENSSL_PATH)/crypto/aes/aes_core.c
    32   $(OPENSSL_PATH)/crypto/aes/aes_ecb.c
    3332  $(OPENSSL_PATH)/crypto/aes/aes_ige.c
    3433  $(OPENSSL_PATH)/crypto/aes/aes_misc.c
    3534  $(OPENSSL_PATH)/crypto/aes/aes_ofb.c
    3635  $(OPENSSL_PATH)/crypto/aes/aes_wrap.c
    37   $(OPENSSL_PATH)/crypto/aes/aes_locl.h
    3836  $(OPENSSL_PATH)/crypto/aria/aria.c
    39   $(OPENSSL_PATH)/crypto/arm_arch.h
    4037  $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c
    4138  $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c
     
    10299  $(OPENSSL_PATH)/crypto/asn1/x_spki.c
    103100  $(OPENSSL_PATH)/crypto/asn1/x_val.c
    104   $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
    105   $(OPENSSL_PATH)/crypto/asn1/charmap.h
    106   $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
    107   $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
    108   $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
    109101  $(OPENSSL_PATH)/crypto/async/arch/async_null.c
    110102  $(OPENSSL_PATH)/crypto/async/arch/async_posix.c
     
    113105  $(OPENSSL_PATH)/crypto/async/async_err.c
    114106  $(OPENSSL_PATH)/crypto/async/async_wait.c
    115   $(OPENSSL_PATH)/crypto/async/arch/async_win.h
    116   $(OPENSSL_PATH)/crypto/async/async_locl.h
    117   $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
    118   $(OPENSSL_PATH)/crypto/async/arch/async_null.h
    119107  $(OPENSSL_PATH)/crypto/bio/b_addr.c
    120108  $(OPENSSL_PATH)/crypto/bio/b_dump.c
     
    139127  $(OPENSSL_PATH)/crypto/bio/bss_null.c
    140128  $(OPENSSL_PATH)/crypto/bio/bss_sock.c
    141   $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
    142129  $(OPENSSL_PATH)/crypto/bn/bn_add.c
    143130  $(OPENSSL_PATH)/crypto/bn/bn_asm.c
     
    171158  $(OPENSSL_PATH)/crypto/bn/bn_word.c
    172159  $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
    173   $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
    174   $(OPENSSL_PATH)/crypto/bn/bn_prime.h
    175   $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
    176160  $(OPENSSL_PATH)/crypto/buffer/buf_err.c
    177161  $(OPENSSL_PATH)/crypto/buffer/buffer.c
     
    182166  $(OPENSSL_PATH)/crypto/comp/comp_err.c
    183167  $(OPENSSL_PATH)/crypto/comp/comp_lib.c
    184   $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
    185168  $(OPENSSL_PATH)/crypto/conf/conf_api.c
    186169  $(OPENSSL_PATH)/crypto/conf/conf_def.c
     
    191174  $(OPENSSL_PATH)/crypto/conf/conf_sap.c
    192175  $(OPENSSL_PATH)/crypto/conf/conf_ssl.c
    193   $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
    194   $(OPENSSL_PATH)/crypto/conf/conf_def.h
    195176  $(OPENSSL_PATH)/crypto/cpt_err.c
    196177  $(OPENSSL_PATH)/crypto/cryptlib.c
    197178  $(OPENSSL_PATH)/crypto/ctype.c
    198179  $(OPENSSL_PATH)/crypto/cversion.c
    199   $(OPENSSL_PATH)/crypto/des/cbc_cksm.c
    200   $(OPENSSL_PATH)/crypto/des/cbc_enc.c
    201   $(OPENSSL_PATH)/crypto/des/cfb64ede.c
    202   $(OPENSSL_PATH)/crypto/des/cfb64enc.c
    203   $(OPENSSL_PATH)/crypto/des/cfb_enc.c
    204   $(OPENSSL_PATH)/crypto/des/des_enc.c
    205   $(OPENSSL_PATH)/crypto/des/ecb3_enc.c
    206   $(OPENSSL_PATH)/crypto/des/ecb_enc.c
    207   $(OPENSSL_PATH)/crypto/des/fcrypt.c
    208   $(OPENSSL_PATH)/crypto/des/fcrypt_b.c
    209   $(OPENSSL_PATH)/crypto/des/ofb64ede.c
    210   $(OPENSSL_PATH)/crypto/des/ofb64enc.c
    211   $(OPENSSL_PATH)/crypto/des/ofb_enc.c
    212   $(OPENSSL_PATH)/crypto/des/pcbc_enc.c
    213   $(OPENSSL_PATH)/crypto/des/qud_cksm.c
    214   $(OPENSSL_PATH)/crypto/des/rand_key.c
    215   $(OPENSSL_PATH)/crypto/des/set_key.c
    216   $(OPENSSL_PATH)/crypto/des/str2key.c
    217   $(OPENSSL_PATH)/crypto/des/xcbc_enc.c
    218   $(OPENSSL_PATH)/crypto/des/spr.h
    219   $(OPENSSL_PATH)/crypto/des/des_locl.h
    220180  $(OPENSSL_PATH)/crypto/dh/dh_ameth.c
    221181  $(OPENSSL_PATH)/crypto/dh/dh_asn1.c
     
    232192  $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c
    233193  $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c
    234   $(OPENSSL_PATH)/crypto/dh/dh_locl.h
    235194  $(OPENSSL_PATH)/crypto/dso/dso_dl.c
    236195  $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c
     
    240199  $(OPENSSL_PATH)/crypto/dso/dso_vms.c
    241200  $(OPENSSL_PATH)/crypto/dso/dso_win32.c
    242   $(OPENSSL_PATH)/crypto/dso/dso_locl.h
    243201  $(OPENSSL_PATH)/crypto/ebcdic.c
    244202  $(OPENSSL_PATH)/crypto/err/err.c
     
    305263  $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c
    306264  $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c
    307   $(OPENSSL_PATH)/crypto/evp/evp_locl.h
    308265  $(OPENSSL_PATH)/crypto/ex_data.c
    309266  $(OPENSSL_PATH)/crypto/getenv.c
     
    311268  $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c
    312269  $(OPENSSL_PATH)/crypto/hmac/hmac.c
    313   $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
    314270  $(OPENSSL_PATH)/crypto/init.c
    315271  $(OPENSSL_PATH)/crypto/kdf/hkdf.c
     
    319275  $(OPENSSL_PATH)/crypto/lhash/lh_stats.c
    320276  $(OPENSSL_PATH)/crypto/lhash/lhash.c
    321   $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
    322   $(OPENSSL_PATH)/crypto/md4/md4_dgst.c
    323   $(OPENSSL_PATH)/crypto/md4/md4_one.c
    324   $(OPENSSL_PATH)/crypto/md4/md4_locl.h
    325277  $(OPENSSL_PATH)/crypto/md5/md5_dgst.c
    326278  $(OPENSSL_PATH)/crypto/md5/md5_one.c
    327   $(OPENSSL_PATH)/crypto/md5/md5_locl.h
    328279  $(OPENSSL_PATH)/crypto/mem.c
    329280  $(OPENSSL_PATH)/crypto/mem_clr.c
     
    340291  $(OPENSSL_PATH)/crypto/modes/wrap128.c
    341292  $(OPENSSL_PATH)/crypto/modes/xts128.c
    342   $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
    343293  $(OPENSSL_PATH)/crypto/o_dir.c
    344294  $(OPENSSL_PATH)/crypto/o_fips.c
     
    352302  $(OPENSSL_PATH)/crypto/objects/obj_lib.c
    353303  $(OPENSSL_PATH)/crypto/objects/obj_xref.c
    354   $(OPENSSL_PATH)/crypto/objects/obj_dat.h
    355   $(OPENSSL_PATH)/crypto/objects/obj_xref.h
    356   $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
    357304  $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c
    358305  $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c
     
    365312  $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c
    366313  $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c
    367   $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
    368314  $(OPENSSL_PATH)/crypto/pem/pem_all.c
    369315  $(OPENSSL_PATH)/crypto/pem/pem_err.c
     
    393339  $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c
    394340  $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c
    395   $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
    396341  $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c
    397342  $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c
     
    402347  $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c
    403348  $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c
    404   $(OPENSSL_PATH)/crypto/ppc_arch.h
    405349  $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c
    406350  $(OPENSSL_PATH)/crypto/rand/drbg_lib.c
     
    411355  $(OPENSSL_PATH)/crypto/rand/rand_vms.c
    412356  $(OPENSSL_PATH)/crypto/rand/rand_win.c
    413   $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
    414   $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c
    415   $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c
    416   $(OPENSSL_PATH)/crypto/rc4/rc4_locl.h
    417357  $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c
    418358  $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c
     
    437377  $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c
    438378  $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c
    439   $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
    440   $(OPENSSL_PATH)/crypto/s390x_arch.h
    441379  $(OPENSSL_PATH)/crypto/sha/keccak1600.c
    442380  $(OPENSSL_PATH)/crypto/sha/sha1_one.c
     
    444382  $(OPENSSL_PATH)/crypto/sha/sha256.c
    445383  $(OPENSSL_PATH)/crypto/sha/sha512.c
    446   $(OPENSSL_PATH)/crypto/sha/sha_locl.h
    447384  $(OPENSSL_PATH)/crypto/siphash/siphash.c
    448385  $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c
    449386  $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c
    450   $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
    451387  $(OPENSSL_PATH)/crypto/sm3/m_sm3.c
    452388  $(OPENSSL_PATH)/crypto/sm3/sm3.c
    453   $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
    454389  $(OPENSSL_PATH)/crypto/sm4/sm4.c
    455390  $(OPENSSL_PATH)/crypto/stack/stack.c
    456   $(OPENSSL_PATH)/crypto/sparc_arch.h
    457391  $(OPENSSL_PATH)/crypto/threads_none.c
    458392  $(OPENSSL_PATH)/crypto/threads_pthread.c
     
    464398  $(OPENSSL_PATH)/crypto/ui/ui_openssl.c
    465399  $(OPENSSL_PATH)/crypto/ui/ui_util.c
    466   $(OPENSSL_PATH)/crypto/ui/ui_locl.h
    467   $(OPENSSL_PATH)/crypto/vms_rms.h
    468400  $(OPENSSL_PATH)/crypto/uid.c
    469401  $(OPENSSL_PATH)/crypto/x509/by_dir.c
     
    503435  $(OPENSSL_PATH)/crypto/x509/x_x509.c
    504436  $(OPENSSL_PATH)/crypto/x509/x_x509a.c
    505   $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
    506437  $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c
    507438  $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c
     
    541472  $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c
    542473  $(OPENSSL_PATH)/crypto/x509v3/v3err.c
     474  $(OPENSSL_PATH)/crypto/arm_arch.h
     475  $(OPENSSL_PATH)/crypto/mips_arch.h
     476  $(OPENSSL_PATH)/crypto/ppc_arch.h
     477  $(OPENSSL_PATH)/crypto/s390x_arch.h
     478  $(OPENSSL_PATH)/crypto/sparc_arch.h
     479  $(OPENSSL_PATH)/crypto/vms_rms.h
     480  $(OPENSSL_PATH)/crypto/aes/aes_locl.h
     481  $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
     482  $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
     483  $(OPENSSL_PATH)/crypto/asn1/charmap.h
     484  $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
     485  $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
     486  $(OPENSSL_PATH)/crypto/async/async_locl.h
     487  $(OPENSSL_PATH)/crypto/async/arch/async_null.h
     488  $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
     489  $(OPENSSL_PATH)/crypto/async/arch/async_win.h
     490  $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
     491  $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
     492  $(OPENSSL_PATH)/crypto/bn/bn_prime.h
     493  $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
     494  $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
     495  $(OPENSSL_PATH)/crypto/conf/conf_def.h
     496  $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
     497  $(OPENSSL_PATH)/crypto/dh/dh_locl.h
     498  $(OPENSSL_PATH)/crypto/dso/dso_locl.h
     499  $(OPENSSL_PATH)/crypto/evp/evp_locl.h
     500  $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
     501  $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
     502  $(OPENSSL_PATH)/crypto/md5/md5_locl.h
     503  $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
     504  $(OPENSSL_PATH)/crypto/objects/obj_dat.h
     505  $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
     506  $(OPENSSL_PATH)/crypto/objects/obj_xref.h
     507  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
     508  $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
     509  $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
     510  $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
     511  $(OPENSSL_PATH)/crypto/sha/sha_locl.h
     512  $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
     513  $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
     514  $(OPENSSL_PATH)/crypto/store/store_locl.h
     515  $(OPENSSL_PATH)/crypto/ui/ui_locl.h
     516  $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
     517  $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
    543518  $(OPENSSL_PATH)/crypto/x509v3/pcy_int.h
     519  $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
    544520  $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h
    545   $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
    546   $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
    547   $(OPENSSL_PATH)/ms/uplink.h
    548521  $(OPENSSL_PATH)/ssl/bio_ssl.c
    549522  $(OPENSSL_PATH)/ssl/d1_lib.c
     
    590563  $(OPENSSL_PATH)/ssl/tls13_enc.c
    591564  $(OPENSSL_PATH)/ssl/tls_srp.c
     565  $(OPENSSL_PATH)/ssl/packet_locl.h
     566  $(OPENSSL_PATH)/ssl/ssl_cert_table.h
     567  $(OPENSSL_PATH)/ssl/ssl_locl.h
     568  $(OPENSSL_PATH)/ssl/record/record.h
    592569  $(OPENSSL_PATH)/ssl/record/record_locl.h
    593570  $(OPENSSL_PATH)/ssl/statem/statem.h
    594571  $(OPENSSL_PATH)/ssl/statem/statem_locl.h
    595   $(OPENSSL_PATH)/ssl/ssl_locl.h
    596   $(OPENSSL_PATH)/ssl/record/record.h
    597   $(OPENSSL_PATH)/ssl/ssl_cert_table.h
    598   $(OPENSSL_PATH)/ssl/packet_locl.h
    599572# Autogenerated files list ends here
    600 
     573  buildinf.h
     574  rand_pool_noise.h
    601575  ossl_store.c
    602576  rand_pool.c
     
    661635  GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable
    662636  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
     637  GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=format -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
    663638  GCC:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
    664639  GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
     640  GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized -Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
    665641
    666642  # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf

    r80953 r85718  
    22#  This module provides OpenSSL Library implementation.
    33#
    4 #  Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>
     5#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
    56#  SPDX-License-Identifier: BSD-2-Clause-Patent
    67#
     
    2930  $(OPENSSL_PATH)/crypto/aes/aes_cfb.c
    3031  $(OPENSSL_PATH)/crypto/aes/aes_core.c
    31   $(OPENSSL_PATH)/crypto/aes/aes_ecb.c
    3232  $(OPENSSL_PATH)/crypto/aes/aes_ige.c
    3333  $(OPENSSL_PATH)/crypto/aes/aes_misc.c
    3434  $(OPENSSL_PATH)/crypto/aes/aes_ofb.c
    3535  $(OPENSSL_PATH)/crypto/aes/aes_wrap.c
    36   $(OPENSSL_PATH)/crypto/aes/aes_locl.h
    3736  $(OPENSSL_PATH)/crypto/aria/aria.c
    38   $(OPENSSL_PATH)/crypto/arm_arch.h
    3937  $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c
    4038  $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c
     
    10199  $(OPENSSL_PATH)/crypto/asn1/x_spki.c
    102100  $(OPENSSL_PATH)/crypto/asn1/x_val.c
    103   $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
    104   $(OPENSSL_PATH)/crypto/asn1/charmap.h
    105   $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
    106   $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
    107   $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
    108101  $(OPENSSL_PATH)/crypto/async/arch/async_null.c
    109102  $(OPENSSL_PATH)/crypto/async/arch/async_posix.c
    110103  $(OPENSSL_PATH)/crypto/async/arch/async_win.c
    111   $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
    112   $(OPENSSL_PATH)/crypto/async/arch/async_null.h
    113   $(OPENSSL_PATH)/crypto/async/arch/async_win.h
    114104  $(OPENSSL_PATH)/crypto/async/async.c
    115105  $(OPENSSL_PATH)/crypto/async/async_err.c
    116106  $(OPENSSL_PATH)/crypto/async/async_wait.c
    117   $(OPENSSL_PATH)/crypto/async/async_locl.h
    118107  $(OPENSSL_PATH)/crypto/bio/b_addr.c
    119108  $(OPENSSL_PATH)/crypto/bio/b_dump.c
     
    138127  $(OPENSSL_PATH)/crypto/bio/bss_null.c
    139128  $(OPENSSL_PATH)/crypto/bio/bss_sock.c
    140   $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
    141129  $(OPENSSL_PATH)/crypto/bn/bn_add.c
    142130  $(OPENSSL_PATH)/crypto/bn/bn_asm.c
     
    170158  $(OPENSSL_PATH)/crypto/bn/bn_word.c
    171159  $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
    172   $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
    173   $(OPENSSL_PATH)/crypto/bn/bn_prime.h
    174   $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
    175160  $(OPENSSL_PATH)/crypto/buffer/buf_err.c
    176161  $(OPENSSL_PATH)/crypto/buffer/buffer.c
     
    181166  $(OPENSSL_PATH)/crypto/comp/comp_err.c
    182167  $(OPENSSL_PATH)/crypto/comp/comp_lib.c
    183   $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
    184168  $(OPENSSL_PATH)/crypto/conf/conf_api.c
    185169  $(OPENSSL_PATH)/crypto/conf/conf_def.c
     
    190174  $(OPENSSL_PATH)/crypto/conf/conf_sap.c
    191175  $(OPENSSL_PATH)/crypto/conf/conf_ssl.c
    192   $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
    193   $(OPENSSL_PATH)/crypto/conf/conf_def.h
    194176  $(OPENSSL_PATH)/crypto/cpt_err.c
    195177  $(OPENSSL_PATH)/crypto/cryptlib.c
    196178  $(OPENSSL_PATH)/crypto/ctype.c
    197179  $(OPENSSL_PATH)/crypto/cversion.c
    198   $(OPENSSL_PATH)/crypto/des/cbc_cksm.c
    199   $(OPENSSL_PATH)/crypto/des/cbc_enc.c
    200   $(OPENSSL_PATH)/crypto/des/cfb64ede.c
    201   $(OPENSSL_PATH)/crypto/des/cfb64enc.c
    202   $(OPENSSL_PATH)/crypto/des/cfb_enc.c
    203   $(OPENSSL_PATH)/crypto/des/des_enc.c
    204   $(OPENSSL_PATH)/crypto/des/ecb3_enc.c
    205   $(OPENSSL_PATH)/crypto/des/ecb_enc.c
    206   $(OPENSSL_PATH)/crypto/des/fcrypt.c
    207   $(OPENSSL_PATH)/crypto/des/fcrypt_b.c
    208   $(OPENSSL_PATH)/crypto/des/ofb64ede.c
    209   $(OPENSSL_PATH)/crypto/des/ofb64enc.c
    210   $(OPENSSL_PATH)/crypto/des/ofb_enc.c
    211   $(OPENSSL_PATH)/crypto/des/pcbc_enc.c
    212   $(OPENSSL_PATH)/crypto/des/qud_cksm.c
    213   $(OPENSSL_PATH)/crypto/des/rand_key.c
    214   $(OPENSSL_PATH)/crypto/des/set_key.c
    215   $(OPENSSL_PATH)/crypto/des/str2key.c
    216   $(OPENSSL_PATH)/crypto/des/xcbc_enc.c
    217   $(OPENSSL_PATH)/crypto/des/spr.h
    218   $(OPENSSL_PATH)/crypto/des/des_locl.h
    219180  $(OPENSSL_PATH)/crypto/dh/dh_ameth.c
    220181  $(OPENSSL_PATH)/crypto/dh/dh_asn1.c
     
    231192  $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c
    232193  $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c
    233   $(OPENSSL_PATH)/crypto/dh/dh_locl.h
    234194  $(OPENSSL_PATH)/crypto/dso/dso_dl.c
    235195  $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c
     
    239199  $(OPENSSL_PATH)/crypto/dso/dso_vms.c
    240200  $(OPENSSL_PATH)/crypto/dso/dso_win32.c
    241   $(OPENSSL_PATH)/crypto/dso/dso_locl.h
    242201  $(OPENSSL_PATH)/crypto/ebcdic.c
    243202  $(OPENSSL_PATH)/crypto/err/err.c
     
    281240  $(OPENSSL_PATH)/crypto/evp/m_md2.c
    282241  $(OPENSSL_PATH)/crypto/evp/m_md4.c
    283   $(OPENSSL_PATH)/crypto/md4/md4_locl.h
    284242  $(OPENSSL_PATH)/crypto/evp/m_md5.c
    285243  $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c
     
    305263  $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c
    306264  $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c
    307   $(OPENSSL_PATH)/crypto/evp/evp_locl.h
    308265  $(OPENSSL_PATH)/crypto/ex_data.c
    309266  $(OPENSSL_PATH)/crypto/getenv.c
     
    311268  $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c
    312269  $(OPENSSL_PATH)/crypto/hmac/hmac.c
    313   $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
    314270  $(OPENSSL_PATH)/crypto/init.c
    315271  $(OPENSSL_PATH)/crypto/kdf/hkdf.c
     
    319275  $(OPENSSL_PATH)/crypto/lhash/lh_stats.c
    320276  $(OPENSSL_PATH)/crypto/lhash/lhash.c
    321   $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
    322   $(OPENSSL_PATH)/crypto/md4/md4_dgst.c
    323   $(OPENSSL_PATH)/crypto/md4/md4_one.c
    324277  $(OPENSSL_PATH)/crypto/md5/md5_dgst.c
    325278  $(OPENSSL_PATH)/crypto/md5/md5_one.c
    326   $(OPENSSL_PATH)/crypto/md5/md5_locl.h
    327279  $(OPENSSL_PATH)/crypto/mem.c
    328280  $(OPENSSL_PATH)/crypto/mem_clr.c
     
    339291  $(OPENSSL_PATH)/crypto/modes/wrap128.c
    340292  $(OPENSSL_PATH)/crypto/modes/xts128.c
    341   $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
    342293  $(OPENSSL_PATH)/crypto/o_dir.c
    343294  $(OPENSSL_PATH)/crypto/o_fips.c
     
    351302  $(OPENSSL_PATH)/crypto/objects/obj_lib.c
    352303  $(OPENSSL_PATH)/crypto/objects/obj_xref.c
    353   $(OPENSSL_PATH)/crypto/objects/obj_dat.h
    354   $(OPENSSL_PATH)/crypto/objects/obj_xref.h
    355   $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
    356304  $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c
    357305  $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c
     
    364312  $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c
    365313  $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c
    366   $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
    367314  $(OPENSSL_PATH)/crypto/pem/pem_all.c
    368315  $(OPENSSL_PATH)/crypto/pem/pem_err.c
     
    400347  $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c
    401348  $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c
    402   $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
    403   $(OPENSSL_PATH)/crypto/ppc_arch.h
    404349  $(OPENSSL_PATH)/crypto/rand/drbg_ctr.c
    405350  $(OPENSSL_PATH)/crypto/rand/drbg_lib.c
     
    410355  $(OPENSSL_PATH)/crypto/rand/rand_vms.c
    411356  $(OPENSSL_PATH)/crypto/rand/rand_win.c
    412   $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
    413   $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c
    414   $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c
    415   $(OPENSSL_PATH)/crypto/rc4/rc4_locl.h
    416357  $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c
    417358  $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c
     
    436377  $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c
    437378  $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c
    438   $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
    439379  $(OPENSSL_PATH)/crypto/sha/keccak1600.c
    440380  $(OPENSSL_PATH)/crypto/sha/sha1_one.c
     
    442382  $(OPENSSL_PATH)/crypto/sha/sha256.c
    443383  $(OPENSSL_PATH)/crypto/sha/sha512.c
    444   $(OPENSSL_PATH)/crypto/sha/sha_locl.h
    445384  $(OPENSSL_PATH)/crypto/siphash/siphash.c
    446385  $(OPENSSL_PATH)/crypto/siphash/siphash_ameth.c
    447386  $(OPENSSL_PATH)/crypto/siphash/siphash_pmeth.c
    448   $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
    449387  $(OPENSSL_PATH)/crypto/sm3/m_sm3.c
    450388  $(OPENSSL_PATH)/crypto/sm3/sm3.c
    451   $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
    452389  $(OPENSSL_PATH)/crypto/sm4/sm4.c
    453390  $(OPENSSL_PATH)/crypto/stack/stack.c
    454   $(OPENSSL_PATH)/crypto/s390x_arch.h
    455   $(OPENSSL_PATH)/crypto/sparc_arch.h
    456391  $(OPENSSL_PATH)/crypto/threads_none.c
    457392  $(OPENSSL_PATH)/crypto/threads_pthread.c
     
    463398  $(OPENSSL_PATH)/crypto/ui/ui_openssl.c
    464399  $(OPENSSL_PATH)/crypto/ui/ui_util.c
    465   $(OPENSSL_PATH)/crypto/ui/ui_locl.h
    466400  $(OPENSSL_PATH)/crypto/uid.c
    467   $(OPENSSL_PATH)/crypto/vms_rms.h
    468401  $(OPENSSL_PATH)/crypto/x509/by_dir.c
    469402  $(OPENSSL_PATH)/crypto/x509/by_file.c
     
    502435  $(OPENSSL_PATH)/crypto/x509/x_x509.c
    503436  $(OPENSSL_PATH)/crypto/x509/x_x509a.c
    504   $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
    505437  $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c
    506438  $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c
     
    540472  $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c
    541473  $(OPENSSL_PATH)/crypto/x509v3/v3err.c
     474  $(OPENSSL_PATH)/crypto/arm_arch.h
     475  $(OPENSSL_PATH)/crypto/mips_arch.h
     476  $(OPENSSL_PATH)/crypto/ppc_arch.h
     477  $(OPENSSL_PATH)/crypto/s390x_arch.h
     478  $(OPENSSL_PATH)/crypto/sparc_arch.h
     479  $(OPENSSL_PATH)/crypto/vms_rms.h
     480  $(OPENSSL_PATH)/crypto/aes/aes_locl.h
     481  $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
     482  $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
     483  $(OPENSSL_PATH)/crypto/asn1/charmap.h
     484  $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
     485  $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
     486  $(OPENSSL_PATH)/crypto/async/async_locl.h
     487  $(OPENSSL_PATH)/crypto/async/arch/async_null.h
     488  $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
     489  $(OPENSSL_PATH)/crypto/async/arch/async_win.h
     490  $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
     491  $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
     492  $(OPENSSL_PATH)/crypto/bn/bn_prime.h
     493  $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
     494  $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
     495  $(OPENSSL_PATH)/crypto/conf/conf_def.h
     496  $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
     497  $(OPENSSL_PATH)/crypto/dh/dh_locl.h
     498  $(OPENSSL_PATH)/crypto/dso/dso_locl.h
     499  $(OPENSSL_PATH)/crypto/evp/evp_locl.h
     500  $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
     501  $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
     502  $(OPENSSL_PATH)/crypto/md5/md5_locl.h
     503  $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
     504  $(OPENSSL_PATH)/crypto/objects/obj_dat.h
     505  $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
     506  $(OPENSSL_PATH)/crypto/objects/obj_xref.h
     507  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
     508  $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
     509  $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
     510  $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
     511  $(OPENSSL_PATH)/crypto/sha/sha_locl.h
     512  $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
     513  $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
     514  $(OPENSSL_PATH)/crypto/store/store_locl.h
     515  $(OPENSSL_PATH)/crypto/ui/ui_locl.h
     516  $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
     517  $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
    542518  $(OPENSSL_PATH)/crypto/x509v3/pcy_int.h
     519  $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
    543520  $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h
    544   $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
    545   $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
    546521# Autogenerated files list ends here
    547522  buildinf.h
     
    609584  GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable
    610585  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
     586  GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
    611587  GCC:*_CLANG35_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
    612588  GCC:*_CLANG38_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized
     589  GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized -Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
    613590
    614591  # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/OpensslLib/process_files.pl

    r80721 r85718  
    33# This script runs the OpenSSL Configure script, then processes the
    44# resulting file list into our local OpensslLib[Crypto].inf and also
    5 # takes a copy of opensslconf.h.
     5# takes copies of opensslconf.h and dso_conf.h.
    66#
    77# This only needs to be done once by a developer when updating to a
     
    5252                "no-asm",
    5353                "no-async",
    54                 "no-autoalginit",
    5554                "no-autoerrinit",
    5655                "no-autoload-config",
     
    6463                "no-ct",
    6564                "no-deprecated",
     65                "no-des",
    6666                "no-dgram",
    6767                "no-dsa",
     
    7575                "no-hw",
    7676                "no-idea",
     77                "no-md4",
    7778                "no-mdc2",
    7879                "no-pic",
     
    8182                "no-posix-io",
    8283                "no-rc2",
     84                "no-rc4",
    8385                "no-rfc3779",
    8486                "no-rmd160",
     
    107109                    die "Failed to generate opensslconf.h!\n";
    108110
     111            # Generate dso_conf.h per config data
     112            system(
     113                "perl -I. -Mconfigdata util/dofile.pl " .
     114                "crypto/include/internal/dso_conf.h.in " .
     115                "> include/internal/dso_conf.h"
     116                ) == 0 ||
     117                    die "Failed to generate dso_conf.h!\n";
     118
    109119            chdir($basedir) ||
    110120                die "Cannot change to base directory \"" . $basedir . "\"";
     
    135145            next if $s =~ "crypto/store/";
    136146            next if $s =~ "crypto/err/err_all.c";
     147            next if $s =~ "crypto/aes/aes_ecb.c";
    137148
    138149            if ($product =~ "libssl") {
     
    144155    }
    145156}
     157
     158
     159#
     160# Update the perl script to generate the missing header files
     161#
     162my @dir_list = ();
     163for (sort keys %{$unified_info{dirinfo}}){
     164  push @dir_list,$_;
     165}
     166
     167my $dir = getcwd();
     168my @files = ();
     169my @headers = ();
     170chdir ("openssl");
     171foreach(@dir_list){
     172  @files = glob($_."/*.h");
     173  push @headers, @files;
     174}
     175chdir ($dir);
     176
     177foreach (@headers){
     178  if(/ssl/){
     179    push @sslfilelist, '  $(OPENSSL_PATH)/' . $_ . "\r\n";
     180    next;
     181  }
     182  push @cryptofilelist, '  $(OPENSSL_PATH)/' . $_ . "\r\n";
     183}
     184
    146185
    147186#
     
    222261
    223262#
    224 # Copy opensslconf.h generated from OpenSSL Configuration
     263# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration
    225264#
    226265print "\n--> Duplicating opensslconf.h into Include/openssl ... ";
     
    228267     $OPENSSL_PATH . "/../../Include/openssl/") ||
    229268   die "Cannot copy opensslconf.h!";
     269print "Done!";
     270print "\n--> Duplicating dso_conf.h into Include/internal ... ";
     271copy($OPENSSL_PATH . "/include/internal/dso_conf.h",
     272     $OPENSSL_PATH . "/../../Include/internal/") ||
     273   die "Cannot copy dso_conf.h!";
    230274print "Done!\n";
    231275
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/OpensslLib/rand_pool.c

    r80953 r85718  
    134134
    135135  //
    136   // Chose an arbitary key and zero the feed_forward_value (FFV)
     136  // Chose an arbitrary key and zero the feed_forward_value (FFV)
    137137  //
    138138  for (Index = 0; Index < 16; Index++) {
     
    292292
    293293/*
    294  * Dummy Implememtation for UEFI
     294 * Dummy Implementation for UEFI
    295295 *
    296296 * This is OpenSSL required interface.
     
    302302
    303303/*
    304  * Dummy Implememtation for UEFI
     304 * Dummy Implementation for UEFI
    305305 *
    306306 * This is OpenSSL required interface.
     
    311311
    312312/*
    313  * Dummy Implememtation for UEFI
     313 * Dummy Implementation for UEFI
    314314 *
    315315 * This is OpenSSL required interface.
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/OpensslLib/rand_pool_noise.c

    r80721 r85718  
    2323{
    2424  //
    25   // Return FALSE will fallback to use PerformaceCounter to
     25  // Return FALSE will fallback to use PerformanceCounter to
    2626  // generate noise.
    2727  //
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/TlsLib/TlsConfig.c

    r80721 r85718  
    22  SSL/TLS Configuration Library Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
    55(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
    66SPDX-License-Identifier: BSD-2-Clause-Patent
     
    499499
    500500/**
     501  Set the specified host name to be verified.
     502
     503  @param[in]  Tls           Pointer to the TLS object.
     504  @param[in]  Flags         The setting flags during the validation.
     505  @param[in]  HostName      The specified host name to be verified.
     506
     507  @retval  EFI_SUCCESS           The HostName setting was set successfully.
     508  @retval  EFI_INVALID_PARAMETER The parameter is invalid.
     509  @retval  EFI_ABORTED           Invalid HostName setting.
     510
     511**/
     512EFI_STATUS
     513EFIAPI
     514TlsSetVerifyHost (
     515  IN     VOID                     *Tls,
     516  IN     UINT32                   Flags,
     517  IN     CHAR8                    *HostName
     518  )
     519{
     520  TLS_CONNECTION    *TlsConn;
     521  X509_VERIFY_PARAM *VerifyParam;
     522  UINTN             BinaryAddressSize;
     523  UINT8             BinaryAddress[MAX (NS_INADDRSZ, NS_IN6ADDRSZ)];
     524  INTN              ParamStatus;
     525
     526  TlsConn = (TLS_CONNECTION *) Tls;
     527  if (TlsConn == NULL || TlsConn->Ssl == NULL || HostName == NULL) {
     528     return EFI_INVALID_PARAMETER;
     529  }
     530
     531  SSL_set_hostflags(TlsConn->Ssl, Flags);
     532
     533  VerifyParam = SSL_get0_param (TlsConn->Ssl);
     534  ASSERT (VerifyParam != NULL);
     535
     536  BinaryAddressSize = 0;
     537  if (inet_pton (AF_INET6, HostName, BinaryAddress) == 1) {
     538    BinaryAddressSize = NS_IN6ADDRSZ;
     539  } else if (inet_pton (AF_INET, HostName, BinaryAddress) == 1) {
     540    BinaryAddressSize = NS_INADDRSZ;
     541  }
     542
     543  if (BinaryAddressSize > 0) {
     544    DEBUG ((DEBUG_VERBOSE, "%a:%a: parsed \"%a\" as an IPv%c address "
     545      "literal\n", gEfiCallerBaseName, __FUNCTION__, HostName,
     546      (UINTN)((BinaryAddressSize == NS_IN6ADDRSZ) ? '6' : '4')));
     547    ParamStatus = X509_VERIFY_PARAM_set1_ip (VerifyParam, BinaryAddress,
     548                    BinaryAddressSize);
     549  } else {
     550    ParamStatus = X509_VERIFY_PARAM_set1_host (VerifyParam, HostName, 0);
     551  }
     552
     553  return (ParamStatus == 1) ? EFI_SUCCESS : EFI_ABORTED;
     554}
     555
     556/**
    501557  Sets a TLS/SSL session ID to be used during TLS/SSL connect.
    502558
  • trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/TlsLib/TlsLib.inf

    r80721 r85718  
    33#
    44#  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
    5 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
     5#  (C) Copyright 2016-2020 Hewlett Packard Enterprise Development LP<BR>
    66#  SPDX-License-Identifier: BSD-2-Clause-Patent
    77#
     
    2020# The following information is for reference only and not required by the build tools.
    2121#
    22 #  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
     22#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64 RISCV64
    2323#
    2424
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette