VirtualBox

Ignore:
Timestamp:
Oct 28, 2015 8:17:18 PM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
5 deleted
46 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/Cryptest.c

    r48674 r58459  
    1 /** @file 
     1/** @file
    22  Application for Cryptographic Primitives Validation.
    33
    4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    7474  }
    7575
     76  Status = ValidateTSCounterSignature ();
     77  if (EFI_ERROR (Status)) {
     78    return Status;
     79  }
     80
    7681  Status = ValidateCryptDh ();
    7782  if (EFI_ERROR (Status)) {
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/Cryptest.h

    r48674 r58459  
    1 /** @file 
     1/** @file
    22  Application for Cryptographic Primitives Validation.
    33
    4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    110110
    111111/**
     112  Validate UEFI-OpenSSL RFC3161 Timestamp CounterSignature Verification Interfaces.
     113
     114  @retval  EFI_SUCCESS  Validation succeeded.
     115  @retval  EFI_ABORTED  Validation failed.
     116
     117**/
     118EFI_STATUS
     119ValidateTSCounterSignature (
     120  VOID
     121  );
     122
     123/**
    112124  Validate UEFI-OpenSSL DH Interfaces.
    113125
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/Cryptest.inf

    r48674 r58459  
    11## @file
    2 #  UEFI Application for the Validation of cryptography library
    3 #  (based on OpenSSL 0.9.8l).
    4 #  This is a shell application that will test the crypto library.
     2#  Shell application that will test the crypto library.
    53#
    6 #  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
     4#  UEFI Application for the Validation of cryptography library (based on OpenSSL 0.9.8zb).
     5#
     6#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    77#  This program and the accompanying materials
    88#  are licensed and made available under the terms and conditions of the BSD License
     
    1818  INF_VERSION                    = 0x00010005
    1919  BASE_NAME                      = Cryptest
     20  MODULE_UNI_FILE                = Cryptest.uni
    2021  FILE_GUID                      = fb925ac7-192a-9567-8586-7c6f5f710607
    2122  MODULE_TYPE                    = UEFI_APPLICATION
     
    3839  RsaVerify2.c
    3940  AuthenticodeVerify.c
     41  TSVerify.c
    4042  DhVerify.c
    4143  RandVerify.c
     
    5456  MemoryAllocationLib
    5557  BaseCryptLib
     58
     59[UserExtensions.TianoCore."ExtraFiles"]
     60  CryptestExtra.uni
     61 
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/DhVerify.c

    r48674 r58459  
    1 /** @file 
     1/** @file
    22  Application for Diffie-Hellman Primitives Validation.
    33
    4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    4141
    4242  Print (L"\nUEFI-OpenSSL DH Engine Testing:\n");
     43
     44  //
     45  // Initialize Key Length
     46  //
     47  PublicKey1Length = sizeof (PublicKey1);
     48  PublicKey2Length = sizeof (PublicKey2);
     49  Key1Length       = sizeof (Key1);
     50  Key2Length       = sizeof (Key2);
    4351
    4452  //
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/HashVerify.c

    r48674 r58459  
    1 /** @file 
     1/** @file
    22  Application for Hash Primitives Validation.
    33
    4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    5353  0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
    5454  0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c, 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad
     55  };
     56
     57//
     58// Result for SHA-384("abc"). (From "D.1 SHA-384 Example" of NIST FIPS 180-2)
     59//
     60GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 Sha384Digest[SHA384_DIGEST_SIZE] = {
     61  0xcb, 0x00, 0x75, 0x3f, 0x45, 0xa3, 0x5e, 0x8b, 0xb5, 0xa0, 0x3d, 0x69, 0x9a, 0xc6, 0x50, 0x07,
     62  0x27, 0x2c, 0x32, 0xab, 0x0e, 0xde, 0xd1, 0x63, 0x1a, 0x8b, 0x60, 0x5a, 0x43, 0xff, 0x5b, 0xed,
     63  0x80, 0x86, 0x07, 0x2b, 0xa1, 0xe7, 0xcc, 0x23, 0x58, 0xba, 0xec, 0xa1, 0x34, 0xc8, 0x25, 0xa7
     64  };
     65
     66//
     67// Result for SHA-512("abc"). (From "C.1 SHA-512 Example" of NIST FIPS 180-2)
     68//
     69GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 Sha512Digest[SHA512_DIGEST_SIZE] = {
     70  0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba, 0xcc, 0x41, 0x73, 0x49, 0xae, 0x20, 0x41, 0x31,
     71  0x12, 0xe6, 0xfa, 0x4e, 0x89, 0xa9, 0x7e, 0xa2, 0x0a, 0x9e, 0xee, 0xe6, 0x4b, 0x55, 0xd3, 0x9a,
     72  0x21, 0x92, 0x99, 0x2a, 0x27, 0x4f, 0xc1, 0xa8, 0x36, 0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd,
     73  0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e, 0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f
    5574  };
    5675
     
    7796
    7897  Print (L"- MD4:    ");
    79  
     98
    8099  //
    81100  // MD4 Digest Validation
     
    235254
    236255  Print (L"[Pass]\n");
    237  
     256
     257  Print (L"- SHA384: ");
     258
     259  //
     260  // SHA384 Digest Validation
     261  //
     262  ZeroMem (Digest, MAX_DIGEST_SIZE);
     263  CtxSize = Sha384GetContextSize ();
     264  HashCtx = AllocatePool (CtxSize);
     265
     266  Print (L"Init... ");
     267  Status  = Sha384Init (HashCtx);
     268  if (!Status) {
     269    Print (L"[Fail]");
     270    return EFI_ABORTED;
     271  }
     272
     273  Print (L"Update... ");
     274  Status  = Sha384Update (HashCtx, HashData, DataSize);
     275  if (!Status) {
     276    Print (L"[Fail]");
     277    return EFI_ABORTED;
     278  }
     279
     280  Print (L"Finalize... ");
     281  Status  = Sha384Final (HashCtx, Digest);
     282  if (!Status) {
     283    Print (L"[Fail]");
     284    return EFI_ABORTED;
     285  }
     286
     287  FreePool (HashCtx);
     288
     289  Print (L"Check Value... ");
     290  if (CompareMem (Digest, Sha384Digest, SHA384_DIGEST_SIZE) != 0) {
     291    Print (L"[Fail]");
     292    return EFI_ABORTED;
     293  }
     294
     295  Print (L"[Pass]\n");
     296
     297  Print (L"- SHA512: ");
     298
     299  //
     300  // SHA512 Digest Validation
     301  //
     302  ZeroMem (Digest, MAX_DIGEST_SIZE);
     303  CtxSize = Sha512GetContextSize ();
     304  HashCtx = AllocatePool (CtxSize);
     305
     306  Print (L"Init... ");
     307  Status  = Sha512Init (HashCtx);
     308  if (!Status) {
     309    Print (L"[Fail]");
     310    return EFI_ABORTED;
     311  }
     312
     313  Print (L"Update... ");
     314  Status  = Sha512Update (HashCtx, HashData, DataSize);
     315  if (!Status) {
     316    Print (L"[Fail]");
     317    return EFI_ABORTED;
     318  }
     319
     320  Print (L"Finalize... ");
     321  Status  = Sha512Final (HashCtx, Digest);
     322  if (!Status) {
     323    Print (L"[Fail]");
     324    return EFI_ABORTED;
     325  }
     326
     327  FreePool (HashCtx);
     328
     329  Print (L"Check Value... ");
     330  if (CompareMem (Digest, Sha512Digest, SHA512_DIGEST_SIZE) != 0) {
     331    Print (L"[Fail]");
     332    return EFI_ABORTED;
     333  }
     334
     335  Print (L"[Pass]\n");
     336
    238337  return EFI_SUCCESS;
    239338}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptRuntimeDxe/CryptRuntime.c

    r48674 r58459  
    206206  IN  CONST UINT8  *MessageHash,
    207207  IN  UINTN        HashLength,
    208   IN  UINT8        *Signature,
     208  IN  CONST UINT8  *Signature,
    209209  IN  UINTN        SigLength
    210210  )
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptRuntimeDxe/CryptRuntime.h

    r48674 r58459  
    180180  IN  CONST UINT8  *MessageHash,
    181181  IN  UINTN        HashLength,
    182   IN  UINT8        *Signature,
     182  IN  CONST UINT8  *Signature,
    183183  IN  UINTN        SigLength
    184184  );
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.inf

    r48674 r58459  
    11## @file
    2 Component description file for Cryptographic Runtime Driver.
     2This driver installs runtime Crypt protocol to provide SHA256 and RSA service.
    33#
    4 #  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = CryptRuntimeDxe
     18  MODULE_UNI_FILE                = CryptRuntimeDxe.uni
    1819  FILE_GUID                      = 858031F3-96A2-406E-ABCC-ED264A3A31D6
    1920  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
     
    4849[Depex]
    4950  TRUE
     51
     52[UserExtensions.TianoCore."ExtraFiles"]
     53  CryptRuntimeDxeExtra.uni
     54 
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptoPkg.dec

    r48674 r58459  
    22#  Package for cryptography modules.
    33#
    4 #  This Package provides cryptographic-related libraries for UEFI
    5 security modules.
     4#  This Package provides cryptographic-related libraries for UEFI security modules.
     5It also provides a test application to test libraries.
    66#
    7 #  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
     7#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
    88#  This program and the accompanying materials
    99#  are licensed and made available under the terms and conditions of the BSD License
     
    1919  DEC_SPECIFICATION              = 0x00010005
    2020  PACKAGE_NAME                   = CryptoPkg
     21  PACKAGE_UNI_FILE               = CryptoPkg.uni
    2122  PACKAGE_GUID                   = 36470E80-36F2-4ba0-8CC8-937C7D9FF888
    22   PACKAGE_VERSION                = 0.92
     23  PACKAGE_VERSION                = 0.96
    2324
    2425[Includes]
     
    3334  ## Include/Protocol/RuntimeCrypt.h
    3435  gEfiRuntimeCryptProtocolGuid = { 0xe1475e0c, 0x1746, 0x4802, {0x86, 0x2e, 0x1, 0x1c, 0x2c, 0x2d, 0x9d, 0x86 }}
     36
     37[UserExtensions.TianoCore."ExtraFiles"]
     38  CryptoPkgExtra.uni
     39 
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptoPkg.dsc

    r48674 r58459  
    22#  Cryptographic Library Package for UEFI Security Implementation.
    33#
    4 #  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
     
    2121  PLATFORM_NAME                  = CryptoPkg
    2222  PLATFORM_GUID                  = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
    23   PLATFORM_VERSION               = 0.92
     23  PLATFORM_VERSION               = 0.96
    2424  DSC_SPECIFICATION              = 0x00010005
    2525  OUTPUT_DIRECTORY               = Build/CryptoPkg
    26   SUPPORTED_ARCHITECTURES        = IA32|X64|IPF|ARM
     26  SUPPORTED_ARCHITECTURES        = IA32|X64|IPF|ARM|AARCH64
    2727  BUILD_TARGETS                  = DEBUG|RELEASE
    2828  SKUID_IDENTIFIER               = DEFAULT
     
    5252  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
    5353
    54 [LibraryClasses.ARM]
     54[LibraryClasses.ARM, LibraryClasses.AARCH64]
    5555  #
    5656  # It is not possible to prevent the ARM compiler for generic intrinsic functions.
    5757  # This library provides the instrinsic functions generate by a given compiler.
    58   # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
     58  # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
     59  # into all ARM and AARCH64 images.
    5960  #
    6061  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
     62
     63  # Add support for stack protector
     64  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
    6165
    6266[LibraryClasses.common.PEIM]
     
    8084[LibraryClasses.common.UEFI_APPLICATION]
    8185  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
     86
     87###############################################################################
     88#
     89# BuildOptions Section - Define the module specific tool chain flags that
     90#                        should be used as the default flags for a module.
     91#                        These flags are appended to any standard flags that
     92#                        are defined by the build process.
     93#
     94# -JCryptoPkg/Include : To disable the use of the system includes provided by
     95#                       the RVCT toolchain.
     96# --diag_remark=1     : To make the warning "#1-D: last line of file ends
     97#                       without a newline" just a remark such that the
     98#                       build doesn't stop as warnings are considered as
     99#                       errors.
     100#
     101################################################################################
     102[BuildOptions]
     103RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
    82104
    83105################################################################################
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Include/Library/BaseCryptLib.h

    r48674 r58459  
    55  functionality enabling.
    66
    7 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
     7Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
    88This program and the accompanying materials
    99are licensed and made available under the terms and conditions of the BSD License
     
    1919#define __BASE_CRYPT_LIB_H__
    2020
     21#include <Uefi/UefiBaseType.h>
     22
    2123///
    2224/// MD4 digest size in bytes
     
    3840///
    3941#define SHA256_DIGEST_SIZE  32
     42
     43///
     44/// SHA-384 digest size in bytes
     45///
     46#define SHA384_DIGEST_SIZE  48
     47
     48///
     49/// SHA-512 digest size in bytes
     50///
     51#define SHA512_DIGEST_SIZE  64
    4052
    4153///
     
    7082  Retrieves the size, in bytes, of the context buffer required for MD4 hash operations.
    7183
     84  If this interface is not supported, then return zero.
     85
    7286  @return  The size, in bytes, of the context buffer required for MD4 hash operations.
     87  @retval  0   This interface is not supported.
    7388
    7489**/
     
    8499
    85100  If Md4Context is NULL, then return FALSE.
     101  If this interface is not supported, then return FALSE.
    86102
    87103  @param[out]  Md4Context  Pointer to MD4 context being initialized.
     
    89105  @retval TRUE   MD4 context initialization succeeded.
    90106  @retval FALSE  MD4 context initialization failed.
     107  @retval FALSE  This interface is not supported.
    91108
    92109**/
     
    102119  If Md4Context is NULL, then return FALSE.
    103120  If NewMd4Context is NULL, then return FALSE.
     121  If this interface is not supported, then return FALSE.
    104122
    105123  @param[in]  Md4Context     Pointer to MD4 context being copied.
     
    108126  @retval TRUE   MD4 context copy succeeded.
    109127  @retval FALSE  MD4 context copy failed.
     128  @retval FALSE  This interface is not supported.
    110129
    111130**/
     
    126145
    127146  If Md4Context is NULL, then return FALSE.
     147  If this interface is not supported, then return FALSE.
    128148
    129149  @param[in, out]  Md4Context  Pointer to the MD4 context.
     
    133153  @retval TRUE   MD4 data digest succeeded.
    134154  @retval FALSE  MD4 data digest failed.
     155  @retval FALSE  This interface is not supported.
    135156
    136157**/
     
    154175  If Md4Context is NULL, then return FALSE.
    155176  If HashValue is NULL, then return FALSE.
     177  If this interface is not supported, then return FALSE.
    156178
    157179  @param[in, out]  Md4Context  Pointer to the MD4 context.
     
    161183  @retval TRUE   MD4 digest computation succeeded.
    162184  @retval FALSE  MD4 digest computation failed.
     185  @retval FALSE  This interface is not supported.
    163186
    164187**/
     
    173196  Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.
    174197
     198  If this interface is not supported, then return zero.
     199
    175200  @return  The size, in bytes, of the context buffer required for MD5 hash operations.
     201  @retval  0   This interface is not supported.
    176202
    177203**/
     
    187213
    188214  If Md5Context is NULL, then return FALSE.
     215  If this interface is not supported, then return FALSE.
    189216
    190217  @param[out]  Md5Context  Pointer to MD5 context being initialized.
     
    192219  @retval TRUE   MD5 context initialization succeeded.
    193220  @retval FALSE  MD5 context initialization failed.
     221  @retval FALSE  This interface is not supported.
    194222
    195223**/
     
    205233  If Md5Context is NULL, then return FALSE.
    206234  If NewMd5Context is NULL, then return FALSE.
     235  If this interface is not supported, then return FALSE.
    207236
    208237  @param[in]  Md5Context     Pointer to MD5 context being copied.
     
    211240  @retval TRUE   MD5 context copy succeeded.
    212241  @retval FALSE  MD5 context copy failed.
     242  @retval FALSE  This interface is not supported.
    213243
    214244**/
     
    229259
    230260  If Md5Context is NULL, then return FALSE.
     261  If this interface is not supported, then return FALSE.
    231262
    232263  @param[in, out]  Md5Context  Pointer to the MD5 context.
     
    236267  @retval TRUE   MD5 data digest succeeded.
    237268  @retval FALSE  MD5 data digest failed.
     269  @retval FALSE  This interface is not supported.
    238270
    239271**/
     
    257289  If Md5Context is NULL, then return FALSE.
    258290  If HashValue is NULL, then return FALSE.
     291  If this interface is not supported, then return FALSE.
    259292
    260293  @param[in, out]  Md5Context  Pointer to the MD5 context.
     
    264297  @retval TRUE   MD5 digest computation succeeded.
    265298  @retval FALSE  MD5 digest computation failed.
     299  @retval FALSE  This interface is not supported.
    266300
    267301**/
     
    276310  Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
    277311
     312  If this interface is not supported, then return zero.
     313
    278314  @return  The size, in bytes, of the context buffer required for SHA-1 hash operations.
     315  @retval  0   This interface is not supported.
    279316
    280317**/
     
    290327
    291328  If Sha1Context is NULL, then return FALSE.
     329  If this interface is not supported, then return FALSE.
    292330
    293331  @param[out]  Sha1Context  Pointer to SHA-1 context being initialized.
     
    295333  @retval TRUE   SHA-1 context initialization succeeded.
    296334  @retval FALSE  SHA-1 context initialization failed.
     335  @retval FALSE  This interface is not supported.
    297336
    298337**/
     
    308347  If Sha1Context is NULL, then return FALSE.
    309348  If NewSha1Context is NULL, then return FALSE.
     349  If this interface is not supported, then return FALSE.
    310350
    311351  @param[in]  Sha1Context     Pointer to SHA-1 context being copied.
     
    314354  @retval TRUE   SHA-1 context copy succeeded.
    315355  @retval FALSE  SHA-1 context copy failed.
     356  @retval FALSE  This interface is not supported.
    316357
    317358**/
     
    332373
    333374  If Sha1Context is NULL, then return FALSE.
     375  If this interface is not supported, then return FALSE.
    334376
    335377  @param[in, out]  Sha1Context  Pointer to the SHA-1 context.
     
    339381  @retval TRUE   SHA-1 data digest succeeded.
    340382  @retval FALSE  SHA-1 data digest failed.
     383  @retval FALSE  This interface is not supported.
    341384
    342385**/
     
    360403  If Sha1Context is NULL, then return FALSE.
    361404  If HashValue is NULL, then return FALSE.
     405  If this interface is not supported, then return FALSE.
    362406
    363407  @param[in, out]  Sha1Context  Pointer to the SHA-1 context.
     
    367411  @retval TRUE   SHA-1 digest computation succeeded.
    368412  @retval FALSE  SHA-1 digest computation failed.
     413  @retval FALSE  This interface is not supported.
    369414
    370415**/
     
    411456  If Sha256Context is NULL, then return FALSE.
    412457  If NewSha256Context is NULL, then return FALSE.
     458  If this interface is not supported, then return FALSE.
    413459
    414460  @param[in]  Sha256Context     Pointer to SHA-256 context being copied.
     
    417463  @retval TRUE   SHA-256 context copy succeeded.
    418464  @retval FALSE  SHA-256 context copy failed.
     465  @retval FALSE  This interface is not supported.
    419466
    420467**/
     
    479526  );
    480527
     528/**
     529  Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations.
     530
     531  @return  The size, in bytes, of the context buffer required for SHA-384 hash operations.
     532
     533**/
     534UINTN
     535EFIAPI
     536Sha384GetContextSize (
     537  VOID
     538  );
     539
     540/**
     541  Initializes user-supplied memory pointed by Sha384Context as SHA-384 hash context for
     542  subsequent use.
     543
     544  If Sha384Context is NULL, then return FALSE.
     545
     546  @param[out]  Sha384Context  Pointer to SHA-384 context being initialized.
     547
     548  @retval TRUE   SHA-384 context initialization succeeded.
     549  @retval FALSE  SHA-384 context initialization failed.
     550
     551**/
     552BOOLEAN
     553EFIAPI
     554Sha384Init (
     555  OUT  VOID  *Sha384Context
     556  );
     557
     558/**
     559  Makes a copy of an existing SHA-384 context.
     560
     561  If Sha384Context is NULL, then return FALSE.
     562  If NewSha384Context is NULL, then return FALSE.
     563  If this interface is not supported, then return FALSE.
     564
     565  @param[in]  Sha384Context     Pointer to SHA-384 context being copied.
     566  @param[out] NewSha384Context  Pointer to new SHA-384 context.
     567
     568  @retval TRUE   SHA-384 context copy succeeded.
     569  @retval FALSE  SHA-384 context copy failed.
     570  @retval FALSE  This interface is not supported.
     571
     572**/
     573BOOLEAN
     574EFIAPI
     575Sha384Duplicate (
     576  IN   CONST VOID  *Sha384Context,
     577  OUT  VOID        *NewSha384Context
     578  );
     579
     580/**
     581  Digests the input data and updates SHA-384 context.
     582
     583  This function performs SHA-384 digest on a data buffer of the specified size.
     584  It can be called multiple times to compute the digest of long or discontinuous data streams.
     585  SHA-384 context should be already correctly intialized by Sha384Init(), and should not be finalized
     586  by Sha384Final(). Behavior with invalid context is undefined.
     587
     588  If Sha384Context is NULL, then return FALSE.
     589
     590  @param[in, out]  Sha384Context  Pointer to the SHA-384 context.
     591  @param[in]       Data           Pointer to the buffer containing the data to be hashed.
     592  @param[in]       DataSize       Size of Data buffer in bytes.
     593
     594  @retval TRUE   SHA-384 data digest succeeded.
     595  @retval FALSE  SHA-384 data digest failed.
     596
     597**/
     598BOOLEAN
     599EFIAPI
     600Sha384Update (
     601  IN OUT  VOID        *Sha384Context,
     602  IN      CONST VOID  *Data,
     603  IN      UINTN       DataSize
     604  );
     605
     606/**
     607  Completes computation of the SHA-384 digest value.
     608
     609  This function completes SHA-384 hash computation and retrieves the digest value into
     610  the specified memory. After this function has been called, the SHA-384 context cannot
     611  be used again.
     612  SHA-384 context should be already correctly intialized by Sha384Init(), and should not be
     613  finalized by Sha384Final(). Behavior with invalid SHA-384 context is undefined.
     614
     615  If Sha384Context is NULL, then return FALSE.
     616  If HashValue is NULL, then return FALSE.
     617
     618  @param[in, out]  Sha384Context  Pointer to the SHA-384 context.
     619  @param[out]      HashValue      Pointer to a buffer that receives the SHA-384 digest
     620                                  value (48 bytes).
     621
     622  @retval TRUE   SHA-384 digest computation succeeded.
     623  @retval FALSE  SHA-384 digest computation failed.
     624
     625**/
     626BOOLEAN
     627EFIAPI
     628Sha384Final (
     629  IN OUT  VOID   *Sha384Context,
     630  OUT     UINT8  *HashValue
     631  );
     632
     633/**
     634  Retrieves the size, in bytes, of the context buffer required for SHA-512 hash operations.
     635
     636  @return  The size, in bytes, of the context buffer required for SHA-512 hash operations.
     637
     638**/
     639UINTN
     640EFIAPI
     641Sha512GetContextSize (
     642  VOID
     643  );
     644
     645/**
     646  Initializes user-supplied memory pointed by Sha512Context as SHA-512 hash context for
     647  subsequent use.
     648
     649  If Sha512Context is NULL, then return FALSE.
     650
     651  @param[out]  Sha512Context  Pointer to SHA-512 context being initialized.
     652
     653  @retval TRUE   SHA-512 context initialization succeeded.
     654  @retval FALSE  SHA-512 context initialization failed.
     655
     656**/
     657BOOLEAN
     658EFIAPI
     659Sha512Init (
     660  OUT  VOID  *Sha512Context
     661  );
     662
     663/**
     664  Makes a copy of an existing SHA-512 context.
     665
     666  If Sha512Context is NULL, then return FALSE.
     667  If NewSha512Context is NULL, then return FALSE.
     668  If this interface is not supported, then return FALSE.
     669
     670  @param[in]  Sha512Context     Pointer to SHA-512 context being copied.
     671  @param[out] NewSha512Context  Pointer to new SHA-512 context.
     672
     673  @retval TRUE   SHA-512 context copy succeeded.
     674  @retval FALSE  SHA-512 context copy failed.
     675  @retval FALSE  This interface is not supported.
     676
     677**/
     678BOOLEAN
     679EFIAPI
     680Sha512Duplicate (
     681  IN   CONST VOID  *Sha512Context,
     682  OUT  VOID        *NewSha512Context
     683  );
     684
     685/**
     686  Digests the input data and updates SHA-512 context.
     687
     688  This function performs SHA-512 digest on a data buffer of the specified size.
     689  It can be called multiple times to compute the digest of long or discontinuous data streams.
     690  SHA-512 context should be already correctly intialized by Sha512Init(), and should not be finalized
     691  by Sha512Final(). Behavior with invalid context is undefined.
     692
     693  If Sha512Context is NULL, then return FALSE.
     694
     695  @param[in, out]  Sha512Context  Pointer to the SHA-512 context.
     696  @param[in]       Data           Pointer to the buffer containing the data to be hashed.
     697  @param[in]       DataSize       Size of Data buffer in bytes.
     698
     699  @retval TRUE   SHA-512 data digest succeeded.
     700  @retval FALSE  SHA-512 data digest failed.
     701
     702**/
     703BOOLEAN
     704EFIAPI
     705Sha512Update (
     706  IN OUT  VOID        *Sha512Context,
     707  IN      CONST VOID  *Data,
     708  IN      UINTN       DataSize
     709  );
     710
     711/**
     712  Completes computation of the SHA-512 digest value.
     713
     714  This function completes SHA-512 hash computation and retrieves the digest value into
     715  the specified memory. After this function has been called, the SHA-512 context cannot
     716  be used again.
     717  SHA-512 context should be already correctly intialized by Sha512Init(), and should not be
     718  finalized by Sha512Final(). Behavior with invalid SHA-512 context is undefined.
     719
     720  If Sha512Context is NULL, then return FALSE.
     721  If HashValue is NULL, then return FALSE.
     722
     723  @param[in, out]  Sha512Context  Pointer to the SHA-512 context.
     724  @param[out]      HashValue      Pointer to a buffer that receives the SHA-512 digest
     725                                  value (64 bytes).
     726
     727  @retval TRUE   SHA-512 digest computation succeeded.
     728  @retval FALSE  SHA-512 digest computation failed.
     729
     730**/
     731BOOLEAN
     732EFIAPI
     733Sha512Final (
     734  IN OUT  VOID   *Sha512Context,
     735  OUT     UINT8  *HashValue
     736  );
    481737
    482738//=====================================================================================
     
    487743  Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
    488744
     745  If this interface is not supported, then return zero.
     746
    489747  @return  The size, in bytes, of the context buffer required for HMAC-MD5 operations.
     748  @retval  0   This interface is not supported.
    490749
    491750**/
     
    501760
    502761  If HmacMd5Context is NULL, then return FALSE.
     762  If this interface is not supported, then return FALSE.
    503763
    504764  @param[out]  HmacMd5Context  Pointer to HMAC-MD5 context being initialized.
     
    508768  @retval TRUE   HMAC-MD5 context initialization succeeded.
    509769  @retval FALSE  HMAC-MD5 context initialization failed.
     770  @retval FALSE  This interface is not supported.
    510771
    511772**/
     
    523784  If HmacMd5Context is NULL, then return FALSE.
    524785  If NewHmacMd5Context is NULL, then return FALSE.
     786  If this interface is not supported, then return FALSE.
    525787
    526788  @param[in]  HmacMd5Context     Pointer to HMAC-MD5 context being copied.
     
    529791  @retval TRUE   HMAC-MD5 context copy succeeded.
    530792  @retval FALSE  HMAC-MD5 context copy failed.
     793  @retval FALSE  This interface is not supported.
    531794
    532795**/
     
    547810
    548811  If HmacMd5Context is NULL, then return FALSE.
     812  If this interface is not supported, then return FALSE.
    549813
    550814  @param[in, out]  HmacMd5Context  Pointer to the HMAC-MD5 context.
     
    554818  @retval TRUE   HMAC-MD5 data digest succeeded.
    555819  @retval FALSE  HMAC-MD5 data digest failed.
     820  @retval FALSE  This interface is not supported.
    556821
    557822**/
     
    575840  If HmacMd5Context is NULL, then return FALSE.
    576841  If HashValue is NULL, then return FALSE.
     842  If this interface is not supported, then return FALSE.
    577843
    578844  @param[in, out]  HmacMd5Context  Pointer to the HMAC-MD5 context.
     
    582848  @retval TRUE   HMAC-MD5 digest computation succeeded.
    583849  @retval FALSE  HMAC-MD5 digest computation failed.
     850  @retval FALSE  This interface is not supported.
    584851
    585852**/
     
    594861  Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
    595862
     863  If this interface is not supported, then return zero.
     864
    596865  @return  The size, in bytes, of the context buffer required for HMAC-SHA1 operations.
     866  @retval  0   This interface is not supported.
    597867
    598868**/
     
    608878
    609879  If HmacSha1Context is NULL, then return FALSE.
     880  If this interface is not supported, then return FALSE.
    610881
    611882  @param[out]  HmacSha1Context  Pointer to HMAC-SHA1 context being initialized.
     
    615886  @retval TRUE   HMAC-SHA1 context initialization succeeded.
    616887  @retval FALSE  HMAC-SHA1 context initialization failed.
     888  @retval FALSE  This interface is not supported.
    617889
    618890**/
     
    630902  If HmacSha1Context is NULL, then return FALSE.
    631903  If NewHmacSha1Context is NULL, then return FALSE.
     904  If this interface is not supported, then return FALSE.
    632905
    633906  @param[in]  HmacSha1Context     Pointer to HMAC-SHA1 context being copied.
     
    636909  @retval TRUE   HMAC-SHA1 context copy succeeded.
    637910  @retval FALSE  HMAC-SHA1 context copy failed.
     911  @retval FALSE  This interface is not supported.
    638912
    639913**/
     
    654928
    655929  If HmacSha1Context is NULL, then return FALSE.
     930  If this interface is not supported, then return FALSE.
    656931
    657932  @param[in, out]  HmacSha1Context Pointer to the HMAC-SHA1 context.
     
    661936  @retval TRUE   HMAC-SHA1 data digest succeeded.
    662937  @retval FALSE  HMAC-SHA1 data digest failed.
     938  @retval FALSE  This interface is not supported.
    663939
    664940**/
     
    682958  If HmacSha1Context is NULL, then return FALSE.
    683959  If HashValue is NULL, then return FALSE.
     960  If this interface is not supported, then return FALSE.
    684961
    685962  @param[in, out]  HmacSha1Context  Pointer to the HMAC-SHA1 context.
     
    689966  @retval TRUE   HMAC-SHA1 digest computation succeeded.
    690967  @retval FALSE  HMAC-SHA1 digest computation failed.
     968  @retval FALSE  This interface is not supported.
    691969
    692970**/
     
    698976  );
    699977
    700 
    701978//=====================================================================================
    702979//    Symmetric Cryptography Primitive
     
    706983  Retrieves the size, in bytes, of the context buffer required for TDES operations.
    707984
     985  If this interface is not supported, then return zero.
     986
    708987  @return  The size, in bytes, of the context buffer required for TDES operations.
     988  @retval  0   This interface is not supported.
    709989
    710990**/
     
    719999
    7201000  This function initializes user-supplied memory pointed by TdesContext as TDES context.
    721   In addtion, it sets up all TDES key materials for subsequent encryption and decryption
     1001  In addition, it sets up all TDES key materials for subsequent encryption and decryption
    7221002  operations.
    7231003  There are 3 key options as follows:
     
    7291009  If Key is NULL, then return FALSE.
    7301010  If KeyLength is not valid, then return FALSE.
     1011  If this interface is not supported, then return FALSE.
    7311012
    7321013  @param[out]  TdesContext  Pointer to TDES context being initialized.
     
    7361017  @retval TRUE   TDES context initialization succeeded.
    7371018  @retval FALSE  TDES context initialization failed.
     1019  @retval FALSE  This interface is not supported.
    7381020
    7391021**/
     
    7601042  If InputSize is not multiple of block size (8 bytes), then return FALSE.
    7611043  If Output is NULL, then return FALSE.
     1044  If this interface is not supported, then return FALSE.
    7621045
    7631046  @param[in]   TdesContext  Pointer to the TDES context.
     
    7681051  @retval TRUE   TDES encryption succeeded.
    7691052  @retval FALSE  TDES encryption failed.
     1053  @retval FALSE  This interface is not supported.
    7701054
    7711055**/
     
    7931077  If InputSize is not multiple of block size (8 bytes), then return FALSE.
    7941078  If Output is NULL, then return FALSE.
     1079  If this interface is not supported, then return FALSE.
    7951080
    7961081  @param[in]   TdesContext  Pointer to the TDES context.
     
    8011086  @retval TRUE   TDES decryption succeeded.
    8021087  @retval FALSE  TDES decryption failed.
     1088  @retval FALSE  This interface is not supported.
    8031089
    8041090**/
     
    8281114  If Ivec is NULL, then return FALSE.
    8291115  If Output is NULL, then return FALSE.
     1116  If this interface is not supported, then return FALSE.
    8301117
    8311118  @param[in]   TdesContext  Pointer to the TDES context.
     
    8371124  @retval TRUE   TDES encryption succeeded.
    8381125  @retval FALSE  TDES encryption failed.
     1126  @retval FALSE  This interface is not supported.
    8391127
    8401128**/
     
    8651153  If Ivec is NULL, then return FALSE.
    8661154  If Output is NULL, then return FALSE.
     1155  If this interface is not supported, then return FALSE.
    8671156
    8681157  @param[in]   TdesContext  Pointer to the TDES context.
     
    8741163  @retval TRUE   TDES decryption succeeded.
    8751164  @retval FALSE  TDES decryption failed.
     1165  @retval FALSE  This interface is not supported.
    8761166
    8771167**/
     
    8891179  Retrieves the size, in bytes, of the context buffer required for AES operations.
    8901180
     1181  If this interface is not supported, then return zero.
     1182
    8911183  @return  The size, in bytes, of the context buffer required for AES operations.
     1184  @retval  0   This interface is not supported.
    8921185
    8931186**/
     
    9021195
    9031196  This function initializes user-supplied memory pointed by AesContext as AES context.
    904   In addtion, it sets up all AES key materials for subsequent encryption and decryption
     1197  In addition, it sets up all AES key materials for subsequent encryption and decryption
    9051198  operations.
    9061199  There are 3 options for key length, 128 bits, 192 bits, and 256 bits.
     
    9091202  If Key is NULL, then return FALSE.
    9101203  If KeyLength is not valid, then return FALSE.
     1204  If this interface is not supported, then return FALSE.
    9111205
    9121206  @param[out]  AesContext  Pointer to AES context being initialized.
     
    9161210  @retval TRUE   AES context initialization succeeded.
    9171211  @retval FALSE  AES context initialization failed.
     1212  @retval FALSE  This interface is not supported.
    9181213
    9191214**/
     
    9401235  If InputSize is not multiple of block size (16 bytes), then return FALSE.
    9411236  If Output is NULL, then return FALSE.
     1237  If this interface is not supported, then return FALSE.
    9421238
    9431239  @param[in]   AesContext  Pointer to the AES context.
     
    9481244  @retval TRUE   AES encryption succeeded.
    9491245  @retval FALSE  AES encryption failed.
     1246  @retval FALSE  This interface is not supported.
    9501247
    9511248**/
     
    9731270  If InputSize is not multiple of block size (16 bytes), then return FALSE.
    9741271  If Output is NULL, then return FALSE.
     1272  If this interface is not supported, then return FALSE.
    9751273
    9761274  @param[in]   AesContext  Pointer to the AES context.
     
    9811279  @retval TRUE   AES decryption succeeded.
    9821280  @retval FALSE  AES decryption failed.
     1281  @retval FALSE  This interface is not supported.
    9831282
    9841283**/
     
    10081307  If Ivec is NULL, then return FALSE.
    10091308  If Output is NULL, then return FALSE.
     1309  If this interface is not supported, then return FALSE.
    10101310
    10111311  @param[in]   AesContext  Pointer to the AES context.
     
    10171317  @retval TRUE   AES encryption succeeded.
    10181318  @retval FALSE  AES encryption failed.
     1319  @retval FALSE  This interface is not supported.
    10191320
    10201321**/
     
    10451346  If Ivec is NULL, then return FALSE.
    10461347  If Output is NULL, then return FALSE.
     1348  If this interface is not supported, then return FALSE.
    10471349
    10481350  @param[in]   AesContext  Pointer to the AES context.
     
    10541356  @retval TRUE   AES decryption succeeded.
    10551357  @retval FALSE  AES decryption failed.
     1358  @retval FALSE  This interface is not supported.
    10561359
    10571360**/
     
    10691372  Retrieves the size, in bytes, of the context buffer required for ARC4 operations.
    10701373
     1374  If this interface is not supported, then return zero.
     1375
    10711376  @return  The size, in bytes, of the context buffer required for ARC4 operations.
     1377  @retval  0   This interface is not supported.
    10721378
    10731379**/
     
    10821388
    10831389  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.
    1084   In addtion, it sets up all ARC4 key materials for subsequent encryption and decryption
     1390  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption
    10851391  operations.
    10861392
     
    10881394  If Key is NULL, then return FALSE.
    10891395  If KeySize does not in the range of [5, 256] bytes, then return FALSE.
     1396  If this interface is not supported, then return FALSE.
    10901397
    10911398  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.
     
    10951402  @retval TRUE   ARC4 context initialization succeeded.
    10961403  @retval FALSE  ARC4 context initialization failed.
     1404  @retval FALSE  This interface is not supported.
    10971405
    10981406**/
     
    11161424  If Input is NULL, then return FALSE.
    11171425  If Output is NULL, then return FALSE.
     1426  If this interface is not supported, then return FALSE.
    11181427
    11191428  @param[in]   Arc4Context  Pointer to the ARC4 context.
     
    11241433  @retval TRUE   ARC4 encryption succeeded.
    11251434  @retval FALSE  ARC4 encryption failed.
     1435  @retval FALSE  This interface is not supported.
    11261436
    11271437**/
     
    11461456  If Input is NULL, then return FALSE.
    11471457  If Output is NULL, then return FALSE.
     1458  If this interface is not supported, then return FALSE.
    11481459
    11491460  @param[in]   Arc4Context  Pointer to the ARC4 context.
     
    11541465  @retval TRUE   ARC4 decryption succeeded.
    11551466  @retval FALSE  ARC4 decryption failed.
     1467  @retval FALSE  This interface is not supported.
    11561468
    11571469**/
     
    11741486
    11751487  If Arc4Context is NULL, then return FALSE.
     1488  If this interface is not supported, then return FALSE.
    11761489
    11771490  @param[in, out]  Arc4Context  Pointer to the ARC4 context.
     
    11791492  @retval TRUE   ARC4 reset succeeded.
    11801493  @retval FALSE  ARC4 reset failed.
     1494  @retval FALSE  This interface is not supported.
    11811495
    11821496**/
     
    12631577  If BnSize is NULL, then return FALSE.
    12641578  If BnSize is large enough but BigNumber is NULL, then return FALSE.
     1579  If this interface is not supported, then return FALSE.
    12651580
    12661581  @param[in, out]  RsaContext  Pointer to RSA context being set.
     
    12731588  @retval  FALSE  Invalid RSA key component tag.
    12741589  @retval  FALSE  BnSize is too small.
     1590  @retval  FALSE  This interface is not supported.
    12751591
    12761592**/
     
    12951611
    12961612  If RsaContext is NULL, then return FALSE.
     1613  If this interface is not supported, then return FALSE.
    12971614
    12981615  @param[in, out]  RsaContext           Pointer to RSA context being set.
    12991616  @param[in]       ModulusLength        Length of RSA modulus N in bits.
    13001617  @param[in]       PublicExponent       Pointer to RSA public exponent.
    1301   @param[in]       PublicExponentSize   Size of RSA public exponent buffer in bytes. 
     1618  @param[in]       PublicExponentSize   Size of RSA public exponent buffer in bytes.
    13021619
    13031620  @retval  TRUE   RSA key component was generated successfully.
    13041621  @retval  FALSE  Invalid RSA key component tag.
     1622  @retval  FALSE  This interface is not supported.
    13051623
    13061624**/
     
    13161634/**
    13171635  Validates key components of RSA context.
     1636  NOTE: This function performs integrity checks on all the RSA key material, so
     1637        the RSA key structure must contain all the private key data.
    13181638
    13191639  This function validates key compoents of RSA context in following aspects:
     
    13241644
    13251645  If RsaContext is NULL, then return FALSE.
     1646  If this interface is not supported, then return FALSE.
    13261647
    13271648  @param[in]  RsaContext  Pointer to RSA context to check.
     
    13291650  @retval  TRUE   RSA key components are valid.
    13301651  @retval  FALSE  RSA key components are not valid.
     1652  @retval  FALSE  This interface is not supported.
    13311653
    13321654**/
     
    13491671  If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
    13501672  If SigSize is large enough but Signature is NULL, then return FALSE.
     1673  If this interface is not supported, then return FALSE.
    13511674
    13521675  @param[in]      RsaContext   Pointer to RSA context for signature generation.
     
    13601683  @retval  FALSE  Signature generation failed.
    13611684  @retval  FALSE  SigSize is too small.
     1685  @retval  FALSE  This interface is not supported.
    13621686
    13631687**/
     
    13971721  IN  CONST UINT8  *MessageHash,
    13981722  IN  UINTN        HashSize,
    1399   IN  UINT8        *Signature,
     1723  IN  CONST UINT8  *Signature,
    14001724  IN  UINTN        SigSize
    14011725  );
     
    14031727/**
    14041728  Retrieve the RSA Private Key from the password-protected PEM key data.
     1729
     1730  If PemData is NULL, then return FALSE.
     1731  If RsaContext is NULL, then return FALSE.
     1732  If this interface is not supported, then return FALSE.
    14051733
    14061734  @param[in]  PemData      Pointer to the PEM-encoded key data to be retrieved.
     
    14111739                           resource.
    14121740
    1413   If PemData is NULL, then return FALSE.
    1414   If RsaContext is NULL, then return FALSE.
    1415 
    14161741  @retval  TRUE   RSA Private Key was retrieved successfully.
    14171742  @retval  FALSE  Invalid PEM key data or incorrect password.
     1743  @retval  FALSE  This interface is not supported.
    14181744
    14191745**/
     
    14301756  Retrieve the RSA Public Key from one DER-encoded X509 certificate.
    14311757
     1758  If Cert is NULL, then return FALSE.
     1759  If RsaContext is NULL, then return FALSE.
     1760  If this interface is not supported, then return FALSE.
     1761
    14321762  @param[in]  Cert         Pointer to the DER-encoded X509 certificate.
    14331763  @param[in]  CertSize     Size of the X509 certificate in bytes.
     
    14361766                           resource.
    14371767
    1438   If Cert is NULL, then return FALSE.
    1439   If RsaContext is NULL, then return FALSE.
    1440 
    14411768  @retval  TRUE   RSA Public Key was retrieved successfully.
    14421769  @retval  FALSE  Fail to retrieve RSA public key from X509 certificate.
     1770  @retval  FALSE  This interface is not supported.
    14431771
    14441772**/
     
    14531781/**
    14541782  Retrieve the subject bytes from one X.509 certificate.
     1783
     1784  If Cert is NULL, then return FALSE.
     1785  If SubjectSize is NULL, then return FALSE.
     1786  If this interface is not supported, then return FALSE.
    14551787
    14561788  @param[in]      Cert         Pointer to the DER-encoded X509 certificate.
     
    14601792                               and the size of buffer returned CertSubject on output.
    14611793
    1462   If Cert is NULL, then return FALSE.
    1463   If SubjectSize is NULL, then return FALSE.
    1464 
    14651794  @retval  TRUE   The certificate subject retrieved successfully.
    14661795  @retval  FALSE  Invalid certificate, or the SubjectSize is too small for the result.
    14671796                  The SubjectSize will be updated with the required size.
     1797  @retval  FALSE  This interface is not supported.
    14681798
    14691799**/
     
    14801810  Verify one X509 certificate was issued by the trusted CA.
    14811811
     1812  If Cert is NULL, then return FALSE.
     1813  If CACert is NULL, then return FALSE.
     1814  If this interface is not supported, then return FALSE.
     1815
    14821816  @param[in]      Cert         Pointer to the DER-encoded X509 certificate to be verified.
    14831817  @param[in]      CertSize     Size of the X509 certificate in bytes.
     
    14851819  @param[in]      CACertSize   Size of the CA Certificate in bytes.
    14861820
    1487   If Cert is NULL, then return FALSE.
    1488   If CACert is NULL, then return FALSE.
    1489 
    14901821  @retval  TRUE   The certificate was issued by the trusted CA.
    14911822  @retval  FALSE  Invalid certificate or the certificate was not issued by the given
    14921823                  trusted CA.
     1824  @retval  FALSE  This interface is not supported.
    14931825
    14941826**/
     
    15071839  If Cert is NULL, then return FALSE.
    15081840  If SingleX509Cert is NULL, then return FALSE.
     1841  If this interface is not supported, then return FALSE.
    15091842
    15101843  @param[in]  Cert            Pointer to the DER-encoded certificate data.
     
    15141847  @retval     TRUE            The X509 object generation succeeded.
    15151848  @retval     FALSE           The operation failed.
     1849  @retval     FALSE           This interface is not supported.
    15161850
    15171851**/
     
    15281862
    15291863  If X509Stack is NULL, then return FALSE.
    1530 
    1531   @param[in, out]  X509Stack  On input, pointer to an existing X509 stack object.
     1864  If this interface is not supported, then return FALSE.
     1865
     1866  @param[in, out]  X509Stack  On input, pointer to an existing or NULL X509 stack object.
    15321867                              On output, pointer to the X509 stack object with new
    15331868                              inserted X509 certificate.
     
    15351870                              by certificate size. A NULL terminates the list. The
    15361871                              pairs are the arguments to X509ConstructCertificate().
    1537                                  
     1872
    15381873  @retval     TRUE            The X509 stack construction succeeded.
    15391874  @retval     FALSE           The construction operation failed.
     1875  @retval     FALSE           This interface is not supported.
    15401876
    15411877**/
     
    15441880X509ConstructCertificateStack (
    15451881  IN OUT  UINT8  **X509Stack,
    1546   ... 
     1882  ...
    15471883  );
    15481884
     
    15501886  Release the specified X509 object.
    15511887
    1552   If X509Cert is NULL, then return FALSE.
     1888  If the interface is not supported, then ASSERT().
    15531889
    15541890  @param[in]  X509Cert  Pointer to the X509 object to be released.
     
    15641900  Release the specified X509 stack object.
    15651901
    1566   If X509Stack is NULL, then return FALSE.
     1902  If the interface is not supported, then ASSERT().
    15671903
    15681904  @param[in]  X509Stack  Pointer to the X509 stack object to be released.
     
    15731909X509StackFree (
    15741910  IN  VOID  *X509Stack
     1911  );
     1912
     1913/**
     1914  Retrieve the TBSCertificate from one given X.509 certificate.
     1915
     1916  @param[in]      Cert         Pointer to the given DER-encoded X509 certificate.
     1917  @param[in]      CertSize     Size of the X509 certificate in bytes.
     1918  @param[out]     TBSCert      DER-Encoded To-Be-Signed certificate.
     1919  @param[out]     TBSCertSize  Size of the TBS certificate in bytes.
     1920
     1921  If Cert is NULL, then return FALSE.
     1922  If TBSCert is NULL, then return FALSE.
     1923  If TBSCertSize is NULL, then return FALSE.
     1924  If this interface is not supported, then return FALSE.
     1925
     1926  @retval  TRUE   The TBSCertificate was retrieved successfully.
     1927  @retval  FALSE  Invalid X.509 certificate.
     1928
     1929**/
     1930BOOLEAN
     1931EFIAPI
     1932X509GetTBSCert (
     1933  IN  CONST UINT8  *Cert,
     1934  IN  UINTN        CertSize,
     1935  OUT UINT8        **TBSCert,
     1936  OUT UINTN        *TBSCertSize
    15751937  );
    15761938
     
    15821944  If P7Data, CertStack, StackLength, TrustedCert or CertLength is NULL, then
    15831945  return FALSE. If P7Length overflow, then return FAlSE.
     1946  If this interface is not supported, then return FALSE.
    15841947
    15851948  @param[in]  P7Data       Pointer to the PKCS#7 message to verify.
     
    15941957  @retval  TRUE            The operation is finished successfully.
    15951958  @retval  FALSE           Error occurs during the operation.
     1959  @retval  FALSE           This interface is not supported.
    15961960
    15971961**/
     
    16101974  Wrap function to use free() to free allocated memory for certificates.
    16111975
     1976  If this interface is not supported, then ASSERT().
     1977
    16121978  @param[in]  Certs        Pointer to the certificates to be freed.
    16131979
     
    16231989  Syntax Standard, version 1.5". This interface is only intended to be used for
    16241990  application to perform PKCS#7 functionality validation.
     1991
     1992  If this interface is not supported, then return FALSE.
    16251993
    16261994  @param[in]  PrivateKey       Pointer to the PEM-formatted private key data for
     
    16402008  @retval     TRUE             PKCS#7 data signing succeeded.
    16412009  @retval     FALSE            PKCS#7 data signing failed.
     2010  @retval     FALSE            This interface is not supported.
    16422011
    16432012**/
     
    16632032  If P7Data, TrustedCert or InData is NULL, then return FALSE.
    16642033  If P7Length, CertLength or DataLength overflow, then return FAlSE.
     2034  If this interface is not supported, then return FALSE.
    16652035
    16662036  @param[in]  P7Data       Pointer to the PKCS#7 message to verify.
     
    16742044  @retval  TRUE  The specified PKCS#7 signed data is valid.
    16752045  @retval  FALSE Invalid PKCS#7 signed data.
     2046  @retval  FALSE This interface is not supported.
    16762047
    16772048**/
     
    16882059
    16892060/**
     2061  Extracts the attached content from a PKCS#7 signed data if existed. The input signed
     2062  data could be wrapped in a ContentInfo structure.
     2063
     2064  If P7Data, Content, or ContentSize is NULL, then return FALSE. If P7Length overflow,
     2065  then return FAlSE. If the P7Data is not correctly formatted, then return FALSE.
     2066
     2067  Caution: This function may receive untrusted input. So this function will do
     2068           basic check for PKCS#7 data structure.
     2069
     2070  @param[in]   P7Data       Pointer to the PKCS#7 signed data to process.
     2071  @param[in]   P7Length     Length of the PKCS#7 signed data in bytes.
     2072  @param[out]  Content      Pointer to the extracted content from the PKCS#7 signedData.
     2073                            It's caller's responsiblity to free the buffer.
     2074  @param[out]  ContentSize  The size of the extracted content in bytes.
     2075
     2076  @retval     TRUE          The P7Data was correctly formatted for processing.
     2077  @retval     FALSE         The P7Data was not correctly formatted for processing.
     2078
     2079*/
     2080BOOLEAN
     2081EFIAPI
     2082Pkcs7GetAttachedContent (
     2083  IN  CONST UINT8  *P7Data,
     2084  IN  UINTN        P7Length,
     2085  OUT VOID         **Content,
     2086  OUT UINTN        *ContentSize
     2087  );
     2088
     2089/**
    16902090  Verifies the validility of a PE/COFF Authenticode Signature as described in "Windows
    16912091  Authenticode Portable Executable Signature Format".
     
    16932093  If AuthData is NULL, then return FALSE.
    16942094  If ImageHash is NULL, then return FALSE.
     2095  If this interface is not supported, then return FALSE.
    16952096
    16962097  @param[in]  AuthData     Pointer to the Authenticode Signature retrieved from signed
     
    17072108  @retval  TRUE   The specified Authenticode Signature is valid.
    17082109  @retval  FALSE  Invalid Authenticode Signature.
     2110  @retval  FALSE  This interface is not supported.
    17092111
    17102112**/
     
    17202122  );
    17212123
     2124/**
     2125  Verifies the validility of a RFC3161 Timestamp CounterSignature embedded in PE/COFF Authenticode
     2126  signature.
     2127
     2128  If AuthData is NULL, then return FALSE.
     2129  If this interface is not supported, then return FALSE.
     2130
     2131  @param[in]  AuthData     Pointer to the Authenticode Signature retrieved from signed
     2132                           PE/COFF image to be verified.
     2133  @param[in]  DataSize     Size of the Authenticode Signature in bytes.
     2134  @param[in]  TsaCert      Pointer to a trusted/root TSA certificate encoded in DER, which
     2135                           is used for TSA certificate chain verification.
     2136  @param[in]  CertSize     Size of the trusted certificate in bytes.
     2137  @param[out] SigningTime  Return the time of timestamp generation time if the timestamp
     2138                           signature is valid.
     2139
     2140  @retval  TRUE   The specified Authenticode includes a valid RFC3161 Timestamp CounterSignature.
     2141  @retval  FALSE  No valid RFC3161 Timestamp CounterSignature in the specified Authenticode data.
     2142
     2143**/
     2144BOOLEAN
     2145EFIAPI
     2146ImageTimestampVerify (
     2147  IN  CONST UINT8  *AuthData,
     2148  IN  UINTN        DataSize,
     2149  IN  CONST UINT8  *TsaCert,
     2150  IN  UINTN        CertSize,
     2151  OUT EFI_TIME     *SigningTime
     2152  );
     2153
    17222154//=====================================================================================
    17232155//    DH Key Exchange Primitive
     
    17292161  @return  Pointer to the Diffie-Hellman Context that has been initialized.
    17302162           If the allocations fails, DhNew() returns NULL.
     2163           If the interface is not supported, DhNew() returns NULL.
    17312164
    17322165**/
     
    17402173  Release the specified DH context.
    17412174
    1742   If DhContext is NULL, then return FALSE.
     2175  If the interface is not supported, then ASSERT().
    17432176
    17442177  @param[in]  DhContext  Pointer to the DH context to be released.
     
    17562189  Given generator g, and length of prime number p in bits, this function generates p,
    17572190  and sets DH context according to value of g and p.
    1758  
     2191
    17592192  Before this function can be invoked, pseudorandom number generator must be correctly
    17602193  initialized by RandomSeed().
     
    17622195  If DhContext is NULL, then return FALSE.
    17632196  If Prime is NULL, then return FALSE.
     2197  If this interface is not supported, then return FALSE.
    17642198
    17652199  @param[in, out]  DhContext    Pointer to the DH context.
     
    17712205  @retval FALSE  Value of Generator is not supported.
    17722206  @retval FALSE  PRNG fails to generate random prime number with PrimeLength.
     2207  @retval FALSE  This interface is not supported.
    17732208
    17742209**/
     
    17902225  If DhContext is NULL, then return FALSE.
    17912226  If Prime is NULL, then return FALSE.
     2227  If this interface is not supported, then return FALSE.
    17922228
    17932229  @param[in, out]  DhContext    Pointer to the DH context.
     
    18012237  @retval FALSE  Value of Prime is not a prime number.
    18022238  @retval FALSE  Value of Prime is not a safe prime number.
     2239  @retval FALSE  This interface is not supported.
    18032240
    18042241**/
     
    18152252  Generates DH public key.
    18162253
    1817   This function generates random secret exponent, and computes the public key, which is 
     2254  This function generates random secret exponent, and computes the public key, which is
    18182255  returned via parameter PublicKey and PublicKeySize. DH context is updated accordingly.
    18192256  If the PublicKey buffer is too small to hold the public key, FALSE is returned and
     
    18232260  If PublicKeySize is NULL, then return FALSE.
    18242261  If PublicKeySize is large enough but PublicKey is NULL, then return FALSE.
     2262  If this interface is not supported, then return FALSE.
    18252263
    18262264  @param[in, out]  DhContext      Pointer to the DH context.
     
    18322270  @retval FALSE  DH public key generation failed.
    18332271  @retval FALSE  PublicKeySize is not large enough.
     2272  @retval FALSE  This interface is not supported.
    18342273
    18352274**/
     
    18462285
    18472286  Given peer's public key, this function computes the exchanged common key, based on its own
    1848   context including value of prime modulus and random secret exponent. 
     2287  context including value of prime modulus and random secret exponent.
    18492288
    18502289  If DhContext is NULL, then return FALSE.
    18512290  If PeerPublicKey is NULL, then return FALSE.
    18522291  If KeySize is NULL, then return FALSE.
    1853   If KeySize is large enough but Key is NULL, then return FALSE.
     2292  If Key is NULL, then return FALSE.
     2293  If KeySize is not large enough, then return FALSE.
     2294  If this interface is not supported, then return FALSE.
    18542295
    18552296  @param[in, out]  DhContext          Pointer to the DH context.
     
    18632304  @retval FALSE  DH exchanged key generation failed.
    18642305  @retval FALSE  KeySize is not large enough.
     2306  @retval FALSE  This interface is not supported.
    18652307
    18662308**/
     
    18852327  If Seed is not NULL, then the seed passed in is used.
    18862328  If Seed is NULL, then default seed is used.
     2329  If this interface is not supported, then return FALSE.
    18872330
    18882331  @param[in]  Seed      Pointer to seed value.
     
    18932336  @retval TRUE   Pseudorandom number generator has enough entropy for random generation.
    18942337  @retval FALSE  Pseudorandom number generator does not have enough entropy for random generation.
     2338  @retval FALSE  This interface is not supported.
    18952339
    18962340**/
     
    19062350
    19072351  If Output is NULL, then return FALSE.
     2352  If this interface is not supported, then return FALSE.
    19082353
    19092354  @param[out]  Output  Pointer to buffer to receive random value.
     
    19122357  @retval TRUE   Pseudorandom byte stream generated successfully.
    19132358  @retval FALSE  Pseudorandom number generator fails to generate due to lack of entropy.
     2359  @retval FALSE  This interface is not supported.
    19142360
    19152361**/
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Include/OpenSslSupport.h

    r48674 r58459  
    22  Root include file to support building OpenSSL Crypto Library.
    33
    4 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    7373   For pre-Standard C compilers, here is a version that usually works
    7474   (but watch out!): */
    75 #define offsetof(type, member) ( (int) & ((type*)0) -> member )
     75#define offsetof(type, member) OFFSET_OF (type, member)
    7676
    7777//
     
    109109  char  *tm_zone;   /* timezone abbreviation */
    110110};
     111
     112struct timeval {
     113  long tv_sec;      /* time value, in seconds */
     114  long tv_usec;     /* time value, in microseconds */
     115} timeval;
    111116
    112117struct dirent {
     
    241246#define localtime(timer)                  NULL
    242247#define gmtime_r(timer,result)            (result = NULL)
     248#define atoi(nptr)                        AsciiStrDecimalToUintn(nptr)
    243249
    244250#endif
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Include/Protocol/RuntimeCrypt.h

    r48674 r58459  
    182182  IN  CONST UINT8  *MessageHash,
    183183  IN  UINTN        HashLength,
    184   IN  UINT8        *Signature,
     184  IN  CONST UINT8  *Signature,
    185185  IN  UINTN        SigLength
    186186  );
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf

    r48674 r58459  
    22#  Cryptographic Library Instance for DXE_DRIVER.
    33#
    4 #  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
     4#  Caution: This module requires additional review when modified.
     5#  This library will have external input - signature.
     6#  This external input must be validated carefully to avoid security issues such as
     7#  buffer overflow or integer overflow.
     8#
     9#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    510#  This program and the accompanying materials
    611#  are licensed and made available under the terms and conditions of the BSD License
    712#  which accompanies this distribution.  The full text of the license may be found at
    813#  http://opensource.org/licenses/bsd-license.php
    9 # 
     14#
    1015#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1116#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    12 # 
     17#
    1318##
    1419
     
    1621  INF_VERSION                    = 0x00010005
    1722  BASE_NAME                      = BaseCryptLib
     23  MODULE_UNI_FILE                = BaseCryptLib.uni
    1824  FILE_GUID                      = be3bb803-91b6-4da0-bd91-a8b21c18ca5d
    19   MODULE_TYPE                    = BASE
     25  MODULE_TYPE                    = DXE_DRIVER
    2026  VERSION_STRING                 = 1.0
    21   LIBRARY_CLASS                  = BaseCryptLib
     27  LIBRARY_CLASS                  = BaseCryptLib|DXE_DRIVER DXE_CORE UEFI_APPLICATION UEFI_DRIVER
    2228
    2329#
    2430# The following information is for reference only and not required by the build tools.
    2531#
    26 #  VALID_ARCHITECTURES           = IA32 X64 IPF ARM
     32#  VALID_ARCHITECTURES           = IA32 X64 IPF ARM AARCH64
    2733#
    2834
     
    3339  Hash/CryptSha1.c
    3440  Hash/CryptSha256.c
     41  Hash/CryptSha512.c
    3542  Hmac/CryptHmacMd5.c
    3643  Hmac/CryptHmacSha1.c
     
    3845  Cipher/CryptTdes.c
    3946  Cipher/CryptArc4.c
    40   Pk/CryptRsa.c
    41   Pk/CryptPkcs7.c
     47  Pk/CryptRsaBasic.c
     48  Pk/CryptRsaExt.c
     49  Pk/CryptPkcs7Sign.c
     50  Pk/CryptPkcs7Verify.c
    4251  Pk/CryptDh.c
    4352  Pk/CryptX509.c
    4453  Pk/CryptAuthenticode.c
     54  Pk/CryptTs.c
    4555  Pem/CryptPem.c
    4656
     
    5060
    5161[Sources.Ia32]
    52   SysCall/Ia32/MathMultS64x64.c     | MSFT
    53   SysCall/Ia32/MathDivU64x64.c      | MSFT
    54   SysCall/Ia32/MathReminderU64x64.c | MSFT
    55   SysCall/Ia32/MathLShiftS64.c      | MSFT
    56   SysCall/Ia32/MathRShiftU64.c      | MSFT
    57 
    58   SysCall/Ia32/MathMultS64x64.c     | INTEL
    59   SysCall/Ia32/MathDivU64x64.c      | INTEL
    60   SysCall/Ia32/MathReminderU64x64.c | INTEL
    61   SysCall/Ia32/MathLShiftS64.c      | INTEL
    62   SysCall/Ia32/MathRShiftU64.c      | INTEL
    63 
    64   SysCall/Ia32/MathMultS64x64.S     | GCC
    65   SysCall/Ia32/MathDivU64x64.S      | GCC
    66   SysCall/Ia32/MathReminderU64x64.S | GCC
    67   SysCall/Ia32/MathLShiftS64.S      | GCC
    68   SysCall/Ia32/MathRShiftU64.S      | GCC
    69 
    7062  Rand/CryptRandTsc.c
    7163
     
    7971  Rand/CryptRand.c
    8072
     73[Sources.AARCH64]
     74  Rand/CryptRand.c
     75
    8176[Packages]
    8277  MdePkg/MdePkg.dec
     
    8782  BaseMemoryLib
    8883  MemoryAllocationLib
     84  UefiRuntimeServicesTableLib
    8985  DebugLib
    9086  OpensslLib
     
    9692#
    9793[BuildOptions]
     94  # suppress the following warnings so we do not break the build with warnings-as-errors:
     95  #   C4305: truncation from type1 to type2 (Introduced by RFC3161 Timestamp ASN.1 declarations)
     96  MSFT:*_*_*_CC_FLAGS = /wd4305
    9897  GCC:*_GCC44_IA32_CC_FLAGS = "-D__cdecl=__attribute__((cdecl))" "-D__declspec(t)=__attribute__((t))"
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c

    r48674 r58459  
    3939
    4040  This function initializes user-supplied memory pointed by AesContext as AES context.
    41   In addtion, it sets up all AES key materials for subsequent encryption and decryption
     41  In addition, it sets up all AES key materials for subsequent encryption and decryption
    4242  operations.
    4343  There are 3 options for key length, 128 bits, 192 bits, and 256 bits.
     
    242242  // Check input parameters.
    243243  //
    244   if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) {
     244  if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) {
     245    return FALSE;
     246  }
     247
     248  if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
    245249    return FALSE;
    246250  }
     
    300304  // Check input parameters.
    301305  //
    302   if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) {
     306  if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) {
     307    return FALSE;
     308  }
     309
     310  if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
    303311    return FALSE;
    304312  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c

    r48674 r58459  
    3333  // the working copy to the initial state.
    3434  //
    35   return (UINTN) (2 * sizeof(RC4_KEY));
     35  return (UINTN) (2 * sizeof (RC4_KEY));
    3636}
    3737
     
    4040
    4141  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.
    42   In addtion, it sets up all ARC4 key materials for subsequent encryption and decryption
     42  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption
    4343  operations.
    4444
     
    7676  RC4_set_key (Rc4Key, (UINT32) KeySize, Key);
    7777
    78   CopyMem (Rc4Key +  1, Rc4Key, sizeof(RC4_KEY));
     78  CopyMem (Rc4Key +  1, Rc4Key, sizeof (RC4_KEY));
    7979
    8080  return TRUE;
     
    116116  // Check input parameters.
    117117  //
    118   if (Arc4Context == NULL || Input == NULL || Output == NULL) {
     118  if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {
    119119    return FALSE;
    120120  }
     
    162162  // Check input parameters.
    163163  //
    164   if (Arc4Context == NULL || Input == NULL || Output == NULL) {
     164  if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {
    165165    return FALSE;
    166166  }
     
    206206  Rc4Key = (RC4_KEY *) Arc4Context;
    207207
    208   CopyMem (Rc4Key, Rc4Key + 1, sizeof(RC4_KEY));
    209 
    210   return TRUE;
    211 }
     208  CopyMem (Rc4Key, Rc4Key + 1, sizeof (RC4_KEY));
     209
     210  return TRUE;
     211}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c

    r48674 r58459  
    3838
    3939  This function initializes user-supplied memory pointed by TdesContext as TDES context.
    40   In addtion, it sets up all TDES key materials for subsequent encryption and decryption
     40  In addition, it sets up all TDES key materials for subsequent encryption and decryption
    4141  operations.
    4242  There are 3 key options as follows:
     
    7777
    7878  //
    79   //
    80   //
    81   if (DES_is_weak_key ((const_DES_cblock *) Key)) {
     79  // If input Key is a weak key, return error.
     80  //
     81  if (DES_is_weak_key ((const_DES_cblock *) Key) == 1) {
    8282    return FALSE;
    8383  }
     
    9191  }
    9292
    93   if (DES_is_weak_key ((const_DES_cblock *) Key + 8)) {
     93  if (DES_is_weak_key ((const_DES_cblock *) Key + 8) == 1) {
    9494    return FALSE;
    9595  }
     
    102102  }
    103103
    104   if (DES_is_weak_key ((const_DES_cblock *) Key + 16)) {
     104  if (DES_is_weak_key ((const_DES_cblock *) Key + 16) == 1) {
    105105    return FALSE;
    106106  }
     
    276276  // Check input parameters.
    277277  //
    278   if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) {
     278  if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0) {
     279    return FALSE;
     280  }
     281
     282  if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
    279283    return FALSE;
    280284  }
     
    340344  // Check input parameters.
    341345  //
    342   if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0 || Ivec == NULL || Output == NULL) {
     346  if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0) {
     347    return FALSE;
     348  }
     349
     350  if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
    343351    return FALSE;
    344352  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4.c

    r48674 r58459  
    3131  // Retrieves the OpenSSL MD4 Context Size
    3232  //
    33   return (UINTN)(sizeof (MD4_CTX));
     33  return (UINTN) (sizeof (MD4_CTX));
    3434}
    3535
     
    6262  // OpenSSL MD4 Context Initialization
    6363  //
    64   return (BOOLEAN) (MD4_Init ((MD4_CTX *)Md4Context));
     64  return (BOOLEAN) (MD4_Init ((MD4_CTX *) Md4Context));
    6565}
    6666
     
    140140  // OpenSSL MD4 Hash Update
    141141  //
    142   return (BOOLEAN) (MD4_Update ((MD4_CTX *)Md4Context, Data, DataSize));
     142  return (BOOLEAN) (MD4_Update ((MD4_CTX *) Md4Context, Data, DataSize));
    143143}
    144144
     
    180180  // OpenSSL MD4 Hash Finalization
    181181  //
    182   return (BOOLEAN) (MD4_Final (HashValue, (MD4_CTX *)Md4Context));
     182  return (BOOLEAN) (MD4_Final (HashValue, (MD4_CTX *) Md4Context));
    183183}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd5.c

    r48674 r58459  
    3232  // Retrieves the OpenSSL MD5 Context Size
    3333  //
    34   return (UINTN)(sizeof (MD5_CTX));
     34  return (UINTN) (sizeof (MD5_CTX));
    3535}
    3636
     
    5757  // Check input parameters.
    5858  //
    59   if ((Md5Context == NULL)) {
     59  if (Md5Context == NULL) {
    6060    return FALSE;
    6161  }
     
    6464  // OpenSSL MD5 Context Initialization
    6565  //
    66   return (BOOLEAN) (MD5_Init ((MD5_CTX *)Md5Context));
     66  return (BOOLEAN) (MD5_Init ((MD5_CTX *) Md5Context));
    6767}
    6868
     
    142142  // OpenSSL MD5 Hash Update
    143143  //
    144   return (BOOLEAN) (MD5_Update ((MD5_CTX *)Md5Context, Data, DataSize));
     144  return (BOOLEAN) (MD5_Update ((MD5_CTX *) Md5Context, Data, DataSize));
    145145}
    146146
     
    182182  // OpenSSL MD5 Hash Finalization
    183183  //
    184   return (BOOLEAN) (MD5_Final (HashValue, (MD5_CTX *)Md5Context));
     184  return (BOOLEAN) (MD5_Final (HashValue, (MD5_CTX *) Md5Context));
    185185}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha1.c

    r48674 r58459  
    3232  // Retrieves OpenSSL SHA Context Size
    3333  //
    34   return (UINTN)(sizeof (SHA_CTX));
     34  return (UINTN) (sizeof (SHA_CTX));
    3535}
    3636
     
    6363  // OpenSSL SHA-1 Context Initialization
    6464  //
    65   return (BOOLEAN) (SHA1_Init ((SHA_CTX *)Sha1Context));
     65  return (BOOLEAN) (SHA1_Init ((SHA_CTX *) Sha1Context));
    6666}
    6767
     
    141141  // OpenSSL SHA-1 Hash Update
    142142  //
    143   return (BOOLEAN) (SHA1_Update ((SHA_CTX *)Sha1Context, Data, DataSize));
     143  return (BOOLEAN) (SHA1_Update ((SHA_CTX *) Sha1Context, Data, DataSize));
    144144}
    145145
     
    181181  // OpenSSL SHA-1 Hash Finalization
    182182  //
    183   return (BOOLEAN) (SHA1_Final (HashValue, (SHA_CTX *)Sha1Context));
     183  return (BOOLEAN) (SHA1_Final (HashValue, (SHA_CTX *) Sha1Context));
    184184}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c

    r48674 r58459  
    3131  // Retrieves OpenSSL SHA-256 Context Size
    3232  //
    33   return (UINTN)(sizeof (SHA256_CTX));
     33  return (UINTN) (sizeof (SHA256_CTX));
    3434}
    3535
     
    6262  // OpenSSL SHA-256 Context Initialization
    6363  //
    64   return (BOOLEAN) (SHA256_Init ((SHA256_CTX *)Sha256Context));
     64  return (BOOLEAN) (SHA256_Init ((SHA256_CTX *) Sha256Context));
    6565}
    6666
     
    140140  // OpenSSL SHA-256 Hash Update
    141141  //
    142   return (BOOLEAN) (SHA256_Update ((SHA256_CTX *)Sha256Context, Data, DataSize));
     142  return (BOOLEAN) (SHA256_Update ((SHA256_CTX *) Sha256Context, Data, DataSize));
    143143}
    144144
     
    180180  // OpenSSL SHA-256 Hash Finalization
    181181  //
    182   return (BOOLEAN) (SHA256_Final (HashValue, (SHA256_CTX *)Sha256Context));
     182  return (BOOLEAN) (SHA256_Final (HashValue, (SHA256_CTX *) Sha256Context));
    183183}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5.c

    r48674 r58459  
    3131  // Retrieves the OpenSSL HMAC-MD5 Context Size
    3232  //
    33   return (UINTN)(sizeof (HMAC_CTX));
     33  return (UINTN) (sizeof (HMAC_CTX));
    3434}
    3535
     
    5959  // Check input parameters.
    6060  //
    61   if (HmacMd5Context == NULL) {
     61  if (HmacMd5Context == NULL || KeySize > INT_MAX) {
    6262    return FALSE;
    6363  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c

    r48674 r58459  
    3131  // Retrieves the OpenSSL HMAC-SHA1 Context Size
    3232  //
    33   return (UINTN)(sizeof (HMAC_CTX));
     33  return (UINTN) (sizeof (HMAC_CTX));
    3434}
    3535
     
    5959  // Check input parameters.
    6060  //
    61   if (HmacSha1Context == NULL) {
     61  if (HmacSha1Context == NULL || KeySize > INT_MAX) {
    6262    return FALSE;
    6363  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h

    r48674 r58459  
    2222#include <Library/BaseCryptLib.h>
    2323
     24#include "OpenSslSupport.h"
     25
    2426//
    2527// Environment Setting for OpenSSL-based UEFI Crypto Library.
     
    2931#endif
    3032
    31 /**
    32   Pop single certificate from STACK_OF(X509).
    33 
    34   If X509Stack, Cert, or CertSize is NULL, then return FALSE.
    35 
    36   @param[in]  X509Stack       Pointer to a X509 stack object.
    37   @param[out] Cert            Pointer to a X509 certificate.
    38   @param[out] CertSize        Length of output X509 certificate in bytes.
    39                                  
    40   @retval     TRUE            The X509 stack pop succeeded.
    41   @retval     FALSE           The pop operation failed.
    42 
    43 **/
    44 BOOLEAN
    45 X509PopCertificate (
    46   IN  VOID  *X509Stack,
    47   OUT UINT8 **Cert,
    48   OUT UINTN *CertSize
    49   );
    50 
    5133#endif
    5234
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf

    r48674 r58459  
    22#  Cryptographic Library Instance for PEIM.
    33#
    4 #  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
     4#  Caution: This module requires additional review when modified.
     5#  This library will have external input - signature.
     6#  This external input must be validated carefully to avoid security issues such as
     7#  buffer overflow or integer overflow.
     8#
     9#  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
     10#  HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external
     11#  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509
     12#  certificate handler functions, authenticode signature verification functions,
     13#  PEM handler functions, and pseudorandom number generator functions are not
     14#  supported in this instance.
     15#
     16#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    517#  This program and the accompanying materials
    618#  are licensed and made available under the terms and conditions of the BSD License
    719#  which accompanies this distribution.  The full text of the license may be found at
    820#  http://opensource.org/licenses/bsd-license.php
    9 # 
     21#
    1022#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1123#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    12 # 
     24#
    1325##
    1426
     
    1628  INF_VERSION                    = 0x00010005
    1729  BASE_NAME                      = PeiCryptLib
     30  MODULE_UNI_FILE                = PeiCryptLib.uni
    1831  FILE_GUID                      = 9a2a4375-194c-4e97-9f67-547ec98d96ca
    1932  MODULE_TYPE                    = PEIM
    2033  VERSION_STRING                 = 1.0
    21   LIBRARY_CLASS                  = BaseCryptLib|PEIM PEI_CORE SEC
     34  LIBRARY_CLASS                  = BaseCryptLib|PEIM PEI_CORE
    2235
    2336#
     
    2841
    2942[Sources]
     43  Hash/CryptMd4Null.c
    3044  Hash/CryptMd5.c
    3145  Hash/CryptSha1.c
    3246  Hash/CryptSha256.c
    33   Pk/CryptRsa.c
     47  Hash/CryptSha512Null.c
     48  Hmac/CryptHmacMd5Null.c
     49  Hmac/CryptHmacSha1Null.c
     50  Cipher/CryptAesNull.c
     51  Cipher/CryptTdesNull.c
     52  Cipher/CryptArc4Null.c
     53
     54  Pk/CryptRsaBasic.c
     55  Pk/CryptRsaExtNull.c
     56  Pk/CryptPkcs7SignNull.c
     57  Pk/CryptPkcs7Verify.c
     58
     59  Pk/CryptDhNull.c
     60  Pk/CryptX509Null.c
     61  Pk/CryptAuthenticodeNull.c
     62  Pk/CryptTsNull.c
     63  Pem/CryptPemNull.c
     64
     65  Rand/CryptRandNull.c
    3466
    3567  SysCall/CrtWrapper.c
     68  SysCall/ConstantTimeClock.c
    3669  SysCall/BaseMemAllocation.c
    37 
    38 [Sources.Ia32]
    39   SysCall/Ia32/MathMultS64x64.c     | MSFT
    40   SysCall/Ia32/MathDivU64x64.c      | MSFT
    41   SysCall/Ia32/MathReminderU64x64.c | MSFT
    42   SysCall/Ia32/MathLShiftS64.c      | MSFT
    43   SysCall/Ia32/MathRShiftU64.c      | MSFT
    44 
    45   SysCall/Ia32/MathMultS64x64.c     | INTEL
    46   SysCall/Ia32/MathDivU64x64.c      | INTEL
    47   SysCall/Ia32/MathReminderU64x64.c | INTEL
    48   SysCall/Ia32/MathLShiftS64.c      | INTEL
    49   SysCall/Ia32/MathRShiftU64.c      | INTEL
    50 
    51   SysCall/Ia32/MathMultS64x64.S     | GCC
    52   SysCall/Ia32/MathDivU64x64.S      | GCC
    53   SysCall/Ia32/MathReminderU64x64.S | GCC
    54   SysCall/Ia32/MathLShiftS64.S      | GCC
    55   SysCall/Ia32/MathRShiftU64.S      | GCC
    5670
    5771[Packages]
     
    7286[BuildOptions]
    7387  GCC:*_GCC44_IA32_CC_FLAGS = "-D__cdecl=__attribute__((cdecl))" "-D__declspec(t)=__attribute__((t))"
    74  
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c

    r48674 r58459  
    22  PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    3737  INTN  KeyLength;
    3838
    39   ZeroMem ((VOID *)Buf, (UINTN)Size);
     39  ZeroMem ((VOID *) Buf, (UINTN) Size);
    4040  if (Key != NULL) {
    4141    //
     
    8787  }
    8888
    89   Status = FALSE;
    90   PemBio = NULL;
    91 
    9289  //
    9390  // Add possible block-cipher descriptor for PEM data decryption.
    9491  // NOTE: Only support most popular ciphers (3DES, AES) for the encrypted PEM.
    9592  //
    96   EVP_add_cipher (EVP_des_ede3_cbc());
    97   EVP_add_cipher (EVP_aes_128_cbc());
    98   EVP_add_cipher (EVP_aes_192_cbc());
    99   EVP_add_cipher (EVP_aes_256_cbc());
     93  if (EVP_add_cipher (EVP_des_ede3_cbc ()) == 0) {
     94    return FALSE;
     95  }
     96  if (EVP_add_cipher (EVP_aes_128_cbc ()) == 0) {
     97    return FALSE;
     98  }
     99  if (EVP_add_cipher (EVP_aes_192_cbc ()) == 0) {
     100    return FALSE;
     101  }
     102  if (EVP_add_cipher (EVP_aes_256_cbc ()) == 0) {
     103    return FALSE;
     104  }
     105
     106  Status = FALSE;
    100107
    101108  //
     
    103110  //
    104111  PemBio = BIO_new (BIO_s_mem ());
    105   BIO_write (PemBio, PemData, (int)PemSize);
    106112  if (PemBio == NULL) {
     113    goto _Exit;
     114  }
     115
     116  if (BIO_write (PemBio, PemData, (int) PemSize) <= 0) {
    107117    goto _Exit;
    108118  }
     
    111121  // Retrieve RSA Private Key from encrypted PEM data.
    112122  //
    113   *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *)&PasswordCallback, (void *)Password);
     123  *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *) &PasswordCallback, (void *) Password);
    114124  if (*RsaContext != NULL) {
    115125    Status = TRUE;
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c

    r48674 r58459  
    22  Authenticode Portable Executable Signature Verification over OpenSSL.
    33
    4 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
     4  Caution: This module requires additional review when modified.
     5  This library will have external input - signature (e.g. PE/COFF Authenticode).
     6  This external input must be validated carefully to avoid security issue like
     7  buffer overflow, integer overflow.
     8
     9  AuthenticodeVerify() will get PE/COFF Authenticode and will do basic check for
     10  data structure.
     11
     12Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
    513This program and the accompanying materials
    614are licensed and made available under the terms and conditions of the BSD License
     
    1927#include <openssl/pkcs7.h>
    2028
     29//
     30// OID ASN.1 Value for SPC_INDIRECT_DATA_OBJID
     31//
     32UINT8 mSpcIndirectOidValue[] = {
     33  0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x04
     34  };
    2135
    2236/**
     
    2640  If AuthData is NULL, then return FALSE.
    2741  If ImageHash is NULL, then return FALSE.
     42
     43  Caution: This function may receive untrusted input.
     44  PE/COFF Authenticode is external input, so this function will do basic check for
     45  Authenticode data structure.
    2846
    2947  @param[in]  AuthData     Pointer to the Authenticode Signature retrieved from signed
     
    5573  BOOLEAN      Status;
    5674  PKCS7        *Pkcs7;
     75  CONST UINT8  *Temp;
    5776  CONST UINT8  *OrigAuthData;
    5877  UINT8        *SpcIndirectDataContent;
    5978  UINT8        Asn1Byte;
    6079  UINTN        ContentSize;
     80  UINT8        *SpcIndirectDataOid;
    6181
    6282  //
     
    7898  // Retrieve & Parse PKCS#7 Data (DER encoding) from Authenticode Signature
    7999  //
    80   Pkcs7 = d2i_PKCS7 (NULL, &AuthData, (int)DataSize);
     100  Temp  = AuthData;
     101  Pkcs7 = d2i_PKCS7 (NULL, &Temp, (int)DataSize);
    81102  if (Pkcs7 == NULL) {
    82103    goto _Exit;
     
    95116  //       PKCS#7 ContentInfo here.
    96117  //
     118  SpcIndirectDataOid = (UINT8 *)(Pkcs7->d.sign->contents->type->data);
     119  if (CompareMem (
     120        SpcIndirectDataOid,
     121        mSpcIndirectOidValue,
     122        sizeof (mSpcIndirectOidValue)
     123        ) != 0) {
     124    //
     125    // Un-matched SPC_INDIRECT_DATA_OBJID.
     126    //
     127    goto _Exit;
     128  }
     129
     130
    97131  SpcIndirectDataContent = (UINT8 *)(Pkcs7->d.sign->contents->d.other->value.asn1_string->data);
    98132
     
    104138  if ((Asn1Byte & 0x80) == 0) {
    105139    //
    106     // Short Form of Length Encoding
     140    // Short Form of Length Encoding (Length < 128)
    107141    //
    108142    ContentSize = (UINTN) (Asn1Byte & 0x7F);
     
    111145    //
    112146    SpcIndirectDataContent += 2;
     147
     148  } else if ((Asn1Byte & 0x81) == 0x81) {
     149    //
     150    // Long Form of Length Encoding (128 <= Length < 255, Single Octet)
     151    //
     152    ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2));
     153    //
     154    // Skip the SEQUENCE Tag;
     155    //
     156    SpcIndirectDataContent += 3;
     157
    113158  } else if ((Asn1Byte & 0x82) == 0x82) {
    114159    //
    115     // Long Form of Length Encoding, only support two bytes.
     160    // Long Form of Length Encoding (Length > 255, Two Octet)
    116161    //
    117     ContentSize  = (UINTN) (*(SpcIndirectDataContent + 2));
    118     ContentSize = (ContentSize << 8) + (UINTN)(*(SpcIndirectDataContent + 3));
     162    ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2));
     163    ContentSize = (ContentSize << 8) + (UINTN)(*(UINT8 *)(SpcIndirectDataContent + 3));
    119164    //
    120165    // Skip the SEQUENCE Tag;
    121166    //
    122167    SpcIndirectDataContent += 4;
     168
    123169  } else {
    124170    goto _Exit;
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptDh.c

    r48674 r58459  
    3333  // Allocates & Initializes DH Context by OpenSSL DH_new()
    3434  //
    35   return (VOID *)DH_new ();
     35  return (VOID *) DH_new ();
    3636}
    3737
     
    5353  // Free OpenSSL DH Context
    5454  //
    55   DH_free ((DH *)DhContext);
     55  DH_free ((DH *) DhContext);
    5656}
    5757
     
    9292  // Check input parameters.
    9393  //
    94   if (DhContext == NULL || Prime == NULL) {
     94  if (DhContext == NULL || Prime == NULL || PrimeLength > INT_MAX) {
    9595    return FALSE;
    9696  }
     
    140140  )
    141141{
    142   DH  *Dh;
     142  DH      *Dh;
     143  BIGNUM  *Bn;
    143144
    144145  //
    145146  // Check input parameters.
    146147  //
    147   if (DhContext == NULL || Prime == NULL) {
     148  if (DhContext == NULL || Prime == NULL || PrimeLength > INT_MAX) {
    148149    return FALSE;
    149150  }
     
    153154  }
    154155
     156  Bn = NULL;
     157
    155158  Dh = (DH *) DhContext;
    156   Dh->p = BN_new();
    157   Dh->g = BN_new();
    158 
    159   BN_bin2bn (Prime, (UINT32) (PrimeLength / 8), Dh->p);
    160   BN_set_word (Dh->g, (UINT32) Generator);
     159  Dh->g = NULL;
     160  Dh->p = BN_new ();
     161  if (Dh->p == NULL) {
     162    goto Error;
     163  }
     164 
     165  Dh->g = BN_new ();
     166  if (Dh->g == NULL) {
     167    goto Error;
     168  }
     169
     170  Bn = BN_bin2bn (Prime, (UINT32) (PrimeLength / 8), Dh->p);
     171  if (Bn == NULL) {
     172    goto Error;
     173  }
     174
     175  if (BN_set_word (Dh->g, (UINT32) Generator) == 0) {
     176    goto Error;
     177  }
    161178
    162179  return TRUE;
     180
     181Error:
     182
     183  if (Dh->p != NULL) {
     184    BN_free (Dh->p);
     185  }
     186
     187  if (Dh->g != NULL) {
     188    BN_free (Dh->g);
     189  }
     190
     191  if (Bn != NULL) {
     192    BN_free (Bn);
     193  }
     194 
     195  return FALSE;
    163196}
    164197
     
    195228  BOOLEAN RetVal;
    196229  DH      *Dh;
     230  INTN    Size;
    197231
    198232  //
     
    208242 
    209243  Dh = (DH *) DhContext;
    210   *PublicKeySize = 0;
    211244
    212245  RetVal = (BOOLEAN) DH_generate_key (DhContext);
    213246  if (RetVal) {
     247    Size = BN_num_bytes (Dh->pub_key);
     248    if ((Size > 0) && (*PublicKeySize < (UINTN) Size)) {
     249      *PublicKeySize = Size;
     250      return FALSE;
     251    }
     252   
    214253    BN_bn2bin (Dh->pub_key, PublicKey);
    215     *PublicKeySize  = BN_num_bytes (Dh->pub_key);
     254    *PublicKeySize = Size;
    216255  }
    217256
     
    228267  If PeerPublicKey is NULL, then return FALSE.
    229268  If KeySize is NULL, then return FALSE.
    230   If KeySize is large enough but Key is NULL, then return FALSE.
     269  If Key is NULL, then return FALSE.
     270  If KeySize is not large enough, then return FALSE.
    231271
    232272  @param[in, out]  DhContext          Pointer to the DH context.
     
    253293{
    254294  BIGNUM  *Bn;
     295  INTN    Size;
    255296
    256297  //
    257298  // Check input parameters.
    258299  //
    259   if (DhContext == NULL || PeerPublicKey == NULL || KeySize == NULL) {
    260     return FALSE;
    261   }
    262 
    263   if (Key == NULL && *KeySize != 0) {
     300  if (DhContext == NULL || PeerPublicKey == NULL || KeySize == NULL || Key == NULL) {
     301    return FALSE;
     302  }
     303
     304  if (PeerPublicKeySize > INT_MAX) {
    264305    return FALSE;
    265306  }
    266307 
    267308  Bn = BN_bin2bn (PeerPublicKey, (UINT32) PeerPublicKeySize, NULL);
    268 
    269   *KeySize = (BOOLEAN) DH_compute_key (Key, Bn, DhContext);
    270 
     309  if (Bn == NULL) {
     310    return FALSE;
     311  }
     312
     313  Size = DH_compute_key (Key, Bn, DhContext);
     314  if (Size < 0) {
     315    BN_free (Bn);
     316    return FALSE;
     317  }
     318
     319  if (*KeySize < (UINTN) Size) {
     320    *KeySize = Size;
     321    BN_free (Bn);
     322    return FALSE;
     323  }
     324
     325  *KeySize = Size;
    271326  BN_free (Bn);
    272 
    273327  return TRUE;
    274328}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c

    r48674 r58459  
    22  X.509 Certificate Handler Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    3939  )
    4040{
    41   BIO      *CertBio;
    42   X509     *X509Cert;
    43   BOOLEAN  Status;
     41  X509         *X509Cert;
     42  CONST UINT8  *Temp;
    4443
    4544  //
     
    5049  }
    5150
    52   Status = FALSE;
    53 
    5451  //
    5552  // Read DER-encoded X509 Certificate and Construct X509 object.
    5653  //
    57   CertBio = BIO_new (BIO_s_mem ());
    58   BIO_write (CertBio, Cert, (int) CertSize);
    59   if (CertBio == NULL) {
    60     goto _Exit;
    61   }
    62   X509Cert = d2i_X509_bio (CertBio, NULL);
     54  Temp     = Cert;
     55  X509Cert = d2i_X509 (NULL, &Temp, (long) CertSize);
    6356  if (X509Cert == NULL) {
    64     goto _Exit;
     57    return FALSE;
    6558  }
    6659
    6760  *SingleX509Cert = (UINT8 *) X509Cert;
    68   Status = TRUE;
    69 
    70 _Exit:
    71   //
    72   // Release Resources.
    73   //
    74   BIO_free (CertBio);
    75 
    76   return Status;
     61
     62  return TRUE;
    7763}
    7864
     
    8268  If X509Stack is NULL, then return FALSE.
    8369
    84   @param[in, out]  X509Stack  On input, pointer to an existing X509 stack object.
     70  @param[in, out]  X509Stack  On input, pointer to an existing or NULL X509 stack object.
    8571                              On output, pointer to the X509 stack object with new
    8672                              inserted X509 certificate.
     
    140126
    141127    CertSize = VA_ARG (Args, UINTN);
     128    if (CertSize == 0) {
     129      break;
     130    }
    142131
    143132    //
    144133    // Construct X509 Object from the given DER-encoded certificate data.
    145134    //
     135    X509Cert = NULL;
    146136    Status = X509ConstructCertificate (
    147137               (CONST UINT8 *) Cert,
     
    150140               );
    151141    if (!Status) {
    152       X509_free (X509Cert);
     142      if (X509Cert != NULL) {
     143        X509_free (X509Cert);
     144      }
    153145      break;
    154146    }
     
    223215  //
    224216  sk_X509_pop_free ((STACK_OF(X509) *) X509Stack, X509_free);
    225 }
    226 
    227 /**
    228   Pop single certificate from STACK_OF(X509).
    229 
    230   If X509Stack, Cert, or CertSize is NULL, then return FALSE.
    231 
    232   @param[in]  X509Stack       Pointer to a X509 stack object.
    233   @param[out] Cert            Pointer to a X509 certificate.
    234   @param[out] CertSize        Length of output X509 certificate in bytes.
    235                                  
    236   @retval     TRUE            The X509 stack pop succeeded.
    237   @retval     FALSE           The pop operation failed.
    238 
    239 **/
    240 BOOLEAN
    241 X509PopCertificate (
    242   IN  VOID  *X509Stack,
    243   OUT UINT8 **Cert,
    244   OUT UINTN *CertSize
    245   )
    246 {
    247   BIO             *CertBio;
    248   X509            *X509Cert;
    249   STACK_OF(X509)  *CertStack;
    250   BOOLEAN         Status;
    251   int             Result;
    252   int             Length;
    253   VOID            *Buffer;
    254 
    255   Status = FALSE;
    256 
    257   if ((X509Stack == NULL) || (Cert == NULL) || (CertSize == NULL)) {
    258     return Status;
    259   }
    260 
    261   CertStack = (STACK_OF(X509) *) X509Stack;
    262 
    263   X509Cert = sk_X509_pop (CertStack);
    264 
    265   if (X509Cert == NULL) {
    266     return Status;
    267   }
    268 
    269   Buffer = NULL;
    270 
    271   CertBio = BIO_new (BIO_s_mem ());
    272   if (CertBio == NULL) {
    273     return Status;
    274   }
    275 
    276   Result = i2d_X509_bio (CertBio, X509Cert);
    277   if (Result == 0) {
    278     goto _Exit;
    279   }
    280 
    281   Length = ((BUF_MEM *) CertBio->ptr)->length;
    282   if (Length <= 0) {
    283     goto _Exit;
    284   }
    285 
    286   Buffer = malloc (Length);
    287   if (Buffer == NULL) {
    288     goto _Exit;
    289   }
    290 
    291   Result = BIO_read (CertBio, Buffer, Length);
    292   if (Result != Length) {
    293     goto _Exit;
    294   }
    295 
    296   *Cert     = Buffer;
    297   *CertSize = Length;
    298 
    299   Status = TRUE;
    300 
    301 _Exit:
    302 
    303   BIO_free (CertBio);
    304 
    305   if (!Status && (Buffer != NULL)) {
    306     free (Buffer);
    307   }
    308 
    309   return Status;
    310217}
    311218
     
    347254  }
    348255
    349   Status   = FALSE;
    350256  X509Cert = NULL;
    351257
     
    355261  Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
    356262  if ((X509Cert == NULL) || (!Status)) {
    357     goto _Exit;
    358   }
     263    Status = FALSE;
     264    goto _Exit;
     265  }
     266
     267  Status = FALSE;
    359268
    360269  //
     
    362271  //
    363272  X509Name = X509_get_subject_name (X509Cert);
     273  if (X509Name == NULL) {
     274    goto _Exit;
     275  }
     276
    364277  if (*SubjectSize < (UINTN) X509Name->bytes->length) {
    365278    *SubjectSize = (UINTN) X509Name->bytes->length;
     
    368281  *SubjectSize = (UINTN) X509Name->bytes->length;
    369282  if (CertSubject != NULL) {
    370     CopyMem (CertSubject, (UINT8 *)X509Name->bytes->data, *SubjectSize);
     283    CopyMem (CertSubject, (UINT8 *) X509Name->bytes->data, *SubjectSize);
    371284    Status = TRUE;
    372285  }
     
    376289  // Release Resources.
    377290  //
    378   X509_free (X509Cert);
     291  if (X509Cert != NULL) {
     292    X509_free (X509Cert);
     293  }
    379294
    380295  return Status;
     
    416331  }
    417332
    418   Status   = FALSE;
    419333  Pkey     = NULL;
    420334  X509Cert = NULL;
     
    425339  Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
    426340  if ((X509Cert == NULL) || (!Status)) {
    427     goto _Exit;
    428   }
     341    Status = FALSE;
     342    goto _Exit;
     343  }
     344
     345  Status = FALSE;
    429346
    430347  //
     
    447364  // Release Resources.
    448365  //
    449   X509_free (X509Cert);
    450   EVP_PKEY_free (Pkey);
     366  if (X509Cert != NULL) {
     367    X509_free (X509Cert);
     368  }
     369
     370  if (Pkey != NULL) {
     371    EVP_PKEY_free (Pkey);
     372  } 
    451373
    452374  return Status;
     
    499421  // Register & Initialize necessary digest algorithms for certificate verification.
    500422  //
    501   EVP_add_digest (EVP_md5());
    502   EVP_add_digest (EVP_sha1());
    503   EVP_add_digest (EVP_sha256());
     423  if (EVP_add_digest (EVP_md5 ()) == 0) {
     424    goto _Exit;
     425  }
     426  if (EVP_add_digest (EVP_sha1 ()) == 0) {
     427    goto _Exit;
     428  }
     429  if (EVP_add_digest (EVP_sha256 ()) == 0) {
     430    goto _Exit;
     431  }
    504432
    505433  //
     
    508436  Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
    509437  if ((X509Cert == NULL) || (!Status)) {
     438    Status = FALSE;
    510439    goto _Exit;
    511440  }
     
    516445  Status = X509ConstructCertificate (CACert, CACertSize, (UINT8 **) &X509CACert);
    517446  if ((X509CACert == NULL) || (!Status)) {
    518     goto _Exit;
    519   }
     447    Status = FALSE;
     448    goto _Exit;
     449  }
     450
     451  Status = FALSE;
    520452
    521453  //
     
    547479  // Release Resources.
    548480  //
    549   X509_free (X509Cert);
    550   X509_free (X509CACert);
    551   X509_STORE_free (CertStore);
    552 
     481  if (X509Cert != NULL) {
     482    X509_free (X509Cert);
     483  }
     484
     485  if (X509CACert != NULL) {
     486    X509_free (X509CACert);
     487  }
     488
     489  if (CertStore != NULL) {
     490    X509_STORE_free (CertStore);
     491  }
     492 
    553493  return Status;
    554494}
     495
     496/**
     497  Retrieve the TBSCertificate from one given X.509 certificate.
     498
     499  @param[in]      Cert         Pointer to the given DER-encoded X509 certificate.
     500  @param[in]      CertSize     Size of the X509 certificate in bytes.
     501  @param[out]     TBSCert      DER-Encoded To-Be-Signed certificate.
     502  @param[out]     TBSCertSize  Size of the TBS certificate in bytes.
     503
     504  If Cert is NULL, then return FALSE.
     505  If TBSCert is NULL, then return FALSE.
     506  If TBSCertSize is NULL, then return FALSE.
     507
     508  @retval  TRUE   The TBSCertificate was retrieved successfully.
     509  @retval  FALSE  Invalid X.509 certificate.
     510
     511**/
     512BOOLEAN
     513EFIAPI
     514X509GetTBSCert (
     515  IN  CONST UINT8  *Cert,
     516  IN  UINTN        CertSize,
     517  OUT UINT8        **TBSCert,
     518  OUT UINTN        *TBSCertSize
     519  )
     520{
     521  CONST UINT8  *Temp;
     522  INTN         Asn1Tag;
     523  INTN         ObjClass;
     524  UINTN        Length;
     525
     526  //
     527  // Check input parameters.
     528  //
     529  if ((Cert == NULL) || (TBSCert == NULL) ||
     530      (TBSCertSize == NULL) || (CertSize > INT_MAX)) {
     531    return FALSE;
     532  }
     533
     534  //
     535  // An X.509 Certificate is: (defined in RFC3280)
     536  //   Certificate  ::=  SEQUENCE  {
     537  //     tbsCertificate       TBSCertificate,
     538  //     signatureAlgorithm   AlgorithmIdentifier,
     539  //     signature            BIT STRING }
     540  //
     541  // and
     542  //
     543  //  TBSCertificate  ::=  SEQUENCE  {
     544  //    version         [0]  Version DEFAULT v1,
     545  //    ...
     546  //    }
     547  //
     548  // So we can just ASN1-parse the x.509 DER-encoded data. If we strip
     549  // the first SEQUENCE, the second SEQUENCE is the TBSCertificate.
     550  //
     551  Temp = Cert;
     552  ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)CertSize);
     553
     554  if (Asn1Tag != V_ASN1_SEQUENCE) {
     555    return FALSE;
     556  }
     557
     558  *TBSCert = (UINT8 *)Temp;
     559
     560  ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)Length);
     561  //
     562  // Verify the parsed TBSCertificate is one correct SEQUENCE data.
     563  //
     564  if (Asn1Tag != V_ASN1_SEQUENCE) {
     565    return FALSE;
     566  }
     567
     568  *TBSCertSize = Length + (Temp - *TBSCert);
     569 
     570  return TRUE;
     571}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c

    r48674 r58459  
    22  Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    1515#include "InternalCryptLib.h"
    1616#include <openssl/rand.h>
     17#include <openssl/evp.h>
    1718
    1819//
     
    4445  )
    4546{
     47  if (SeedSize > INT_MAX) {
     48    return FALSE;
     49  }
     50
     51  //
     52  // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
     53  // Make sure SHA-1 digest algorithm is available here.
     54  //
     55  if (EVP_add_digest (EVP_sha1 ()) == 0) {
     56    return FALSE;
     57  }
     58
    4659  //
    4760  // Seed the pseudorandom number generator with user-supplied value.
     
    5467  }
    5568
    56   return TRUE;
     69  if (RAND_status () == 1) {
     70    return TRUE;
     71  }
     72
     73  return FALSE;
    5774}
    5875
     
    7996  // Check input parameters.
    8097  //
    81   if (Output == NULL) {
     98  if (Output == NULL || Size > INT_MAX) {
    8299    return FALSE;
    83100  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c

    r48674 r58459  
    22  Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    1515#include "InternalCryptLib.h"
    1616#include <openssl/rand.h>
     17#include <openssl/evp.h>
    1718#include <Library/PrintLib.h>
    1819
     
    4243  CHAR8  DefaultSeed[128];
    4344
     45  if (SeedSize > INT_MAX) {
     46    return FALSE;
     47  }
     48
     49  //
     50  // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
     51  // Make sure SHA-1 digest algorithm is available here.
     52  //
     53  if (EVP_add_digest (EVP_sha1 ()) == 0) {
     54    return FALSE;
     55  }
     56
    4457  //
    4558  // Seed the pseudorandom number generator with user-supplied value.
     
    6275  }
    6376
    64   return TRUE;
     77  if (RAND_status () == 1) {
     78    return TRUE;
     79  }
     80
     81  return FALSE;
    6582}
    6683
     
    87104  // Check input parameters.
    88105  //
    89   if (Output == NULL) {
     106  if (Output == NULL || Size > INT_MAX) {
    90107    return FALSE;
    91108  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c

    r48674 r58459  
    22  Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
    33
    4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    1515#include "InternalCryptLib.h"
    1616#include <openssl/rand.h>
     17#include <openssl/evp.h>
    1718#include <Library/PrintLib.h>
    1819
     
    4243  CHAR8  DefaultSeed[128];
    4344
     45  if (SeedSize > INT_MAX) {
     46    return FALSE;
     47  }
     48
     49  //
     50  // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
     51  // Make sure SHA-1 digest algorithm is available here.
     52  //
     53  if (EVP_add_digest (EVP_sha1 ()) == 0) {
     54    return FALSE;
     55  }
     56
    4457  //
    4558  // Seed the pseudorandom number generator with user-supplied value.
     
    6275  }
    6376
    64   return TRUE;
     77  if (RAND_status () == 1) {
     78    return TRUE;
     79  }
     80
     81  return FALSE;
    6582}
    6683
     
    87104  // Check input parameters.
    88105  //
    89   if (Output == NULL) {
     106  if (Output == NULL || Size > INT_MAX) {
    90107    return FALSE;
    91108  }
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf

    r48674 r58459  
    11## @file
    2 #  Cryptographic Library Instance for DXE_RUNTIME_DRIVER
     2#  Cryptographic Library Instance for DXE_RUNTIME_DRIVER.
    33#
    4 #  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
     4#  Caution: This module requires additional review when modified.
     5#  This library will have external input - signature.
     6#  This external input must be validated carefully to avoid security issues such as
     7#  buffer overflow or integer overflow.
     8#
     9#  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
     10#  HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external
     11#  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
     12#  authenticode signature verification functions are not supported in this instance.
     13#
     14#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    515#  This program and the accompanying materials
    616#  are licensed and made available under the terms and conditions of the BSD License
    717#  which accompanies this distribution.  The full text of the license may be found at
    818#  http://opensource.org/licenses/bsd-license.php
    9 # 
     19#
    1020#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1121#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    12 # 
     22#
    1323##
    1424
     
    1626  INF_VERSION                    = 0x00010005
    1727  BASE_NAME                      = RuntimeCryptLib
     28  MODULE_UNI_FILE                = RuntimeCryptLib.uni
    1829  FILE_GUID                      = 78189cc0-727d-46a4-84ea-f7dd860de64a
    1930  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
    2031  VERSION_STRING                 = 1.0
    21   LIBRARY_CLASS                  = BaseCryptLib
     32  LIBRARY_CLASS                  = BaseCryptLib|DXE_RUNTIME_DRIVER
    2233  CONSTRUCTOR                    = RuntimeCryptLibConstructor
    2334
     
    2536# The following information is for reference only and not required by the build tools.
    2637#
    27 #  VALID_ARCHITECTURES           = IA32 X64 IPF ARM
     38#  VALID_ARCHITECTURES           = IA32 X64 IPF ARM AARCH64
    2839#
    2940
    3041[Sources]
     42  Hash/CryptMd4Null.c
    3143  Hash/CryptMd5.c
    3244  Hash/CryptSha1.c
    3345  Hash/CryptSha256.c
    34   Pk/CryptRsa.c
    35   Pk/CryptPkcs7.c
     46  Hash/CryptSha512Null.c
     47  Hmac/CryptHmacMd5Null.c
     48  Hmac/CryptHmacSha1Null.c
     49  Cipher/CryptAesNull.c
     50  Cipher/CryptTdesNull.c
     51  Cipher/CryptArc4Null.c
     52  Pk/CryptRsaBasic.c
     53  Pk/CryptRsaExtNull.c
     54  Pk/CryptPkcs7SignNull.c
     55  Pk/CryptPkcs7Verify.c
     56  Pk/CryptDhNull.c
    3657  Pk/CryptX509.c
     58  Pk/CryptAuthenticodeNull.c
     59  Pk/CryptTsNull.c
    3760  Pem/CryptPem.c
    3861
     
    4265
    4366[Sources.Ia32]
    44   SysCall/Ia32/MathMultS64x64.c     | MSFT
    45   SysCall/Ia32/MathDivU64x64.c      | MSFT
    46   SysCall/Ia32/MathReminderU64x64.c | MSFT
    47   SysCall/Ia32/MathLShiftS64.c      | MSFT
    48   SysCall/Ia32/MathRShiftU64.c      | MSFT
    49 
    50   SysCall/Ia32/MathMultS64x64.c     | INTEL
    51   SysCall/Ia32/MathDivU64x64.c      | INTEL
    52   SysCall/Ia32/MathReminderU64x64.c | INTEL
    53   SysCall/Ia32/MathLShiftS64.c      | INTEL
    54   SysCall/Ia32/MathRShiftU64.c      | INTEL
    55 
    56   SysCall/Ia32/MathMultS64x64.S     | GCC
    57   SysCall/Ia32/MathDivU64x64.S      | GCC
    58   SysCall/Ia32/MathReminderU64x64.S | GCC
    59   SysCall/Ia32/MathLShiftS64.S      | GCC
    60   SysCall/Ia32/MathRShiftU64.S      | GCC
    61 
    6267  Rand/CryptRandTsc.c
    6368
     
    6974
    7075[Sources.ARM]
     76  Rand/CryptRand.c
     77
     78[Sources.AARCH64]
    7179  Rand/CryptRand.c
    7280
     
    9199[BuildOptions]
    92100  GCC:*_GCC44_IA32_CC_FLAGS = "-D__cdecl=__attribute__((cdecl))" "-D__declspec(t)=__attribute__((t))"
    93  
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf

    r48674 r58459  
    22#  Cryptographic Library Instance for SMM driver.
    33#
    4 #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
     4#  Caution: This module requires additional review when modified.
     5#  This library will have external input - signature.
     6#  This external input must be validated carefully to avoid security issues such as
     7#  buffer overflow or integer overflow.
     8#
     9#  Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
     10#  HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external
     11#  functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
     12#  authenticode signature verification functions are not supported in this instance.
     13#
     14#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    515#  This program and the accompanying materials
    616#  are licensed and made available under the terms and conditions of the BSD License
    717#  which accompanies this distribution.  The full text of the license may be found at
    818#  http://opensource.org/licenses/bsd-license.php
    9 # 
     19#
    1020#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1121#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    12 # 
     22#
    1323##
    1424
     
    1626  INF_VERSION                    = 0x00010005
    1727  BASE_NAME                      = SmmCryptLib
     28  MODULE_UNI_FILE                = SmmCryptLib.uni
    1829  FILE_GUID                      = 028080a3-8958-4a62-a1a8-0fa1da162007
    1930  MODULE_TYPE                    = DXE_SMM_DRIVER
     
    2536# The following information is for reference only and not required by the build tools.
    2637#
    27 #  VALID_ARCHITECTURES           = IA32 X64
     38#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
    2839#
    2940
    3041[Sources]
     42  Hash/CryptMd4Null.c
    3143  Hash/CryptMd5.c
    3244  Hash/CryptSha1.c
    3345  Hash/CryptSha256.c
    34   Pk/CryptRsa.c
    35   Pk/CryptPkcs7.c
     46  Hash/CryptSha512Null.c
     47  Hmac/CryptHmacMd5Null.c
     48  Hmac/CryptHmacSha1Null.c
     49  Cipher/CryptAesNull.c
     50  Cipher/CryptTdesNull.c
     51  Cipher/CryptArc4Null.c
     52  Pk/CryptRsaBasic.c
     53  Pk/CryptRsaExtNull.c
     54  Pk/CryptPkcs7SignNull.c
     55  Pk/CryptPkcs7Verify.c
     56  Pk/CryptDhNull.c
    3657  Pk/CryptX509.c
     58  Pk/CryptAuthenticodeNull.c
     59  Pk/CryptTsNull.c
    3760  Pem/CryptPem.c
    3861
    3962  SysCall/CrtWrapper.c
    40   SysCall/RealTimeClock.c
     63  SysCall/ConstantTimeClock.c
    4164  SysCall/BaseMemAllocation.c
    4265
    4366[Sources.Ia32]
    44   SysCall/Ia32/MathMultS64x64.c     | MSFT
    45   SysCall/Ia32/MathDivU64x64.c      | MSFT
    46   SysCall/Ia32/MathReminderU64x64.c | MSFT
    47   SysCall/Ia32/MathLShiftS64.c      | MSFT
    48   SysCall/Ia32/MathRShiftU64.c      | MSFT
    49 
    50   SysCall/Ia32/MathMultS64x64.c     | INTEL
    51   SysCall/Ia32/MathDivU64x64.c      | INTEL
    52   SysCall/Ia32/MathReminderU64x64.c | INTEL
    53   SysCall/Ia32/MathLShiftS64.c      | INTEL
    54   SysCall/Ia32/MathRShiftU64.c      | INTEL
    55 
    56   SysCall/Ia32/MathMultS64x64.S     | GCC
    57   SysCall/Ia32/MathDivU64x64.S      | GCC
    58   SysCall/Ia32/MathReminderU64x64.S | GCC
    59   SysCall/Ia32/MathLShiftS64.S      | GCC
    60   SysCall/Ia32/MathRShiftU64.S      | GCC
    61 
    6267  Rand/CryptRandTsc.c
    6368
     
    6974
    7075[Sources.ARM]
     76  Rand/CryptRand.c
     77
     78[Sources.AARCH64]
    7179  Rand/CryptRand.c
    7280
     
    8997[BuildOptions]
    9098  GCC:*_GCC44_IA32_CC_FLAGS = "-D__cdecl=__attribute__((cdecl))" "-D__declspec(t)=__attribute__((t))"
    91  
     99  XCODE:*_*_*_CC_FLAGS = -mmmx -msse
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c

    r48674 r58459  
    33  during PEI & DXE phases.
    44
    5 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    2323void *malloc (size_t size)
    2424{
    25   return AllocatePool ((UINTN)size);
     25  return AllocatePool ((UINTN) size);
    2626}
    2727
     
    3333  // memory size of original pointer ptr.
    3434  //
    35   return ReallocatePool ((UINTN)size, (UINTN)size, ptr);
     35  return ReallocatePool ((UINTN) size, (UINTN) size, ptr);
    3636}
    3737
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c

    r48674 r58459  
    33  Library at Runtime Phase.
    44
    5 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    386386void *malloc (size_t size)
    387387{
    388   return RuntimeAllocateMem ((UINTN)size);
     388  return RuntimeAllocateMem ((UINTN) size);
    389389}
    390390
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c

    r48674 r58459  
    149149
    150150  for (MonthNo = 12; MonthNo > 1; MonthNo--) {
    151     if (DayNo > CumulativeDays[IsLeap(Year)][MonthNo]) {
     151    if (DayNo >= CumulativeDays[IsLeap(Year)][MonthNo]) {
    152152      DayNo = (UINT16) (DayNo - (UINT16) (CumulativeDays[IsLeap(Year)][MonthNo]));
    153153      break;
     
    155155  }
    156156
    157   GmTime->tm_mon  = (int) MonthNo;
    158   GmTime->tm_mday = (int) DayNo;
     157  GmTime->tm_mon  = (int) MonthNo - 1;
     158  GmTime->tm_mday = (int) DayNo + 1;
    159159
    160160  GmTime->tm_isdst  = 0;
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf

    r48674 r58459  
    33#  This instance will be only used by the Authenticated Variable driver for IPF.
    44#
    5 #  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
     5#  Note: MD4/MD5/SHA1 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions,
     6#  AES/TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign/verify
     7#  functions, Diffie-Hellman functions, X.509 certificate handler functions,
     8#  authenticode signature verification functions, PEM handler functions,
     9#  pseudorandom number generator functions, and Sha256Duplicate() are not supported
     10#  in this instance.
     11#
     12#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    613#  This program and the accompanying materials
    714#  are licensed and made available under the terms and conditions of the BSD License
     
    1724  INF_VERSION                    = 0x00010005
    1825  BASE_NAME                      = BaseCryptLibRuntimeCryptProtocol
     26  MODULE_UNI_FILE                = BaseCryptLibRuntimeCryptProtocol.uni
    1927  FILE_GUID                      = BBB31581-855A-44D7-A550-8A585D9B2DE9
    2028  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
     
    3139[Sources]
    3240  RuntimeDxeIpfCryptLib.c
     41  InternalCryptLib.h
     42  Hash/CryptMd4Null.c
     43  Hash/CryptMd5Null.c
     44  Hash/CryptSha1Null.c
     45  Hmac/CryptHmacMd5Null.c
     46  Hmac/CryptHmacSha1Null.c
     47  Cipher/CryptAesNull.c
     48  Cipher/CryptTdesNull.c
     49  Cipher/CryptArc4Null.c
     50  Pk/CryptRsaExtNull.c
     51  Pk/CryptPkcs7SignNull.c
     52  Pk/CryptPkcs7VerifyNull.c
     53  Pk/CryptDhNull.c
     54  Pk/CryptX509Null.c
     55  Pk/CryptAuthenticodeNull.c
     56  Pem/CryptPemNull.c
     57  Rand/CryptRandNull.c
    3358
    3459[Packages]
     
    3964  BaseLib
    4065  DebugLib
     66  UefiBootServicesTableLib
     67  UefiRuntimeLib
    4168
    4269[Guids]
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/RuntimeDxeIpfCryptLib.c

    r48674 r58459  
    219219
    220220/**
     221  Makes a copy of an existing SHA-256 context.
     222
     223  Return FALSE to indicate this interface is not supported.
     224
     225  @param[in]  Sha256Context     Pointer to SHA-256 context being copied.
     226  @param[out] NewSha256Context  Pointer to new SHA-256 context.
     227
     228  @retval FALSE  This interface is not supported.
     229
     230**/
     231BOOLEAN
     232EFIAPI
     233Sha256Duplicate (
     234  IN   CONST VOID  *Sha256Context,
     235  OUT  VOID        *NewSha256Context
     236  )
     237{
     238  ASSERT (FALSE);
     239  return FALSE;
     240}
     241
     242
     243/**
    221244  Performs SHA-256 digest on a data buffer of the specified length. This function can
    222245  be called multiple times to compute the digest of long or discontinuous data streams.
     
    278301
    279302/**
    280   Allocates and Initializes one RSA Context for subsequent use.
    281 
    282   @return  Pointer to the RSA Context that has been initialized.
     303  Allocates and initializes one RSA context for subsequent use.
     304
     305  @return  Pointer to the RSA context that has been initialized.
    283306           If the allocations fails, RsaNew() returns NULL.
    284307
     
    298321
    299322/**
    300   Release the specified RSA Context.
     323  Release the specified RSA context.
    301324
    302325  @param[in]  RsaContext  Pointer to the RSA context to be released.
     
    317340
    318341/**
    319   Sets the tag-designated RSA key component into the established RSA context from
    320   the user-specified nonnegative integer (octet string format represented in RSA
    321   PKCS#1).
     342  Sets the tag-designated key component into the established RSA context.
     343
     344  This function sets the tag-designated RSA key component into the established
     345  RSA context from the user-specified non-negative integer (octet string format
     346  represented in RSA PKCS#1).
     347  If BigNumber is NULL, then the specified key componenet in RSA context is cleared.
    322348
    323349  If RsaContext is NULL, then return FALSE.
     
    326352  @param[in]       KeyTag      Tag of RSA key component being set.
    327353  @param[in]       BigNumber   Pointer to octet integer buffer.
    328   @param[in]       BnLength    Length of big number buffer in bytes.
    329 
    330   @return  TRUE   RSA key component was set successfully.
    331   @return  FALSE  Invalid RSA key component tag.
     354                               If NULL, then the specified key componenet in RSA
     355                               context is cleared.
     356  @param[in]       BnSize      Size of big number buffer in bytes.
     357                               If BigNumber is NULL, then it is ignored.
     358
     359  @retval  TRUE   RSA key component was set successfully.
     360  @retval  FALSE  Invalid RSA key component tag.
    332361
    333362**/
     
    335364EFIAPI
    336365RsaSetKey (
    337   IN OUT VOID         *RsaContext,
    338   IN     RSA_KEY_TAG  KeyTag,
    339   IN     CONST UINT8  *BigNumber,
    340   IN     UINTN        BnLength
    341   )
    342 {
    343   if (!InternalIsCryptServiveAvailable ()) {
    344     return FALSE;
    345   }
    346 
    347   return mCryptProtocol->RsaSetKey (RsaContext, KeyTag, BigNumber, BnLength);
     366  IN OUT  VOID         *RsaContext,
     367  IN      RSA_KEY_TAG  KeyTag,
     368  IN      CONST UINT8  *BigNumber,
     369  IN      UINTN        BnSize
     370  )
     371{
     372  if (!InternalIsCryptServiveAvailable ()) {
     373    return FALSE;
     374  }
     375
     376  return mCryptProtocol->RsaSetKey (RsaContext, KeyTag, BigNumber, BnSize);
    348377}
    349378
     
    355384  If MessageHash is NULL, then return FALSE.
    356385  If Signature is NULL, then return FALSE.
    357   If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
     386  If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
    358387
    359388  @param[in]  RsaContext   Pointer to RSA context for signature verification.
    360389  @param[in]  MessageHash  Pointer to octet message hash to be checked.
    361   @param[in]  HashLength   Length of the message hash in bytes.
     390  @param[in]  HashSize     Size of the message hash in bytes.
    362391  @param[in]  Signature    Pointer to RSA PKCS1-v1_5 signature to be verified.
    363   @param[in]  SigLength    Length of signature in bytes.
    364 
    365   @return  TRUE   Valid signature encoded in PKCS1-v1_5.
    366   @return  FALSE  Invalid signature or invalid RSA context.
     392  @param[in]  SigSize      Size of signature in bytes.
     393
     394  @retval  TRUE   Valid signature encoded in PKCS1-v1_5.
     395  @retval  FALSE  Invalid signature or invalid RSA context.
    367396
    368397**/
     
    372401  IN  VOID         *RsaContext,
    373402  IN  CONST UINT8  *MessageHash,
    374   IN  UINTN        HashLength,
    375   IN  UINT8        *Signature,
    376   IN  UINTN        SigLength
     403  IN  UINTN        HashSize,
     404  IN  CONST UINT8  *Signature,
     405  IN  UINTN        SigSize
    377406  )
    378407{
     
    384413                           RsaContext,
    385414                           MessageHash,
    386                            HashLength,
     415                           HashSize,
    387416                           Signature,
    388                            SigLength
     417                           SigSize
    389418                           );
    390419}
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf

    r48674 r58459  
    22#  Intrinsic Routines Wrapper Library Instance.
    33#
    4 #  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
    77#  which accompanies this distribution.  The full text of the license may be found at
    88#  http://opensource.org/licenses/bsd-license.php
    9 # 
     9#
    1010#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    12 # 
     12#
    1313##
    1414
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = BaseIntrinsicLib
     18  MODULE_UNI_FILE                = BaseIntrinsicLib.uni
    1819  FILE_GUID                      = 63850097-3E97-4c4f-A52D-C811A0106105
    1920  MODULE_TYPE                    = BASE
     
    3233[Sources.IA32]
    3334  CopyMem.c
     35
     36  Ia32/MathLShiftS64.c      | MSFT
     37  Ia32/MathRShiftU64.c      | MSFT
     38
     39  Ia32/MathLShiftS64.c      | INTEL
     40  Ia32/MathRShiftU64.c      | INTEL
     41
     42  Ia32/MathLShiftS64.S      | GCC
     43  Ia32/MathRShiftU64.S      | GCC
    3444
    3545[Sources.X64]
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c

    r48674 r58459  
    33  Cryptographic Library.
    44
    5 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    66This program and the accompanying materials
    77are licensed and made available under the terms and conditions of the BSD License
     
    2525{
    2626  //
     27  // NOTE: Here we use one base implementation for memset, instead of the direct
     28  //       optimized SetMem() wrapper. Because the IntrinsicLib has to be built
     29  //       without whole program optimization option, and there will be some
     30  //       potential register usage errors when calling other optimized codes.
     31  //
     32
     33  //
    2734  // Declare the local variables that actually move the data elements as
    2835  // volatile to prevent the optimizer from replacing this function with
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/OpensslLib/Install.cmd

    r48674 r58459  
    1 cd openssl-0.9.8w
    2 copy e_os2.h              ..\..\..\Include\openssl
    3 copy crypto\crypto.h  ..\..\..\Include\openssl
    4 copy crypto\tmdiff.h  ..\..\..\Include\openssl
    5 copy crypto\opensslv.h ..\..\..\Include\openssl
    6 copy crypto\opensslconf.h ..\..\..\Include\openssl
    7 copy crypto\ebcdic.h ..\..\..\Include\openssl
    8 copy crypto\symhacks.h ..\..\..\Include\openssl
    9 copy crypto\ossl_typ.h ..\..\..\Include\openssl
    10 copy crypto\md2\md2.h ..\..\..\Include\openssl
    11 copy crypto\md4\md4.h ..\..\..\Include\openssl
    12 copy crypto\md5\md5.h ..\..\..\Include\openssl
    13 copy crypto\sha\sha.h ..\..\..\Include\openssl
    14 copy crypto\hmac\hmac.h ..\..\..\Include\openssl
    15 copy crypto\ripemd\ripemd.h ..\..\..\Include\openssl
    16 copy crypto\des\des.h ..\..\..\Include\openssl
    17 copy crypto\des\des_old.h ..\..\..\Include\openssl
    18 copy crypto\rc2\rc2.h ..\..\..\Include\openssl
    19 copy crypto\rc4\rc4.h ..\..\..\Include\openssl
    20 copy crypto\idea\idea.h ..\..\..\Include\openssl
    21 copy crypto\bf\blowfish.h ..\..\..\Include\openssl
    22 copy crypto\cast\cast.h ..\..\..\Include\openssl
    23 copy crypto\aes\aes.h ..\..\..\Include\openssl
    24 copy crypto\bn\bn.h ..\..\..\Include\openssl
    25 copy crypto\rsa\rsa.h ..\..\..\Include\openssl
    26 copy crypto\dsa\dsa.h ..\..\..\Include\openssl
    27 copy crypto\dso\dso.h ..\..\..\Include\openssl
    28 copy crypto\dh\dh.h ..\..\..\Include\openssl
    29 copy crypto\ec\ec.h ..\..\..\Include\openssl
    30 copy crypto\ecdh\ecdh.h ..\..\..\Include\openssl
    31 copy crypto\ecdsa\ecdsa.h ..\..\..\Include\openssl
    32 copy crypto\buffer\buffer.h ..\..\..\Include\openssl
    33 copy crypto\bio\bio.h ..\..\..\Include\openssl
    34 copy crypto\stack\stack.h ..\..\..\Include\openssl
    35 copy crypto\stack\safestack.h ..\..\..\Include\openssl
    36 copy crypto\lhash\lhash.h ..\..\..\Include\openssl
    37 copy crypto\rand\rand.h ..\..\..\Include\openssl
    38 copy crypto\err\err.h ..\..\..\Include\openssl
    39 copy crypto\objects\objects.h ..\..\..\Include\openssl
    40 copy crypto\objects\obj_mac.h ..\..\..\Include\openssl
    41 copy crypto\evp\evp.h ..\..\..\Include\openssl
    42 copy crypto\asn1\asn1.h ..\..\..\Include\openssl
    43 copy crypto\asn1\asn1_mac.h ..\..\..\Include\openssl
    44 copy crypto\asn1\asn1t.h ..\..\..\Include\openssl
    45 copy crypto\pem\pem.h ..\..\..\Include\openssl
    46 copy crypto\pem\pem2.h ..\..\..\Include\openssl
    47 copy crypto\x509\x509.h ..\..\..\Include\openssl
    48 copy crypto\x509\x509_vfy.h ..\..\..\Include\openssl
    49 copy crypto\x509v3\x509v3.h ..\..\..\Include\openssl
    50 copy crypto\conf\conf.h ..\..\..\Include\openssl
    51 copy crypto\conf\conf_api.h ..\..\..\Include\openssl
    52 copy crypto\txt_db\txt_db.h ..\..\..\Include\openssl
    53 copy crypto\pkcs7\pkcs7.h ..\..\..\Include\openssl
    54 copy crypto\pkcs12\pkcs12.h ..\..\..\Include\openssl
    55 copy crypto\comp\comp.h ..\..\..\Include\openssl
    56 copy crypto\engine\engine.h ..\..\..\Include\openssl
    57 copy crypto\ocsp\ocsp.h ..\..\..\Include\openssl
    58 copy crypto\ui\ui.h ..\..\..\Include\openssl
    59 copy crypto\ui\ui_compat.h ..\..\..\Include\openssl
    60 copy crypto\krb5\krb5_asn.h ..\..\..\Include\openssl
    61 copy crypto\store\store.h ..\..\..\Include\openssl
    62 copy crypto\pqueue\pqueue.h ..\..\..\Include\openssl
    63 copy crypto\pqueue\pq_compat.h ..\..\..\Include\openssl
    64 copy ssl\ssl.h ..\..\..\Include\openssl
    65 copy ssl\ssl2.h ..\..\..\Include\openssl
    66 copy ssl\ssl3.h ..\..\..\Include\openssl
    67 copy ssl\ssl23.h ..\..\..\Include\openssl
    68 copy ssl\tls1.h ..\..\..\Include\openssl
    69 copy ssl\dtls1.h ..\..\..\Include\openssl
    70 copy ssl\kssl.h ..\..\..\Include\openssl
     1cd openssl-1.0.2d
     2copy e_os2.h                    ..\..\..\Include\openssl
     3copy crypto\crypto.h            ..\..\..\Include\openssl
     4copy crypto\opensslv.h          ..\..\..\Include\openssl
     5copy crypto\opensslconf.h       ..\..\..\Include\openssl
     6copy crypto\ebcdic.h            ..\..\..\Include\openssl
     7copy crypto\symhacks.h          ..\..\..\Include\openssl
     8copy crypto\ossl_typ.h          ..\..\..\Include\openssl
     9copy crypto\objects\objects.h   ..\..\..\Include\openssl
     10copy crypto\objects\obj_mac.h   ..\..\..\Include\openssl
     11copy crypto\md4\md4.h           ..\..\..\Include\openssl
     12copy crypto\md5\md5.h           ..\..\..\Include\openssl
     13copy crypto\sha\sha.h           ..\..\..\Include\openssl
     14copy crypto\mdc2\mdc2.h         ..\..\..\Include\openssl
     15copy crypto\hmac\hmac.h         ..\..\..\Include\openssl
     16copy crypto\ripemd\ripemd.h     ..\..\..\Include\openssl
     17copy crypto\whrlpool\whrlpool.h ..\..\..\Include\openssl
     18copy crypto\des\des.h           ..\..\..\Include\openssl
     19copy crypto\des\des_old.h       ..\..\..\Include\openssl
     20copy crypto\aes\aes.h           ..\..\..\Include\openssl
     21copy crypto\rc2\rc2.h           ..\..\..\Include\openssl
     22copy crypto\rc4\rc4.h           ..\..\..\Include\openssl
     23copy crypto\idea\idea.h         ..\..\..\Include\openssl
     24copy crypto\bf\blowfish.h       ..\..\..\Include\openssl
     25copy crypto\cast\cast.h         ..\..\..\Include\openssl
     26copy crypto\camellia\camellia.h ..\..\..\Include\openssl
     27copy crypto\seed\seed.h         ..\..\..\Include\openssl
     28copy crypto\modes\modes.h       ..\..\..\Include\openssl
     29copy crypto\bn\bn.h             ..\..\..\Include\openssl
     30copy crypto\ec\ec.h             ..\..\..\Include\openssl
     31copy crypto\rsa\rsa.h           ..\..\..\Include\openssl
     32copy crypto\dsa\dsa.h           ..\..\..\Include\openssl
     33copy crypto\ecdsa\ecdsa.h       ..\..\..\Include\openssl
     34copy crypto\dh\dh.h             ..\..\..\Include\openssl
     35copy crypto\ecdh\ecdh.h         ..\..\..\Include\openssl
     36copy crypto\dso\dso.h           ..\..\..\Include\openssl
     37copy crypto\engine\engine.h     ..\..\..\Include\openssl
     38copy crypto\buffer\buffer.h     ..\..\..\Include\openssl
     39copy crypto\bio\bio.h           ..\..\..\Include\openssl
     40copy crypto\stack\stack.h       ..\..\..\Include\openssl
     41copy crypto\stack\safestack.h   ..\..\..\Include\openssl
     42copy crypto\lhash\lhash.h       ..\..\..\Include\openssl
     43copy crypto\rand\rand.h         ..\..\..\Include\openssl
     44copy crypto\err\err.h           ..\..\..\Include\openssl
     45copy crypto\evp\evp.h           ..\..\..\Include\openssl
     46copy crypto\asn1\asn1.h         ..\..\..\Include\openssl
     47copy crypto\asn1\asn1_mac.h     ..\..\..\Include\openssl
     48copy crypto\asn1\asn1t.h        ..\..\..\Include\openssl
     49copy crypto\pem\pem.h           ..\..\..\Include\openssl
     50copy crypto\pem\pem2.h          ..\..\..\Include\openssl
     51copy crypto\x509\x509.h         ..\..\..\Include\openssl
     52copy crypto\x509\x509_vfy.h     ..\..\..\Include\openssl
     53copy crypto\x509v3\x509v3.h     ..\..\..\Include\openssl
     54copy crypto\conf\conf.h         ..\..\..\Include\openssl
     55copy crypto\conf\conf_api.h     ..\..\..\Include\openssl
     56copy crypto\txt_db\txt_db.h     ..\..\..\Include\openssl
     57copy crypto\pkcs7\pkcs7.h       ..\..\..\Include\openssl
     58copy crypto\pkcs12\pkcs12.h     ..\..\..\Include\openssl
     59copy crypto\comp\comp.h         ..\..\..\Include\openssl
     60copy crypto\ocsp\ocsp.h         ..\..\..\Include\openssl
     61copy crypto\ui\ui.h             ..\..\..\Include\openssl
     62copy crypto\ui\ui_compat.h      ..\..\..\Include\openssl
     63copy crypto\krb5\krb5_asn.h     ..\..\..\Include\openssl
     64copy crypto\cms\cms.h           ..\..\..\Include\openssl
     65copy crypto\pqueue\pqueue.h     ..\..\..\Include\openssl
     66copy crypto\ts\ts.h             ..\..\..\Include\openssl
     67copy crypto\srp\srp.h           ..\..\..\Include\openssl
     68copy crypto\cmac\cmac.h         ..\..\..\Include\openssl
     69copy ssl\ssl.h                  ..\..\..\Include\openssl
     70copy ssl\ssl2.h                 ..\..\..\Include\openssl
     71copy ssl\ssl3.h                 ..\..\..\Include\openssl
     72copy ssl\ssl23.h                ..\..\..\Include\openssl
     73copy ssl\tls1.h                 ..\..\..\Include\openssl
     74copy ssl\dtls1.h                ..\..\..\Include\openssl
     75copy ssl\kssl.h                 ..\..\..\Include\openssl
     76copy ssl\srtp.h                 ..\..\..\Include\openssl
    7177cd ..
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/OpensslLib/Install.sh

    r48674 r58459  
    11#!/bin/sh
    22
    3 cd openssl-0.9.8w
    4 cp e_os2.h ../../../Include/openssl
    5 cp crypto/crypto.h ../../../Include/openssl
    6 cp crypto/tmdiff.h ../../../Include/openssl
    7 cp crypto/opensslv.h ../../../Include/openssl
    8 cp crypto/opensslconf.h ../../../Include/openssl
    9 cp crypto/ebcdic.h ../../../Include/openssl
    10 cp crypto/symhacks.h ../../../Include/openssl
    11 cp crypto/ossl_typ.h ../../../Include/openssl
    12 cp crypto/md2/md2.h ../../../Include/openssl
    13 cp crypto/md4/md4.h ../../../Include/openssl
    14 cp crypto/md5/md5.h ../../../Include/openssl
    15 cp crypto/sha/sha.h ../../../Include/openssl
    16 cp crypto/hmac/hmac.h ../../../Include/openssl
    17 cp crypto/ripemd/ripemd.h ../../../Include/openssl
    18 cp crypto/des/des.h ../../../Include/openssl
    19 cp crypto/des/des_old.h ../../../Include/openssl
    20 cp crypto/rc2/rc2.h ../../../Include/openssl
    21 cp crypto/rc4/rc4.h ../../../Include/openssl
    22 cp crypto/idea/idea.h ../../../Include/openssl
    23 cp crypto/bf/blowfish.h ../../../Include/openssl
    24 cp crypto/cast/cast.h ../../../Include/openssl
    25 cp crypto/aes/aes.h ../../../Include/openssl
    26 cp crypto/bn/bn.h ../../../Include/openssl
    27 cp crypto/rsa/rsa.h ../../../Include/openssl
    28 cp crypto/dsa/dsa.h ../../../Include/openssl
    29 cp crypto/dso/dso.h ../../../Include/openssl
    30 cp crypto/dh/dh.h ../../../Include/openssl
    31 cp crypto/ec/ec.h ../../../Include/openssl
    32 cp crypto/ecdh/ecdh.h ../../../Include/openssl
    33 cp crypto/ecdsa/ecdsa.h ../../../Include/openssl
    34 cp crypto/buffer/buffer.h ../../../Include/openssl
    35 cp crypto/bio/bio.h ../../../Include/openssl
    36 cp crypto/stack/stack.h ../../../Include/openssl
    37 cp crypto/stack/safestack.h ../../../Include/openssl
    38 cp crypto/lhash/lhash.h ../../../Include/openssl
    39 cp crypto/rand/rand.h ../../../Include/openssl
    40 cp crypto/err/err.h ../../../Include/openssl
    41 cp crypto/objects/objects.h ../../../Include/openssl
    42 cp crypto/objects/obj_mac.h ../../../Include/openssl
    43 cp crypto/evp/evp.h ../../../Include/openssl
    44 cp crypto/asn1/asn1.h ../../../Include/openssl
    45 cp crypto/asn1/asn1_mac.h ../../../Include/openssl
    46 cp crypto/asn1/asn1t.h ../../../Include/openssl
    47 cp crypto/pem/pem.h ../../../Include/openssl
    48 cp crypto/pem/pem2.h ../../../Include/openssl
    49 cp crypto/x509/x509.h ../../../Include/openssl
    50 cp crypto/x509/x509_vfy.h ../../../Include/openssl
    51 cp crypto/x509v3/x509v3.h ../../../Include/openssl
    52 cp crypto/conf/conf.h ../../../Include/openssl
    53 cp crypto/conf/conf_api.h ../../../Include/openssl
    54 cp crypto/txt_db/txt_db.h ../../../Include/openssl
    55 cp crypto/pkcs7/pkcs7.h ../../../Include/openssl
    56 cp crypto/pkcs12/pkcs12.h ../../../Include/openssl
    57 cp crypto/comp/comp.h ../../../Include/openssl
    58 cp crypto/engine/engine.h ../../../Include/openssl
    59 cp crypto/ocsp/ocsp.h ../../../Include/openssl
    60 cp crypto/ui/ui.h ../../../Include/openssl
    61 cp crypto/ui/ui_compat.h ../../../Include/openssl
    62 cp crypto/krb5/krb5_asn.h ../../../Include/openssl
    63 cp crypto/store/store.h ../../../Include/openssl
    64 cp crypto/pqueue/pqueue.h ../../../Include/openssl
    65 cp crypto/pqueue/pq_compat.h ../../../Include/openssl
    66 cp ssl/ssl.h ../../../Include/openssl
    67 cp ssl/ssl2.h ../../../Include/openssl
    68 cp ssl/ssl3.h ../../../Include/openssl
    69 cp ssl/ssl23.h ../../../Include/openssl
    70 cp ssl/tls1.h ../../../Include/openssl
    71 cp ssl/dtls1.h ../../../Include/openssl
    72 cp ssl/kssl.h ../../../Include/openssl
     3cd openssl-1.0.2d
     4cp e_os2.h                    ../../../Include/openssl
     5cp crypto/crypto.h            ../../../Include/openssl
     6cp crypto/opensslv.h          ../../../Include/openssl
     7cp crypto/opensslconf.h       ../../../Include/openssl
     8cp crypto/ebcdic.h            ../../../Include/openssl
     9cp crypto/symhacks.h          ../../../Include/openssl
     10cp crypto/ossl_typ.h          ../../../Include/openssl
     11cp crypto/objects/objects.h   ../../../Include/openssl
     12cp crypto/objects/obj_mac.h   ../../../Include/openssl
     13cp crypto/md4/md4.h           ../../../Include/openssl
     14cp crypto/md5/md5.h           ../../../Include/openssl
     15cp crypto/sha/sha.h           ../../../Include/openssl
     16cp crypto/mdc2/mdc2.h         ../../../Include/openssl
     17cp crypto/hmac/hmac.h         ../../../Include/openssl
     18cp crypto/ripemd/ripemd.h     ../../../Include/openssl
     19cp crypto/whrlpool/whrlpool.h ../../../Include/openssl
     20cp crypto/des/des.h           ../../../Include/openssl
     21cp crypto/des/des_old.h       ../../../Include/openssl
     22cp crypto/aes/aes.h           ../../../Include/openssl
     23cp crypto/rc2/rc2.h           ../../../Include/openssl
     24cp crypto/rc4/rc4.h           ../../../Include/openssl
     25cp crypto/idea/idea.h         ../../../Include/openssl
     26cp crypto/bf/blowfish.h       ../../../Include/openssl
     27cp crypto/cast/cast.h         ../../../Include/openssl
     28cp crypto/camellia/camellia.h ../../../Include/openssl
     29cp crypto/seed/seed.h         ../../../Include/openssl
     30cp crypto/modes/modes.h       ../../../Include/openssl
     31cp crypto/bn/bn.h             ../../../Include/openssl
     32cp crypto/ec/ec.h             ../../../Include/openssl
     33cp crypto/rsa/rsa.h           ../../../Include/openssl
     34cp crypto/dsa/dsa.h           ../../../Include/openssl
     35cp crypto/ecdsa/ecdsa.h       ../../../Include/openssl
     36cp crypto/dh/dh.h             ../../../Include/openssl
     37cp crypto/ecdh/ecdh.h         ../../../Include/openssl
     38cp crypto/dso/dso.h           ../../../Include/openssl
     39cp crypto/engine/engine.h     ../../../Include/openssl
     40cp crypto/buffer/buffer.h     ../../../Include/openssl
     41cp crypto/bio/bio.h           ../../../Include/openssl
     42cp crypto/stack/stack.h       ../../../Include/openssl
     43cp crypto/stack/safestack.h   ../../../Include/openssl
     44cp crypto/lhash/lhash.h       ../../../Include/openssl
     45cp crypto/rand/rand.h         ../../../Include/openssl
     46cp crypto/err/err.h           ../../../Include/openssl
     47cp crypto/evp/evp.h           ../../../Include/openssl
     48cp crypto/asn1/asn1.h         ../../../Include/openssl
     49cp crypto/asn1/asn1_mac.h     ../../../Include/openssl
     50cp crypto/asn1/asn1t.h        ../../../Include/openssl
     51cp crypto/pem/pem.h           ../../../Include/openssl
     52cp crypto/pem/pem2.h          ../../../Include/openssl
     53cp crypto/x509/x509.h         ../../../Include/openssl
     54cp crypto/x509/x509_vfy.h     ../../../Include/openssl
     55cp crypto/x509v3/x509v3.h     ../../../Include/openssl
     56cp crypto/conf/conf.h         ../../../Include/openssl
     57cp crypto/conf/conf_api.h     ../../../Include/openssl
     58cp crypto/txt_db/txt_db.h     ../../../Include/openssl
     59cp crypto/pkcs7/pkcs7.h       ../../../Include/openssl
     60cp crypto/pkcs12/pkcs12.h     ../../../Include/openssl
     61cp crypto/comp/comp.h         ../../../Include/openssl
     62cp crypto/ocsp/ocsp.h         ../../../Include/openssl
     63cp crypto/ui/ui.h             ../../../Include/openssl
     64cp crypto/ui/ui_compat.h      ../../../Include/openssl
     65cp crypto/krb5/krb5_asn.h     ../../../Include/openssl
     66cp crypto/cms/cms.h           ../../../Include/openssl
     67cp crypto/pqueue/pqueue.h     ../../../Include/openssl
     68cp crypto/ts/ts.h             ../../../Include/openssl
     69cp crypto/srp/srp.h           ../../../Include/openssl
     70cp crypto/cmac/cmac.h         ../../../Include/openssl
     71cp ssl/ssl.h                  ../../../Include/openssl
     72cp ssl/ssl2.h                 ../../../Include/openssl
     73cp ssl/ssl3.h                 ../../../Include/openssl
     74cp ssl/ssl23.h                ../../../Include/openssl
     75cp ssl/tls1.h                 ../../../Include/openssl
     76cp ssl/dtls1.h                ../../../Include/openssl
     77cp ssl/kssl.h                 ../../../Include/openssl
     78cp ssl/srtp.h                 ../../../Include/openssl
    7379cd ..
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/OpensslLib/OpensslLib.inf

    r48674 r58459  
    11## @file
    2 # OpenSSL Library implementation.
    3 # 
    4 #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
     2#  This module provides openSSL Library implementation.
     3#
     4#  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
    77#  which accompanies this distribution.  The full text of the license may be found at
    88#  http://opensource.org/licenses/bsd-license.php
    9 # 
     9#
    1010#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    12 # 
     12#
    1313##
    1414
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = OpensslLib
     18  MODULE_UNI_FILE                = OpensslLib.uni
    1819  FILE_GUID                      = C873A7D0-9824-409f-9B42-2C158B992E69
    1920  MODULE_TYPE                    = BASE
    2021  VERSION_STRING                 = 1.0
    2122  LIBRARY_CLASS                  = OpensslLib
    22   DEFINE OPENSSL_PATH            = openssl-0.9.8w
    23   DEFINE OPENSSL_FLAGS           = -DOPENSSL_SYSNAME_UWIN -DOPENSSL_SYS_UEFI -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_SOCK -DOPENSSL_NO_CMS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_ERR -DOPENSSL_NO_KRB5 -DOPENSSL_NO_DYNAMIC_ENGINE -DGETPID_IS_MEANINGLESS -DOPENSSL_NO_STDIO -DOPENSSL_NO_FP_API -DOPENSSL_NO_DGRAM -DOPENSSL_NO_ASM
    24   DEFINE OPENSSL_EXFLAGS         = -DOPENSSL_SMALL_FOOTPRINT -DOPENSSL_NO_SHA0 -DOPENSSL_NO_SHA512 -DOPENSSL_NO_LHASH -DOPENSSL_NO_HW -DOPENSSL_NO_OCSP -DOPENSSL_NO_LOCKING -DOPENSSL_NO_DEPRECATED
    25  
     23  DEFINE OPENSSL_PATH            = openssl-1.0.2d
     24  DEFINE OPENSSL_FLAGS           = -DOPENSSL_SYSNAME_UWIN -DOPENSSL_SYS_UEFI -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_SOCK -DOPENSSL_NO_CMS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_ERR -DOPENSSL_NO_KRB5 -DOPENSSL_NO_DYNAMIC_ENGINE -DGETPID_IS_MEANINGLESS -DOPENSSL_NO_STDIO -DOPENSSL_NO_POSIX_IO -DOPENSSL_NO_FP_API -DOPENSSL_NO_DGRAM -DOPENSSL_NO_ASM
     25  DEFINE OPENSSL_EXFLAGS         = -DOPENSSL_SMALL_FOOTPRINT -DOPENSSL_NO_SHA0 -DOPENSSL_NO_LHASH -DOPENSSL_NO_HW -DOPENSSL_NO_OCSP -DOPENSSL_NO_LOCKING -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC2 -DOPENSSL_NO_IDEA -DOPENSSL_NO_BF -DOPENSSL_NO_CAST -DOPENSSL_NO_WHIRLPOOL -DOPENSSL_NO_DSA -DOPENSSL_NO_EC -DOPENSSL_NO_ECDH -DOPENSSL_NO_ECDSA -DOPENSSL_NO_SRP -DOPENSSL_NO_ENGINE
     26
    2627#
    27 # OPENSSL_FLAGS is set to define the following flags to be compatible with 
    28 # EDK II build system and UEFI executiuon environment 
     28# OPENSSL_FLAGS is set to define the following flags to be compatible with
     29# EDK II build system and UEFI executiuon environment
    2930#
    3031#   OPENSSL_SYSNAME_UWIN
    31 #   OPENSSL_SYS_UEFI
    32 #   L_ENDIAN
    33 #   _CRT_SECURE_NO_DEPRECATE
    34 #   _CRT_NONSTDC_NO_DEPRECATE
    35 #   OPENSSL_NO_CAMELLIA
    36 #   OPENSSL_NO_SEED
    37 #   OPENSSL_NO_RC5
    38 #   OPENSSL_NO_MDC2
    39 #   OPENSSL_NO_SOCK
    40 #   OPENSSL_NO_CMS
    41 #   OPENSSL_NO_JPAKE
    42 #   OPENSSL_NO_CAPIENG
    43 #   OPENSSL_NO_ERR
    44 #   OPENSSL_NO_KRB5
    45 #   OPENSSL_NO_DYNAMIC_ENGINE
    46 #   GETPID_IS_MEANINGLESS
    47 #   OPENSSL_NO_STDIO
    48 #   OPENSSL_NO_FP_API
    49 #   OPENSSL_NO_DGRAM 
     32#   OPENSSL_SYS_UEFI
     33#   L_ENDIAN
     34#   _CRT_SECURE_NO_DEPRECATE
     35#   _CRT_NONSTDC_NO_DEPRECATE
     36#   OPENSSL_NO_CAMELLIA
     37#   OPENSSL_NO_SEED
     38#   OPENSSL_NO_RC5
     39#   OPENSSL_NO_MDC2
     40#   OPENSSL_NO_SOCK
     41#   OPENSSL_NO_CMS
     42#   OPENSSL_NO_JPAKE
     43#   OPENSSL_NO_CAPIENG
     44#   OPENSSL_NO_ERR
     45#   OPENSSL_NO_KRB5
     46#   OPENSSL_NO_DYNAMIC_ENGINE
     47#   GETPID_IS_MEANINGLESS
     48#   OPENSSL_NO_STDIO
     49#   OPENSSL_NO_POSIX_IO
     50#   OPENSSL_NO_FP_API
     51#   OPENSSL_NO_DGRAM
    5052#   OPENSSL_NO_ASM
    5153#
    52  
     54
    5355#
    54 #  VALID_ARCHITECTURES           = IA32 X64 IPF ARM
     56#  VALID_ARCHITECTURES           = IA32 X64 IPF ARM AARCH64
    5557#
    5658
     
    5860  $(OPENSSL_PATH)/e_os.h
    5961  $(OPENSSL_PATH)/crypto/cryptlib.c
    60   $(OPENSSL_PATH)/crypto/dyn_lck.c
    6162  $(OPENSSL_PATH)/crypto/mem.c
    6263  $(OPENSSL_PATH)/crypto/mem_clr.c
     
    6465  $(OPENSSL_PATH)/crypto/cversion.c
    6566  $(OPENSSL_PATH)/crypto/ex_data.c
    66 
    67   #
    68   # Not required for UEFI.
    69   #
    70   # $(OPENSSL_PATH)/crypto/tmdiff.c
    71 
    7267  $(OPENSSL_PATH)/crypto/cpt_err.c
    7368  $(OPENSSL_PATH)/crypto/ebcdic.c
     
    7671  $(OPENSSL_PATH)/crypto/o_str.c
    7772  $(OPENSSL_PATH)/crypto/o_dir.c
     73  $(OPENSSL_PATH)/crypto/o_fips.c
    7874  $(OPENSSL_PATH)/crypto/o_init.c
    79   $(OPENSSL_PATH)/crypto/fips_err.c
    80   $(OPENSSL_PATH)/crypto/md2/md2_dgst.c
    81   $(OPENSSL_PATH)/crypto/md2/md2_one.c
     75  $(OPENSSL_PATH)/crypto/fips_ers.c
     76
     77  #
     78  # OBJECTS
     79  #
     80  $(OPENSSL_PATH)/crypto/objects/o_names.c
     81  $(OPENSSL_PATH)/crypto/objects/obj_dat.c
     82  $(OPENSSL_PATH)/crypto/objects/obj_lib.c
     83  $(OPENSSL_PATH)/crypto/objects/obj_err.c
     84  $(OPENSSL_PATH)/crypto/objects/obj_xref.c
     85
     86  #
     87  # MD4
     88  #
    8289  $(OPENSSL_PATH)/crypto/md4/md4_dgst.c
    8390  $(OPENSSL_PATH)/crypto/md4/md4_one.c
     91
     92  #
     93  # MD5
     94  #
    8495  $(OPENSSL_PATH)/crypto/md5/md5_dgst.c
    8596  $(OPENSSL_PATH)/crypto/md5/md5_one.c
     97
     98  #
     99  # SHA
     100  #
    86101  $(OPENSSL_PATH)/crypto/sha/sha_dgst.c
    87102  $(OPENSSL_PATH)/crypto/sha/sha1dgst.c
     
    90105  $(OPENSSL_PATH)/crypto/sha/sha256.c
    91106  $(OPENSSL_PATH)/crypto/sha/sha512.c
     107
     108  #
     109  # MDC2 - Disabled by OPENSSL_NO_MDC2
     110  #
     111  # $(OPENSSL_PATH)/crypto/mdc2/mdc2dgst.c
     112  # $(OPENSSL_PATH)/crypto/mdc2/mdc2_one.c
     113
     114  #
     115  # HMAC
     116  #
    92117  $(OPENSSL_PATH)/crypto/hmac/hmac.c
    93   $(OPENSSL_PATH)/crypto/ripemd/rmd_dgst.c
    94   $(OPENSSL_PATH)/crypto/ripemd/rmd_one.c
    95   $(OPENSSL_PATH)/crypto/des/des_lib.c
    96   $(OPENSSL_PATH)/crypto/des/set_key.c
     118  $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c
     119  $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c
     120
     121  #
     122  # RIPEMD - Disabled by OPENSSL_NO_RIPEMD
     123  #
     124  # $(OPENSSL_PATH)/crypto/ripemd/rmd_dgst.c
     125  # $(OPENSSL_PATH)/crypto/ripemd/rmd_one.c
     126
     127  #
     128  # WHIRLPOOL - Disabled by OPENSSL_NO_WHIRLPOOL
     129  #
     130  # $(OPENSSL_PATH)/crypto/whrlpool/wp_dgst.c
     131  # $(OPENSSL_PATH)/crypto/whrlpool/wp_block.c
     132
     133  #
     134  # DES
     135  #
     136  $(OPENSSL_PATH)/crypto/des/cbc_cksm.c
     137  $(OPENSSL_PATH)/crypto/des/cbc_enc.c
     138  $(OPENSSL_PATH)/crypto/des/cfb64enc.c
     139  $(OPENSSL_PATH)/crypto/des/cfb_enc.c
     140  $(OPENSSL_PATH)/crypto/des/ecb3_enc.c
    97141  $(OPENSSL_PATH)/crypto/des/ecb_enc.c
    98   $(OPENSSL_PATH)/crypto/des/cbc_enc.c
    99   $(OPENSSL_PATH)/crypto/des/ecb3_enc.c
    100   $(OPENSSL_PATH)/crypto/des/cfb64enc.c
    101   $(OPENSSL_PATH)/crypto/des/cfb64ede.c
    102   $(OPENSSL_PATH)/crypto/des/cfb_enc.c
    103   $(OPENSSL_PATH)/crypto/des/ofb64ede.c
    104142  $(OPENSSL_PATH)/crypto/des/enc_read.c
    105143  $(OPENSSL_PATH)/crypto/des/enc_writ.c
     144  $(OPENSSL_PATH)/crypto/des/fcrypt.c
    106145  $(OPENSSL_PATH)/crypto/des/ofb64enc.c
    107146  $(OPENSSL_PATH)/crypto/des/ofb_enc.c
    108   $(OPENSSL_PATH)/crypto/des/str2key.c
    109147  $(OPENSSL_PATH)/crypto/des/pcbc_enc.c
    110148  $(OPENSSL_PATH)/crypto/des/qud_cksm.c
    111149  $(OPENSSL_PATH)/crypto/des/rand_key.c
     150  $(OPENSSL_PATH)/crypto/des/rpc_enc.c
     151  $(OPENSSL_PATH)/crypto/des/set_key.c
    112152  $(OPENSSL_PATH)/crypto/des/des_enc.c
    113153  $(OPENSSL_PATH)/crypto/des/fcrypt_b.c
    114   $(OPENSSL_PATH)/crypto/des/fcrypt.c
    115154  $(OPENSSL_PATH)/crypto/des/xcbc_enc.c
    116   $(OPENSSL_PATH)/crypto/des/rpc_enc.c
    117   $(OPENSSL_PATH)/crypto/des/cbc_cksm.c
     155  $(OPENSSL_PATH)/crypto/des/str2key.c
     156  $(OPENSSL_PATH)/crypto/des/cfb64ede.c
     157  $(OPENSSL_PATH)/crypto/des/ofb64ede.c
    118158  $(OPENSSL_PATH)/crypto/des/ede_cbcm_enc.c
    119159  $(OPENSSL_PATH)/crypto/des/des_old.c
    120160  $(OPENSSL_PATH)/crypto/des/des_old2.c
    121161  $(OPENSSL_PATH)/crypto/des/read2pwd.c
    122   $(OPENSSL_PATH)/crypto/rc2/rc2_ecb.c
    123   $(OPENSSL_PATH)/crypto/rc2/rc2_skey.c
    124   $(OPENSSL_PATH)/crypto/rc2/rc2_cbc.c
    125   $(OPENSSL_PATH)/crypto/rc2/rc2cfb64.c
    126   $(OPENSSL_PATH)/crypto/rc2/rc2ofb64.c
    127   $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c
    128   $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c
    129   $(OPENSSL_PATH)/crypto/rc4/rc4_fblk.c
    130   $(OPENSSL_PATH)/crypto/idea/i_cbc.c
    131   $(OPENSSL_PATH)/crypto/idea/i_cfb64.c
    132   $(OPENSSL_PATH)/crypto/idea/i_ofb64.c
    133   $(OPENSSL_PATH)/crypto/idea/i_ecb.c
    134   $(OPENSSL_PATH)/crypto/idea/i_skey.c
    135   $(OPENSSL_PATH)/crypto/bf/bf_skey.c
    136   $(OPENSSL_PATH)/crypto/bf/bf_ecb.c
    137   $(OPENSSL_PATH)/crypto/bf/bf_enc.c
    138   $(OPENSSL_PATH)/crypto/bf/bf_cfb64.c
    139   $(OPENSSL_PATH)/crypto/bf/bf_ofb64.c
    140   $(OPENSSL_PATH)/crypto/cast/c_skey.c
    141   $(OPENSSL_PATH)/crypto/cast/c_ecb.c
    142   $(OPENSSL_PATH)/crypto/cast/c_enc.c
    143   $(OPENSSL_PATH)/crypto/cast/c_cfb64.c
    144   $(OPENSSL_PATH)/crypto/cast/c_ofb64.c
     162
     163  #
     164  # AES
     165  #
     166  $(OPENSSL_PATH)/crypto/aes/aes_core.c
    145167  $(OPENSSL_PATH)/crypto/aes/aes_misc.c
    146168  $(OPENSSL_PATH)/crypto/aes/aes_ecb.c
     169  $(OPENSSL_PATH)/crypto/aes/aes_cbc.c
    147170  $(OPENSSL_PATH)/crypto/aes/aes_cfb.c
    148171  $(OPENSSL_PATH)/crypto/aes/aes_ofb.c
     
    150173  $(OPENSSL_PATH)/crypto/aes/aes_ige.c
    151174  $(OPENSSL_PATH)/crypto/aes/aes_wrap.c
    152   $(OPENSSL_PATH)/crypto/aes/aes_core.c
    153   $(OPENSSL_PATH)/crypto/aes/aes_cbc.c
     175
     176  #
     177  # RC2 - Disabled by OPENSSL_NO_RC2
     178  #
     179  # $(OPENSSL_PATH)/crypto/rc2/rc2_ecb.c
     180  # $(OPENSSL_PATH)/crypto/rc2/rc2_skey.c
     181  # $(OPENSSL_PATH)/crypto/rc2/rc2_cbc.c
     182  # $(OPENSSL_PATH)/crypto/rc2/rc2cfb64.c
     183  # $(OPENSSL_PATH)/crypto/rc2/rc2ofb64.c
     184
     185  #
     186  # RC4
     187  #
     188  $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c
     189  $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c
     190  $(OPENSSL_PATH)/crypto/rc4/rc4_utl.c
     191
     192  #
     193  # RC5 - Disabled by OPENSSL_NO_RC5
     194  #
     195  # $(OPENSSL_PATH)/crypto/rc5/rc5_skey.c
     196  # $(OPENSSL_PATH)/crypto/rc5/rc5_ecb.c
     197  # $(OPENSSL_PATH)/crypto/rc5/rc5_enc.c
     198  # $(OPENSSL_PATH)/crypto/rc5/rc5cfb64.c
     199  # $(OPENSSL_PATH)/crypto/rc5/rc5ofb64.c
     200
     201  #
     202  # IDEA - Disabled by OPENSSL_NO_IDEA
     203  #
     204  # $(OPENSSL_PATH)/crypto/idea/i_cbc.c
     205  # $(OPENSSL_PATH)/crypto/idea/i_cfb64.c
     206  # $(OPENSSL_PATH)/crypto/idea/i_ofb64.c
     207  # $(OPENSSL_PATH)/crypto/idea/i_ecb.c
     208  # $(OPENSSL_PATH)/crypto/idea/i_skey.c
     209
     210  #
     211  # BLOWFISH - Disabled by OPENSSL_NO_BF
     212  #
     213  # $(OPENSSL_PATH)/crypto/bf/bf_skey.c
     214  # $(OPENSSL_PATH)/crypto/bf/bf_ecb.c
     215  # $(OPENSSL_PATH)/crypto/bf/bf_enc.c
     216  # $(OPENSSL_PATH)/crypto/bf/bf_cfb64.c
     217  # $(OPENSSL_PATH)/crypto/bf/bf_ofb64.c
     218
     219  #
     220  # CAST - Disabled by OPENSSL_NO_CAST
     221  #
     222  # $(OPENSSL_PATH)/crypto/cast/c_skey.c
     223  # $(OPENSSL_PATH)/crypto/cast/c_ecb.c
     224  # $(OPENSSL_PATH)/crypto/cast/c_enc.c
     225  # $(OPENSSL_PATH)/crypto/cast/c_cfb64.c
     226  # $(OPENSSL_PATH)/crypto/cast/c_ofb64.c
     227
     228  #
     229  # CAMELLIA - Disabled by OPENSSL_NO_CAMELLIA
     230  #
     231  # $(OPENSSL_PATH)/crypto/camellia/camellia.c
     232  # $(OPENSSL_PATH)/crypto/camellia/cmll_misc.c
     233  # $(OPENSSL_PATH)/crypto/camellia/cmll_ecb.c
     234  # $(OPENSSL_PATH)/crypto/camellia/cmll_cbc.c
     235  # $(OPENSSL_PATH)/crypto/camellia/cmll_ofb.c
     236  # $(OPENSSL_PATH)/crypto/camellia/cmll_cfb.c
     237  # $(OPENSSL_PATH)/crypto/camellia/cmll_ctr.c
     238  # $(OPENSSL_PATH)/crypto/camellia/cmll_utl.c
     239
     240  #
     241  # SEED - Disabled by OPENSSL_NO_SEED
     242  #
     243  # $(OPENSSL_PATH)/crypto/seed/seed.c
     244  # $(OPENSSL_PATH)/crypto/seed/seed_ecb.c
     245  # $(OPENSSL_PATH)/crypto/seed/seed_cbc.c
     246  # $(OPENSSL_PATH)/crypto/seed/seed_cfb.c
     247  # $(OPENSSL_PATH)/crypto/seed/seed_ofb.c
     248
     249  #
     250  # MODES
     251  #
     252  $(OPENSSL_PATH)/crypto/modes/cbc128.c
     253  $(OPENSSL_PATH)/crypto/modes/ctr128.c
     254  $(OPENSSL_PATH)/crypto/modes/cts128.c
     255  $(OPENSSL_PATH)/crypto/modes/cfb128.c
     256  $(OPENSSL_PATH)/crypto/modes/ofb128.c
     257  $(OPENSSL_PATH)/crypto/modes/gcm128.c
     258  $(OPENSSL_PATH)/crypto/modes/ccm128.c
     259  $(OPENSSL_PATH)/crypto/modes/xts128.c
     260  $(OPENSSL_PATH)/crypto/modes/wrap128.c
     261
     262  #
     263  # BIGNUM
     264  #
    154265  $(OPENSSL_PATH)/crypto/bn/bn_add.c
    155266  $(OPENSSL_PATH)/crypto/bn/bn_div.c
     
    178289  $(OPENSSL_PATH)/crypto/bn/bn_nist.c
    179290  $(OPENSSL_PATH)/crypto/bn/bn_depr.c
     291  $(OPENSSL_PATH)/crypto/bn/bn_const.c
    180292  $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
    181   $(OPENSSL_PATH)/crypto/bn/bn_const.c
    182   $(OPENSSL_PATH)/crypto/bn/bn_opt.c
     293
     294  #
     295  # ELLIPTIC CURVE - Disabled by OPENSSL_NO_EC
     296  #
     297  # $(OPENSSL_PATH)/crypto/ec/ec_lib.c
     298  # $(OPENSSL_PATH)/crypto/ec/ecp_smpl.c
     299  # $(OPENSSL_PATH)/crypto/ec/ecp_mont.c
     300  # $(OPENSSL_PATH)/crypto/ec/ecp_nist.c
     301  # $(OPENSSL_PATH)/crypto/ec/ec_cvt.c
     302  # $(OPENSSL_PATH)/crypto/ec/ec_mult.c
     303  # $(OPENSSL_PATH)/crypto/ec/ec_err.c
     304  # $(OPENSSL_PATH)/crypto/ec/ec_curve.c
     305  # $(OPENSSL_PATH)/crypto/ec/ec_check.c
     306  # $(OPENSSL_PATH)/crypto/ec/ec_print.c
     307  # $(OPENSSL_PATH)/crypto/ec/ec_asn1.c
     308  # $(OPENSSL_PATH)/crypto/ec/ec_key.c
     309  # $(OPENSSL_PATH)/crypto/ec/ec2_smpl.c
     310  # $(OPENSSL_PATH)/crypto/ec/ec2_mult.c
     311  # $(OPENSSL_PATH)/crypto/ec/ec_ameth.c
     312  # $(OPENSSL_PATH)/crypto/ec/ec_pmeth.c
     313  # $(OPENSSL_PATH)/crypto/ec/eck_prn.c
     314  # $(OPENSSL_PATH)/crypto/ec/ecp_nistp224.c
     315  # $(OPENSSL_PATH)/crypto/ec/ecp_nistp256.c
     316  # $(OPENSSL_PATH)/crypto/ec/ecp_nistp521.c
     317  # $(OPENSSL_PATH)/crypto/ec/ecp_nistputil.c
     318  # $(OPENSSL_PATH)/crypto/ec/ecp_oct.c
     319  # $(OPENSSL_PATH)/crypto/ec/ec2_oct.c
     320  # $(OPENSSL_PATH)/crypto/ec/ec_oct.c
     321
     322  #
     323  # RSA
     324  #
    183325  $(OPENSSL_PATH)/crypto/rsa/rsa_eay.c
    184326  $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c
     
    195337  $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c
    196338  $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c
    197   $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c
    198339  $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c
    199340  $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c
    200   $(OPENSSL_PATH)/crypto/rsa/rsa_eng.c
    201   $(OPENSSL_PATH)/crypto/dsa/dsa_gen.c
    202   $(OPENSSL_PATH)/crypto/dsa/dsa_key.c
    203   $(OPENSSL_PATH)/crypto/dsa/dsa_lib.c
    204   $(OPENSSL_PATH)/crypto/dsa/dsa_asn1.c
    205   $(OPENSSL_PATH)/crypto/dsa/dsa_vrf.c
    206   $(OPENSSL_PATH)/crypto/dsa/dsa_sign.c
    207   $(OPENSSL_PATH)/crypto/dsa/dsa_err.c
    208   $(OPENSSL_PATH)/crypto/dsa/dsa_ossl.c
    209   $(OPENSSL_PATH)/crypto/dsa/dsa_depr.c
    210   $(OPENSSL_PATH)/crypto/dsa/dsa_utl.c
     341  $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c
     342  $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c
     343  $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c
     344  $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c
     345
     346  #
     347  # DSA - Disabled by OPENSSL_NO_DSA
     348  #
     349  # $(OPENSSL_PATH)/crypto/dsa/dsa_gen.c
     350  # $(OPENSSL_PATH)/crypto/dsa/dsa_key.c
     351  # $(OPENSSL_PATH)/crypto/dsa/dsa_lib.c
     352  # $(OPENSSL_PATH)/crypto/dsa/dsa_asn1.c
     353  # $(OPENSSL_PATH)/crypto/dsa/dsa_vrf.c
     354  # $(OPENSSL_PATH)/crypto/dsa/dsa_sign.c
     355  # $(OPENSSL_PATH)/crypto/dsa/dsa_err.c
     356  # $(OPENSSL_PATH)/crypto/dsa/dsa_ossl.c
     357  # $(OPENSSL_PATH)/crypto/dsa/dsa_depr.c
     358  # $(OPENSSL_PATH)/crypto/dsa/dsa_ameth.c
     359  # $(OPENSSL_PATH)/crypto/dsa/dsa_pmeth.c
     360  # $(OPENSSL_PATH)/crypto/dsa/dsa_prn.c
     361
     362  #
     363  # ECDSA - Disabled by OPENSSL_NO_ECDSA
     364  #
     365  # $(OPENSSL_PATH)/crypto/ecdsa/ecs_lib.c
     366  # $(OPENSSL_PATH)/crypto/ecdsa/ecs_asn1.c
     367  # $(OPENSSL_PATH)/crypto/ecdsa/ecs_ossl.c
     368  # $(OPENSSL_PATH)/crypto/ecdsa/ecs_sign.c
     369  # $(OPENSSL_PATH)/crypto/ecdsa/ecs_vrf.c
     370  # $(OPENSSL_PATH)/crypto/ecdsa/ecs_err.c
     371
     372  #
     373  # DIFFIE-HELLMAN
     374  #
     375  $(OPENSSL_PATH)/crypto/dh/dh_asn1.c
     376  $(OPENSSL_PATH)/crypto/dh/dh_gen.c
     377  $(OPENSSL_PATH)/crypto/dh/dh_key.c
     378  $(OPENSSL_PATH)/crypto/dh/dh_lib.c
     379  $(OPENSSL_PATH)/crypto/dh/dh_check.c
     380  $(OPENSSL_PATH)/crypto/dh/dh_err.c
     381  $(OPENSSL_PATH)/crypto/dh/dh_depr.c
     382  $(OPENSSL_PATH)/crypto/dh/dh_ameth.c
     383  $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c
     384  $(OPENSSL_PATH)/crypto/dh/dh_prn.c
     385  $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c
     386  # $(OPENSSL_PATH)/crypto/dh/dh_kdf.c
     387
     388  #
     389  # ECDH - Disabled by OPENSSL_NO_ECDH
     390  #
     391  # $(OPENSSL_PATH)/crypto/ecdh/ech_lib.c
     392  # $(OPENSSL_PATH)/crypto/ecdh/ech_ossl.c
     393  # $(OPENSSL_PATH)/crypto/ecdh/ech_key.c
     394  # $(OPENSSL_PATH)/crypto/ecdh/ech_err.c
     395  # $(OPENSSL_PATH)/crypto/ecdh/ech_kdf.c
     396
     397  #
     398  # DSO
     399  #
    211400  $(OPENSSL_PATH)/crypto/dso/dso_dl.c
    212401  $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c
     
    217406  $(OPENSSL_PATH)/crypto/dso/dso_win32.c
    218407  $(OPENSSL_PATH)/crypto/dso/dso_vms.c
    219   $(OPENSSL_PATH)/crypto/dh/dh_asn1.c
    220   $(OPENSSL_PATH)/crypto/dh/dh_gen.c
    221   $(OPENSSL_PATH)/crypto/dh/dh_key.c
    222   $(OPENSSL_PATH)/crypto/dh/dh_lib.c
    223   $(OPENSSL_PATH)/crypto/dh/dh_check.c
    224   $(OPENSSL_PATH)/crypto/dh/dh_err.c
    225   $(OPENSSL_PATH)/crypto/dh/dh_depr.c
    226   $(OPENSSL_PATH)/crypto/ec/ec_lib.c
    227   $(OPENSSL_PATH)/crypto/ec/ecp_smpl.c
    228   $(OPENSSL_PATH)/crypto/ec/ecp_mont.c
    229   $(OPENSSL_PATH)/crypto/ec/ecp_nist.c
    230   $(OPENSSL_PATH)/crypto/ec/ec_cvt.c
    231   $(OPENSSL_PATH)/crypto/ec/ec_mult.c
    232   $(OPENSSL_PATH)/crypto/ec/ec_err.c
    233   $(OPENSSL_PATH)/crypto/ec/ec_curve.c
    234   $(OPENSSL_PATH)/crypto/ec/ec_check.c
    235   $(OPENSSL_PATH)/crypto/ec/ec_print.c
    236   $(OPENSSL_PATH)/crypto/ec/ec_asn1.c
    237   $(OPENSSL_PATH)/crypto/ec/ec_key.c
    238   $(OPENSSL_PATH)/crypto/ec/ec2_smpl.c
    239   $(OPENSSL_PATH)/crypto/ec/ec2_mult.c
    240   $(OPENSSL_PATH)/crypto/ecdh/ech_lib.c
    241   $(OPENSSL_PATH)/crypto/ecdh/ech_ossl.c
    242   $(OPENSSL_PATH)/crypto/ecdh/ech_key.c
    243   $(OPENSSL_PATH)/crypto/ecdh/ech_err.c
    244   $(OPENSSL_PATH)/crypto/ecdsa/ecs_lib.c
    245   $(OPENSSL_PATH)/crypto/ecdsa/ecs_asn1.c
    246   $(OPENSSL_PATH)/crypto/ecdsa/ecs_ossl.c
    247   $(OPENSSL_PATH)/crypto/ecdsa/ecs_sign.c
    248   $(OPENSSL_PATH)/crypto/ecdsa/ecs_vrf.c
    249   $(OPENSSL_PATH)/crypto/ecdsa/ecs_err.c
     408  $(OPENSSL_PATH)/crypto/dso/dso_beos.c
     409
     410  #
     411  # ENGINE - Disabled by OPENSSL_NO_ENGINE
     412  #
     413  # $(OPENSSL_PATH)/crypto/engine/eng_err.c
     414  # $(OPENSSL_PATH)/crypto/engine/eng_lib.c
     415  # $(OPENSSL_PATH)/crypto/engine/eng_list.c
     416  # $(OPENSSL_PATH)/crypto/engine/eng_init.c
     417  # $(OPENSSL_PATH)/crypto/engine/eng_ctrl.c
     418  # $(OPENSSL_PATH)/crypto/engine/eng_table.c
     419  # $(OPENSSL_PATH)/crypto/engine/eng_pkey.c
     420  # $(OPENSSL_PATH)/crypto/engine/eng_fat.c
     421  # $(OPENSSL_PATH)/crypto/engine/eng_all.c
     422  # $(OPENSSL_PATH)/crypto/engine/tb_rsa.c
     423  # $(OPENSSL_PATH)/crypto/engine/tb_dsa.c
     424  # $(OPENSSL_PATH)/crypto/engine/tb_ecdsa.c
     425  # $(OPENSSL_PATH)/crypto/engine/tb_dh.c
     426  # $(OPENSSL_PATH)/crypto/engine/tb_ecdh.c
     427  # $(OPENSSL_PATH)/crypto/engine/tb_rand.c
     428  # $(OPENSSL_PATH)/crypto/engine/tb_store.c
     429  # $(OPENSSL_PATH)/crypto/engine/tb_cipher.c
     430  # $(OPENSSL_PATH)/crypto/engine/tb_digest.c
     431  # $(OPENSSL_PATH)/crypto/engine/tb_pkmeth.c
     432  # $(OPENSSL_PATH)/crypto/engine/tb_asnmth.c
     433  # $(OPENSSL_PATH)/crypto/engine/eng_openssl.c
     434  # $(OPENSSL_PATH)/crypto/engine/eng_cnf.c
     435  # $(OPENSSL_PATH)/crypto/engine/eng_dyn.c
     436  # $(OPENSSL_PATH)/crypto/engine/eng_cryptodev.c
     437  # $(OPENSSL_PATH)/crypto/engine/eng_rdrand.c
     438
     439  #
     440  # BUFFER
     441  #
    250442  $(OPENSSL_PATH)/crypto/buffer/buffer.c
    251443  $(OPENSSL_PATH)/crypto/buffer/buf_str.c
    252444  $(OPENSSL_PATH)/crypto/buffer/buf_err.c
     445
     446  #
     447  # BIO
     448  #
    253449  $(OPENSSL_PATH)/crypto/bio/bio_lib.c
    254450  $(OPENSSL_PATH)/crypto/bio/bio_cb.c
     
    258454  $(OPENSSL_PATH)/crypto/bio/bss_fd.c
    259455  $(OPENSSL_PATH)/crypto/bio/bss_file.c
     456  $(OPENSSL_PATH)/crypto/bio/bss_sock.c
     457  $(OPENSSL_PATH)/crypto/bio/bss_conn.c
    260458  $(OPENSSL_PATH)/crypto/bio/bf_null.c
    261459  $(OPENSSL_PATH)/crypto/bio/bf_buff.c
    262 
    263   #
    264   # Not required for UEFI.
     460  #
     461  # Not Required by UEFI.
    265462  #
    266463  # $(OPENSSL_PATH)/crypto/bio/b_print.c
    267  
    268464  $(OPENSSL_PATH)/crypto/bio/b_dump.c
     465  $(OPENSSL_PATH)/crypto/bio/b_sock.c
     466  $(OPENSSL_PATH)/crypto/bio/bss_acpt.c
    269467  $(OPENSSL_PATH)/crypto/bio/bf_nbio.c
    270468  $(OPENSSL_PATH)/crypto/bio/bss_log.c
    271469  $(OPENSSL_PATH)/crypto/bio/bss_bio.c
    272470  $(OPENSSL_PATH)/crypto/bio/bss_dgram.c
     471
     472  #
     473  # STACK
     474  #
    273475  $(OPENSSL_PATH)/crypto/stack/stack.c
     476
     477  #
     478  # LHASH
     479  #
    274480  $(OPENSSL_PATH)/crypto/lhash/lhash.c
    275481  $(OPENSSL_PATH)/crypto/lhash/lh_stats.c
     482
     483  #
     484  # RAND
     485  #
    276486  $(OPENSSL_PATH)/crypto/rand/md_rand.c
    277487  $(OPENSSL_PATH)/crypto/rand/randfile.c
    278488  $(OPENSSL_PATH)/crypto/rand/rand_lib.c
    279   $(OPENSSL_PATH)/crypto/rand/rand_eng.c
    280489  $(OPENSSL_PATH)/crypto/rand/rand_err.c
    281   $(OPENSSL_PATH)/crypto/rand/rand_egd.c
    282   $(OPENSSL_PATH)/crypto/rand/rand_win.c
     490  # $(OPENSSL_PATH)/crypto/rand/rand_egd.c
     491  # $(OPENSSL_PATH)/crypto/rand/rand_win.c
    283492  $(OPENSSL_PATH)/crypto/rand/rand_unix.c
    284   $(OPENSSL_PATH)/crypto/rand/rand_os2.c
    285   $(OPENSSL_PATH)/crypto/rand/rand_nw.c
     493  # $(OPENSSL_PATH)/crypto/rand/rand_os2.c
     494  # $(OPENSSL_PATH)/crypto/rand/rand_nw.c
     495
     496  #
     497  # ERR
     498  #
    286499  $(OPENSSL_PATH)/crypto/err/err.c
    287   $(OPENSSL_PATH)/crypto/err/err_def.c
    288500  $(OPENSSL_PATH)/crypto/err/err_all.c
    289501  $(OPENSSL_PATH)/crypto/err/err_prn.c
    290   $(OPENSSL_PATH)/crypto/err/err_str.c
    291   $(OPENSSL_PATH)/crypto/err/err_bio.c
    292   $(OPENSSL_PATH)/crypto/objects/o_names.c
    293   $(OPENSSL_PATH)/crypto/objects/obj_dat.c
    294   $(OPENSSL_PATH)/crypto/objects/obj_lib.c
    295   $(OPENSSL_PATH)/crypto/objects/obj_err.c
     502
     503  #
     504  # EVP
     505  #
    296506  $(OPENSSL_PATH)/crypto/evp/encode.c
    297507  $(OPENSSL_PATH)/crypto/evp/digest.c
    298   $(OPENSSL_PATH)/crypto/evp/dig_eng.c
    299508  $(OPENSSL_PATH)/crypto/evp/evp_enc.c
    300509  $(OPENSSL_PATH)/crypto/evp/evp_key.c
     
    305514  $(OPENSSL_PATH)/crypto/evp/e_idea.c
    306515  $(OPENSSL_PATH)/crypto/evp/e_des3.c
     516  $(OPENSSL_PATH)/crypto/evp/e_camellia.c
    307517  $(OPENSSL_PATH)/crypto/evp/e_rc4.c
    308518  $(OPENSSL_PATH)/crypto/evp/e_aes.c
    309519  $(OPENSSL_PATH)/crypto/evp/names.c
     520  $(OPENSSL_PATH)/crypto/evp/e_seed.c
    310521  $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c
    311522  $(OPENSSL_PATH)/crypto/evp/e_rc2.c
    312523  $(OPENSSL_PATH)/crypto/evp/e_cast.c
    313524  $(OPENSSL_PATH)/crypto/evp/e_rc5.c
    314   $(OPENSSL_PATH)/crypto/evp/enc_min.c
    315525  $(OPENSSL_PATH)/crypto/evp/m_null.c
    316526  $(OPENSSL_PATH)/crypto/evp/m_md2.c
     
    319529  $(OPENSSL_PATH)/crypto/evp/m_sha.c
    320530  $(OPENSSL_PATH)/crypto/evp/m_sha1.c
     531  $(OPENSSL_PATH)/crypto/evp/m_wp.c
    321532  $(OPENSSL_PATH)/crypto/evp/m_dss.c
    322533  $(OPENSSL_PATH)/crypto/evp/m_dss1.c
     534  $(OPENSSL_PATH)/crypto/evp/m_mdc2.c
    323535  $(OPENSSL_PATH)/crypto/evp/m_ripemd.c
    324536  $(OPENSSL_PATH)/crypto/evp/m_ecdsa.c
     
    345557  $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c
    346558  $(OPENSSL_PATH)/crypto/evp/e_old.c
     559  $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c
     560  $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c
     561  $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c
     562  $(OPENSSL_PATH)/crypto/evp/m_sigver.c
     563  $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c
     564  $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c
     565  $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c
     566
     567  #
     568  # ASN1
     569  #
    347570  $(OPENSSL_PATH)/crypto/asn1/a_object.c
    348571  $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c
     
    380603  $(OPENSSL_PATH)/crypto/asn1/x_spki.c
    381604  $(OPENSSL_PATH)/crypto/asn1/nsseq.c
     605  $(OPENSSL_PATH)/crypto/asn1/x_nx509.c
    382606  $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c
    383607  $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c
     
    397621  $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c
    398622  $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c
     623  $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c
     624  $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c
    399625  $(OPENSSL_PATH)/crypto/asn1/f_int.c
    400626  $(OPENSSL_PATH)/crypto/asn1/f_string.c
    401627  $(OPENSSL_PATH)/crypto/asn1/n_pkey.c
    402628  $(OPENSSL_PATH)/crypto/asn1/f_enum.c
    403   $(OPENSSL_PATH)/crypto/asn1/a_hdr.c
    404629  $(OPENSSL_PATH)/crypto/asn1/x_pkey.c
    405630  $(OPENSSL_PATH)/crypto/asn1/a_bool.c
    406631  $(OPENSSL_PATH)/crypto/asn1/x_exten.c
     632  $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c
     633  $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c
    407634  $(OPENSSL_PATH)/crypto/asn1/asn_mime.c
    408635  $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c
     
    410637  $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c
    411638  $(OPENSSL_PATH)/crypto/asn1/asn1_err.c
    412   $(OPENSSL_PATH)/crypto/asn1/a_meth.c
    413639  $(OPENSSL_PATH)/crypto/asn1/a_bytes.c
    414640  $(OPENSSL_PATH)/crypto/asn1/a_strnid.c
     
    419645  $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c
    420646  $(OPENSSL_PATH)/crypto/asn1/asn_moid.c
     647
     648  #
     649  # PEM
     650  #
    421651  $(OPENSSL_PATH)/crypto/pem/pem_sign.c
    422652  $(OPENSSL_PATH)/crypto/pem/pem_seal.c
     
    430660  $(OPENSSL_PATH)/crypto/pem/pem_pk8.c
    431661  $(OPENSSL_PATH)/crypto/pem/pem_pkey.c
     662  $(OPENSSL_PATH)/crypto/pem/pvkfmt.c
     663
     664  #
     665  # X509
     666  #
    432667  $(OPENSSL_PATH)/crypto/x509/x509_def.c
    433668  $(OPENSSL_PATH)/crypto/x509/x509_d2.c
     
    451686  $(OPENSSL_PATH)/crypto/x509/x509_txt.c
    452687  $(OPENSSL_PATH)/crypto/x509/x509_trs.c
    453   $(OPENSSL_PATH)/crypto/x509/by_file.c
    454   $(OPENSSL_PATH)/crypto/x509/by_dir.c
     688  #
     689  #  Not Required by UEFI.
     690  #
     691  # $(OPENSSL_PATH)/crypto/x509/by_file.c
     692  # $(OPENSSL_PATH)/crypto/x509/by_dir.c
    455693  $(OPENSSL_PATH)/crypto/x509/x509_vpm.c
     694
     695  #
     696  # X509v3
     697  #
    456698  $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c
    457699  $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c
     
    490732  $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c
    491733  $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c
     734  #
     735  #  Not Required by UEFI.
     736  #
     737  # $(OPENSSL_PATH)/crypto/x509v3/v3_scts.c
     738
     739  #
     740  # CONF
     741  #
    492742  $(OPENSSL_PATH)/crypto/conf/conf_err.c
    493743  $(OPENSSL_PATH)/crypto/conf/conf_lib.c
     
    497747  $(OPENSSL_PATH)/crypto/conf/conf_mall.c
    498748  $(OPENSSL_PATH)/crypto/conf/conf_sap.c
     749
     750  #
     751  # TXT_DB
     752  #
    499753  $(OPENSSL_PATH)/crypto/txt_db/txt_db.c
     754
     755  #
     756  # PKCS7
     757  #
    500758  $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c
    501759  $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c
     
    505763  $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c
    506764  $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c
     765  $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c
     766
     767  #
     768  # PKCS12
     769  #
    507770  $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c
    508771  $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c
     
    520783  $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c
    521784  $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c
     785
     786  #
     787  # COMP
     788  #
    522789  $(OPENSSL_PATH)/crypto/comp/comp_lib.c
    523790  $(OPENSSL_PATH)/crypto/comp/comp_err.c
    524791  $(OPENSSL_PATH)/crypto/comp/c_rle.c
    525792  $(OPENSSL_PATH)/crypto/comp/c_zlib.c
    526   $(OPENSSL_PATH)/crypto/engine/eng_err.c
    527   $(OPENSSL_PATH)/crypto/engine/eng_lib.c
    528   $(OPENSSL_PATH)/crypto/engine/eng_list.c
    529   $(OPENSSL_PATH)/crypto/engine/eng_init.c
    530   $(OPENSSL_PATH)/crypto/engine/eng_ctrl.c
    531   $(OPENSSL_PATH)/crypto/engine/eng_table.c
    532   $(OPENSSL_PATH)/crypto/engine/eng_pkey.c
    533   $(OPENSSL_PATH)/crypto/engine/eng_fat.c
    534   $(OPENSSL_PATH)/crypto/engine/eng_all.c
    535   $(OPENSSL_PATH)/crypto/engine/tb_rsa.c
    536   $(OPENSSL_PATH)/crypto/engine/tb_dsa.c
    537   $(OPENSSL_PATH)/crypto/engine/tb_ecdsa.c
    538   $(OPENSSL_PATH)/crypto/engine/tb_dh.c
    539   $(OPENSSL_PATH)/crypto/engine/tb_ecdh.c
    540   $(OPENSSL_PATH)/crypto/engine/tb_rand.c
    541   $(OPENSSL_PATH)/crypto/engine/tb_store.c
    542   $(OPENSSL_PATH)/crypto/engine/tb_cipher.c
    543   $(OPENSSL_PATH)/crypto/engine/tb_digest.c
    544   $(OPENSSL_PATH)/crypto/engine/eng_openssl.c
    545   $(OPENSSL_PATH)/crypto/engine/eng_cnf.c
    546   $(OPENSSL_PATH)/crypto/engine/eng_dyn.c
    547   $(OPENSSL_PATH)/crypto/engine/eng_cryptodev.c
    548   $(OPENSSL_PATH)/crypto/engine/eng_padlock.c
     793
     794  #
     795  # OCSP - Disabled by OPENSSL_NO_OCSP
     796  #
    549797  $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c
    550798  $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c
     
    556804  $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c
    557805  $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c
    558   $(OPENSSL_PATH)/crypto/ui/ui_err.c
     806
     807  #
     808  # UI
     809  #
    559810  $(OPENSSL_PATH)/crypto/ui/ui_lib.c
    560 
    561   #
    562   # Not required when OPENSSL_NO_STDIO is set, which is is for UEFI.
    563   #
     811  #
     812  #  Not Required by UEFI.
     813  #
     814  # $(OPENSSL_PATH)/crypto/ui/ui_err.c
    564815  # $(OPENSSL_PATH)/crypto/ui/ui_openssl.c
    565 
    566816  $(OPENSSL_PATH)/crypto/ui/ui_util.c
    567817  $(OPENSSL_PATH)/crypto/ui/ui_compat.c
     818
     819  #
     820  # KRB5
     821  #
    568822  $(OPENSSL_PATH)/crypto/krb5/krb5_asn.c
    569   $(OPENSSL_PATH)/crypto/store/str_err.c
    570   $(OPENSSL_PATH)/crypto/store/str_lib.c
    571   $(OPENSSL_PATH)/crypto/store/str_meth.c
    572   $(OPENSSL_PATH)/crypto/store/str_mem.c
     823
     824  #
     825  # CMS - Disabled by OPENSSL_NO_CMS
     826  #
     827  # $(OPENSSL_PATH)/crypto/cms/cms_lib.c
     828  # $(OPENSSL_PATH)/crypto/cms/cms_asn1.c
     829  # $(OPENSSL_PATH)/crypto/cms/cms_att.c
     830  # $(OPENSSL_PATH)/crypto/cms/cms_io.c
     831  # $(OPENSSL_PATH)/crypto/cms/cms_smime.c
     832  # $(OPENSSL_PATH)/crypto/cms/cms_err.c
     833  # $(OPENSSL_PATH)/crypto/cms/cms_sd.c
     834  # $(OPENSSL_PATH)/crypto/cms/cms_dd.c
     835  # $(OPENSSL_PATH)/crypto/cms/cms_cd.c
     836  # $(OPENSSL_PATH)/crypto/cms/cms_env.c
     837  # $(OPENSSL_PATH)/crypto/cms/cms_enc.c
     838  # $(OPENSSL_PATH)/crypto/cms/cms_ess.c
     839  # $(OPENSSL_PATH)/crypto/cms/cms_pwri.c
     840  # $(OPENSSL_PATH)/crypto/cms/cms_kari.c
     841
     842  #
     843  # PQUEUE
     844  #
    573845  $(OPENSSL_PATH)/crypto/pqueue/pqueue.c
     846
     847  #
     848  # TS
     849  #
     850  $(OPENSSL_PATH)/crypto/ts/ts_err.c
     851  $(OPENSSL_PATH)/crypto/ts/ts_req_utils.c
     852  $(OPENSSL_PATH)/crypto/ts/ts_req_print.c
     853  $(OPENSSL_PATH)/crypto/ts/ts_rsp_utils.c
     854  $(OPENSSL_PATH)/crypto/ts/ts_rsp_print.c
     855  $(OPENSSL_PATH)/crypto/ts/ts_rsp_sign.c
     856  $(OPENSSL_PATH)/crypto/ts/ts_rsp_verify.c
     857  $(OPENSSL_PATH)/crypto/ts/ts_verify_ctx.c
     858  $(OPENSSL_PATH)/crypto/ts/ts_lib.c
     859  $(OPENSSL_PATH)/crypto/ts/ts_conf.c
     860  $(OPENSSL_PATH)/crypto/ts/ts_asn1.c
     861
     862  #
     863  # SRP - Disabled by OPENSSL_NO_SRP
     864  #
     865  # $(OPENSSL_PATH)/crypto/srp/srp_lib.c
     866  # $(OPENSSL_PATH)/crypto/srp/srp_vfy.c
     867
     868  #
     869  # CMAS
     870  #
     871  $(OPENSSL_PATH)/crypto/cmac/cmac.c
     872  $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
     873  $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c
    574874
    575875[Packages]
     
    581881
    582882[BuildOptions]
    583    #
    584    # Override MSFT build option to remove /W4 (to silence warning messages when building OpenSSL).
    585    #
    586    MSFT:DEBUG_VS2003_IA32_CC_FLAGS        == /nologo /c /WX /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    587    MSFT:RELEASE_VS2003_IA32_CC_FLAGS      == /nologo /c /WX /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX- -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w  -DTHIRTY_TWO_BIT
    588    MSFT:DEBUG_VS2003xASL_IA32_CC_FLAGS    == /nologo /c /WX /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    589    MSFT:RELEASE_VS2003xASL_IA32_CC_FLAGS  == /nologo /c /WX /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX- -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    590    MSFT:DEBUG_DDK3790_IA32_CC_FLAGS       == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    591    MSFT:RELEASE_DDK3790_IA32_CC_FLAGS     == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    592    MSFT:DEBUG_DDK3790xASL_IA32_CC_FLAGS   == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    593    MSFT:RELEASE_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    594    MSFT:DEBUG_*_IA32_CC_FLAGS             == /nologo /c /WX /GS- /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    595    MSFT:RELEASE_*_IA32_CC_FLAGS           == /nologo /c /WX /GS- /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    596    MSFT:NOOPT_*_IA32_CC_FLAGS             == /nologo /c /WX /GS- /Gs32768 /D UNICODE /Od /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    597    MSFT:DEBUG_*_X64_CC_FLAGS              == /nologo /c /WX /GS- /X /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    598    MSFT:RELEASE_*_X64_CC_FLAGS            == /nologo /c /WX /GS- /X /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    599    MSFT:NOOPT_*_X64_CC_FLAGS              == /nologo /c /WX /GS- /X /Gs32768 /D UNICODE /Od /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    600    MSFT:DEBUG_*_IPF_CC_FLAGS              == /nologo /c /WX /GS- /X /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    601    MSFT:RELEASE_*_IPF_CC_FLAGS            == /nologo /c /WX /GS- /X /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    602    MSFT:NOOPT_*_IPF_CC_FLAGS              == /nologo /c /WX /GS- /X /EHs-c- /GR- /Gy /Od /FIAutoGen.h /QIPF_fr32 /Zi -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    603    INTEL:*_*_IA32_CC_FLAGS                = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
    604    INTEL:*_*_X64_CC_FLAGS                 = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    605    INTEL:*_*_IPF_CC_FLAGS                 = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    606    GCC:*_*_IA32_CC_FLAGS                  = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
    607    GCC:*_*_X64_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
    608    GCC:*_*_IPF_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
    609    RVCT:*_*_IA32_CC_FLAGS                 = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) --library_interface=aeabi_clib99 --fpu=vfpv3 -DTHIRTY_TWO_BIT
    610    RVCT:*_*_X64_CC_FLAGS                  = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) --library_interface=aeabi_clib99 --fpu=vfpv3 -DSIXTY_FOUR_BIT
    611    RVCT:*_*_IPF_CC_FLAGS                  = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) --library_interface=aeabi_clib99 --fpu=vfpv3 -DSIXTY_FOUR_BIT
     883  #
     884  # Disables the following Visual Studio compiler warnings brought by openssl source, so we do not break the build with /WX option:
     885  # C4244: conversion from type1 to type2, possible loss of data
     886  # C4702: unreachable code
     887  # C4706: assignment within conditional expression
     888  # C4133: incompatible types - from type1 to type2
     889  # C4245: conversion from type1 to type2, signed/unsigned mismatch
     890  # C4267: conversion from size_t to type, possible loss of data
     891  # C4305: truncation from type1 to type2 of smaller size
     892  # C4306: conversion from type1 to type2 of greater size
     893  # C4702: Potentially uninitialized local variable name used
     894  #
     895  MSFT:*_*_IA32_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -DTHIRTY_TWO_BIT /wd4244 /wd4701 /wd4702 /wd4706
     896  MSFT:*_*_X64_CC_FLAGS     = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -DSIXTY_FOUR_BIT /wd4133 /wd4244 /wd4245 /wd4267 /wd4701 /wd4305 /wd4306 /wd4702 /wd4706
     897  MSFT:*_*_IPF_CC_FLAGS     = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -DSIXTY_FOUR_BIT /wd4133 /wd4244 /wd4245 /wd4267 /wd4701 /wd4305 /wd4306 /wd4702 /wd4706
     898
     899  INTEL:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DTHIRTY_TWO_BIT
     900  INTEL:*_*_X64_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
     901  INTEL:*_*_IPF_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
     902
     903  GCC:*_*_IA32_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
     904  GCC:*_*_X64_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
     905  GCC:*_*_IPF_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
     906  GCC:*_*_ARM_CC_FLAGS      = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
     907  GCC:*_*_AARCH64_CC_FLAGS  = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
     908
     909  # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
     910  # 1295: Deprecated declaration <entity> - give arg types
     911  #  550: <entity> was set but never used
     912  # 1293: assignment in condition
     913  #  111: statement is unreachable (invariably "break;" after "return X;" in case statement)
     914  #   68: integer conversion resulted in a change of sign ("if (Status == -1)")
     915  #  177: <entity> was declared but never referenced
     916  #  223: function <entity> declared implicitly
     917  #  144: a value of type <type> cannot be used to initialize an entity of type <type>
     918  #  513: a value of type <type> cannot be assigned to an entity of type <type>
     919  #  188: enumerated type mixed with another type (i.e. passing an integer as an enum without a cast)
     920  # 1296: Extended constant initialiser used
     921  RVCT:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) --library_interface=aeabi_clib99 --fpu=vfpv3 -DTHIRTY_TWO_BIT --diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188
     922  XCODE:*_*_IA32_CC_FLAGS   = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
     923  XCODE:*_*_X64_CC_FLAGS    = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
  • trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/OpensslLib/Patch-HOWTO.txt

    r48674 r58459  
    55  OpenSSL is a well-known open source implementation of SSL and TLS protocols.
    66The core library implements the basic cryptographic functions and provides various
    7 utility functions. The OpenSSL library is widely used in variety of security 
    8 products development as base crypto provider. (See http://www.openssl.org for more 
     7utility functions. The OpenSSL library is widely used in variety of security
     8products development as base crypto provider. (See http://www.openssl.org for more
    99information for OpenSSL).
    10   UEFI (Unified Extensible Firmware Interface) is a specification detailing the 
    11 interfaces between OS and platform firmware. Several security features were 
    12 introduced (e.g. Authenticated Variable Service, Driver Signing, etc) from UEFI 
    13 2.2 (http://www.uefi.org). These security features highly depends on the 
     10  UEFI (Unified Extensible Firmware Interface) is a specification detailing the
     11interfaces between OS and platform firmware. Several security features were
     12introduced (e.g. Authenticated Variable Service, Driver Signing, etc) from UEFI
     132.2 (http://www.uefi.org). These security features highly depends on the
    1414cryptography. This patch will enable openssl building under UEFI environment.
    1515
     
    1818                                OpenSSL-Version
    1919================================================================================
    20   Current supported OpenSSL version for UEFI Crypto Library is 0.9.8w.
    21     http://www.openssl.org/source/openssl-0.9.8w.tar.gz
     20  Current supported OpenSSL version for UEFI Crypto Library is 1.0.2d.
     21    http://www.openssl.org/source/openssl-1.0.2d.tar.gz
    2222
    2323
     
    2525                      HOW to Install Openssl for UEFI Building
    2626================================================================================
    27 1.  Download OpenSSL 0.9.8w from official website:
    28         http://www.openssl.org/source/openssl-0.9.8w.tar.gz
     271.  Download OpenSSL 1.0.2d from official website:
     28    http://www.openssl.org/source/openssl-1.0.2d.tar.gz
    2929
    30     NOTE: Some web browsers may rename the downloaded TAR file to openssl-0.9.8w.tar.tar.
    31           When you do the download, rename the "openssl-0.9.8w.tar.tar" to
    32           "openssl-0.9.8w.tar.gz" or rename the local downloaded file with ".tar.tar"
     30    NOTE: Some web browsers may rename the downloaded TAR file to openssl-1.0.2d.tar.tar.
     31          When you do the download, rename the "openssl-1.0.2d.tar.tar" to
     32          "openssl-1.0.2d.tar.gz" or rename the local downloaded file with ".tar.tar"
    3333          extension to ".tar.gz".
    3434
    35 2.  Extract TAR into CryptoPkg/Library/OpenSslLib/openssl-0.9.8w
     352.  Extract TAR into CryptoPkg/Library/OpenSslLib/openssl-1.0.2d
    3636
    37     NOTE: If you use WinZip to unpack the openssl source in Windows, please 
    38           uncheck the WinZip smart CR/LF conversion option (WINZIP: Options --> 
     37    NOTE: If you use WinZip to unpack the openssl source in Windows, please
     38          uncheck the WinZip smart CR/LF conversion option (WINZIP: Options -->
    3939          Configuration --> Miscellaneous --> "TAR file smart CR/LF conversion").
    40  
    41 3.  Apply this patch: EDKII_openssl-0.9.8w.patch, and make installation
     40
     413.  Apply this patch: EDKII_openssl-1.0.2d.patch, and make installation
    4242
    4343    For Windows Environment:
    4444    ------------------------
    4545    1) Make sure the patch utility has been installed in your machine.
    46        Install Cygwin or get the patch utility binary from 
     46       Install Cygwin or get the patch utility binary from
    4747          http://gnuwin32.sourceforge.net/packages/patch.htm
    48     2) cd $(WORKSPACE)\CryptoPkg\Library\OpensslLib\openssl-0.9.8w
    49     3) patch -p0 -i ..\EDKII_openssl-0.9.8w.patch
     48    2) cd $(WORKSPACE)\CryptoPkg\Library\OpensslLib\openssl-1.0.2d
     49    3) patch -p0 -i ..\EDKII_openssl-1.0.2d.patch
    5050    4) cd ..
    5151    5) Install.cmd
     
    5555    1) Make sure the patch utility has been installed in your machine.
    5656       Patch utility is available from http://directory.fsf.org/project/patch/
    57     2) cd $(WORKSPACE)/CryptoPkg/Library/OpensslLib/openssl-0.9.8w
    58     3) patch -p0 -i ../EDKII_openssl-0.9.8w.patch
     57    2) cd $(WORKSPACE)/CryptoPkg/Library/OpensslLib/openssl-1.0.2d
     58    3) patch -p0 -i ../EDKII_openssl-1.0.2d.patch
    5959    4) cd ..
    6060    5) ./Install.sh
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