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
33 edited

Legend:

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

  • 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