diff --git a/CryptoPkg/CryptRuntimeDxe/CryptRuntime.c b/CryptoPkg/CryptRuntimeDxe/CryptRuntime.c deleted file mode 100644 index 47a92fec65..0000000000 --- a/CryptoPkg/CryptRuntimeDxe/CryptRuntime.c +++ /dev/null @@ -1,248 +0,0 @@ -/** @file - Runtime Cryptographic Driver Implementation, which produce one crypto - protocol. - -Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "CryptRuntime.h" - -// -// The handle onto which the Runtime Crypt Protocol instance is installed -// -EFI_HANDLE mRuntimeCryptHandle = NULL; - -// -// The Runtime Crypt Protocol instance produced by this driver -// -EFI_RUNTIME_CRYPT_PROTOCOL mRuntimeCryptProtocol = { - RuntimeCryptSha256GetContextSize, - RuntimeCryptSha256Init, - RuntimeCryptSha256Update, - RuntimeCryptSha256Final, - RuntimeCryptRsaNew, - RuntimeCryptRsaFree, - RuntimeCryptRsaSetKey, - RuntimeCryptRsaPkcs1Verify -}; - -/** - Retrieves the size, in bytes, of the context buffer required for SHA-256 operations. - - @return The size, in bytes, of the context buffer required for SHA-256 operations. - -**/ -UINTN -EFIAPI -RuntimeCryptSha256GetContextSize ( - VOID - ) -{ - return Sha256GetContextSize (); -} - -/** - Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for - subsequent use. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 Context being initialized. - - @retval TRUE SHA-256 context initialization succeeded. - @retval FALSE SHA-256 context initialization failed. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptSha256Init ( - IN OUT VOID *Sha256Context - ) -{ - return Sha256Init (Sha256Context); -} - -/** - Performs SHA-256 digest on a data buffer of the specified length. This function can - be called multiple times to compute the digest of long or discontinuous data streams. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to the SHA-256 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataLength Length of Data buffer in bytes. - - @retval TRUE SHA-256 data digest succeeded. - @retval FALSE Invalid SHA-256 context. After Sha256Final function has been called, the - SHA-256 context cannot be reused. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptSha256Update ( - IN OUT VOID *Sha256Context, - IN CONST VOID *Data, - IN UINTN DataLength - ) -{ - return Sha256Update (Sha256Context, Data, DataLength); -} - -/** - Completes SHA-256 hash computation and retrieves the digest value into the specified - memory. After this function has been called, the SHA-256 context cannot be used again. - - If Sha256Context is NULL, then return FALSE. - If HashValue is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 context - @param[out] HashValue Pointer to a buffer that receives the SHA-256 digest - value (32 bytes). - - @retval TRUE SHA-256 digest computation succeeded. - @retval FALSE SHA-256 digest computation failed. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptSha256Final ( - IN OUT VOID *Sha256Context, - OUT UINT8 *HashValue - ) -{ - return Sha256Final (Sha256Context, HashValue); -} - -/** - Allocates and Initializes one RSA Context for subsequent use. - - @return Pointer to the RSA Context that has been initialized. - If the allocations fails, RsaNew() returns NULL. - -**/ -VOID * -EFIAPI -RuntimeCryptRsaNew ( - VOID - ) -{ - return RsaNew (); -} - -/** - Release the specified RSA Context. - - @param[in] RsaContext Pointer to the RSA context to be released. - -**/ -VOID -EFIAPI -RuntimeCryptRsaFree ( - IN VOID *RsaContext - ) -{ - RsaFree (RsaContext); -} - -/** - Sets the tag-designated RSA key component into the established RSA context from - the user-specified nonnegative integer (octet string format represented in RSA - PKCS#1). - - If RsaContext is NULL, then return FALSE. - - @param[in, out] RsaContext Pointer to RSA context being set. - @param[in] KeyTag Tag of RSA key component being set. - @param[in] BigNumber Pointer to octet integer buffer. - @param[in] BnLength Length of big number buffer in bytes. - - @return TRUE RSA key component was set successfully. - @return FALSE Invalid RSA key component tag. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptRsaSetKey ( - IN OUT VOID *RsaContext, - IN RSA_KEY_TAG KeyTag, - IN CONST UINT8 *BigNumber, - IN UINTN BnLength - ) -{ - return RsaSetKey (RsaContext, KeyTag, BigNumber, BnLength); -} - -/** - Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in - RSA PKCS#1. - - If RsaContext is NULL, then return FALSE. - If MessageHash is NULL, then return FALSE. - If Signature is NULL, then return FALSE. - If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, return FALSE. - - @param[in] RsaContext Pointer to RSA context for signature verification. - @param[in] MessageHash Pointer to octet message hash to be checked. - @param[in] HashLength Length of the message hash in bytes. - @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified. - @param[in] SigLength Length of signature in bytes. - - @return TRUE Valid signature encoded in PKCS1-v1_5. - @return FALSE Invalid signature or invalid RSA context. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptRsaPkcs1Verify ( - IN VOID *RsaContext, - IN CONST UINT8 *MessageHash, - IN UINTN HashLength, - IN CONST UINT8 *Signature, - IN UINTN SigLength - ) -{ - return RsaPkcs1Verify (RsaContext, MessageHash, HashLength, Signature, SigLength); -} - -/** - Entry Point for Runtime Cryptographic Driver. - - This function installs Runtime Crypt Protocol. - - @param ImageHandle Image handle of this driver. - @param SystemTable a Pointer to the EFI System Table. - - @retval EFI_SUCEESS Runtime Crypt Protocol is successfully installed - @return Others Some error occurs when installing Runtime Crypt Protocol. - -**/ -EFI_STATUS -EFIAPI -CryptRuntimeDriverInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Install the Runtime Crypt Protocol onto a new handle - // - Status = gBS->InstallMultipleProtocolInterfaces ( - &mRuntimeCryptHandle, - &gEfiRuntimeCryptProtocolGuid, - &mRuntimeCryptProtocol, - NULL - ); - ASSERT_EFI_ERROR (Status); - - return Status; -} diff --git a/CryptoPkg/CryptRuntimeDxe/CryptRuntime.h b/CryptoPkg/CryptRuntimeDxe/CryptRuntime.h deleted file mode 100644 index a7d21fd3ff..0000000000 --- a/CryptoPkg/CryptRuntimeDxe/CryptRuntime.h +++ /dev/null @@ -1,186 +0,0 @@ -/** @file - Header file of Runtime Cryptographic Driver. - -Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef _CRYPT_RUNTIME_H_ -#define _CRYPT_RUNTIME_H_ - -#include - -#include - -#include -#include -#include -#include - -/** - Retrieves the size, in bytes, of the context buffer required for SHA-256 operations. - - @return The size, in bytes, of the context buffer required for SHA-256 operations. - -**/ -UINTN -EFIAPI -RuntimeCryptSha256GetContextSize ( - VOID - ); - - -/** - Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for - subsequent use. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 Context being initialized. - - @retval TRUE SHA-256 context initialization succeeded. - @retval FALSE SHA-256 context initialization failed. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptSha256Init ( - IN OUT VOID *Sha256Context - ); - - -/** - Performs SHA-256 digest on a data buffer of the specified length. This function can - be called multiple times to compute the digest of long or discontinuous data streams. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to the SHA-256 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataLength Length of Data buffer in bytes. - - @retval TRUE SHA-256 data digest succeeded. - @retval FALSE Invalid SHA-256 context. After Sha256Final function has been called, the - SHA-256 context cannot be reused. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptSha256Update ( - IN OUT VOID *Sha256Context, - IN CONST VOID *Data, - IN UINTN DataLength - ); - - -/** - Completes SHA-256 hash computation and retrieves the digest value into the specified - memory. After this function has been called, the SHA-256 context cannot be used again. - - If Sha256Context is NULL, then return FALSE. - If HashValue is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 context - @param[out] HashValue Pointer to a buffer that receives the SHA-256 digest - value (32 bytes). - - @retval TRUE SHA-256 digest computation succeeded. - @retval FALSE SHA-256 digest computation failed. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptSha256Final ( - IN OUT VOID *Sha256Context, - OUT UINT8 *HashValue - ); - -/** - Allocates and Initializes one RSA Context for subsequent use. - - @return Pointer to the RSA Context that has been initialized. - If the allocations fails, RsaNew() returns NULL. - -**/ -VOID * -EFIAPI -RuntimeCryptRsaNew ( - VOID - ); - - -/** - Release the specified RSA Context. - - @param[in] RsaContext Pointer to the RSA context to be released. - -**/ -VOID -EFIAPI -RuntimeCryptRsaFree ( - IN VOID *RsaContext - ); - -/** - Sets the tag-designated RSA key component into the established RSA context from - the user-specified nonnegative integer (octet string format represented in RSA - PKCS#1). - - If RsaContext is NULL, then return FALSE. - - @param[in, out] RsaContext Pointer to RSA context being set. - @param[in] KeyTag Tag of RSA key component being set. - @param[in] BigNumber Pointer to octet integer buffer. - @param[in] BnLength Length of big number buffer in bytes. - - @return TRUE RSA key component was set successfully. - @return FALSE Invalid RSA key component tag. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptRsaSetKey ( - IN OUT VOID *RsaContext, - IN RSA_KEY_TAG KeyTag, - IN CONST UINT8 *BigNumber, - IN UINTN BnLength - ); - - -/** - Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in - RSA PKCS#1. - - If RsaContext is NULL, then return FALSE. - If MessageHash is NULL, then return FALSE. - If Signature is NULL, then return FALSE. - If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, return FALSE. - - @param[in] RsaContext Pointer to RSA context for signature verification. - @param[in] MessageHash Pointer to octet message hash to be checked. - @param[in] HashLength Length of the message hash in bytes. - @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified. - @param[in] SigLength Length of signature in bytes. - - @return TRUE Valid signature encoded in PKCS1-v1_5. - @return FALSE Invalid signature or invalid RSA context. - -**/ -BOOLEAN -EFIAPI -RuntimeCryptRsaPkcs1Verify ( - IN VOID *RsaContext, - IN CONST UINT8 *MessageHash, - IN UINTN HashLength, - IN CONST UINT8 *Signature, - IN UINTN SigLength - ); - -#endif diff --git a/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.inf b/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.inf deleted file mode 100644 index 967f3a7564..0000000000 --- a/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.inf +++ /dev/null @@ -1,54 +0,0 @@ -## @file -# This driver installs runtime Crypt protocol to provide SHA256 and RSA service. -# -# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -## - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = CryptRuntimeDxe - MODULE_UNI_FILE = CryptRuntimeDxe.uni - FILE_GUID = 858031F3-96A2-406E-ABCC-ED264A3A31D6 - MODULE_TYPE = DXE_RUNTIME_DRIVER - VERSION_STRING = 1.0 - - ENTRY_POINT = CryptRuntimeDriverInitialize - -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 IPF -# - -[Sources] - CryptRuntime.h - CryptRuntime.c - -[Packages] - MdePkg/MdePkg.dec - CryptoPkg/CryptoPkg.dec - -[LibraryClasses] - UefiDriverEntryPoint - UefiBootServicesTableLib - DebugLib - UefiRuntimeLib - BaseCryptLib - -[Protocols] - gEfiRuntimeCryptProtocolGuid ## PRODUCES - -[Depex] - TRUE - -[UserExtensions.TianoCore."ExtraFiles"] - CryptRuntimeDxeExtra.uni - diff --git a/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.uni b/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.uni deleted file mode 100644 index b7ca7846a3..0000000000 --- a/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.uni +++ /dev/null @@ -1,22 +0,0 @@ -// /** @file -// This driver installs runtime Crypt protocol to provide SHA256 and RSA service. -// -// This driver installs runtime Crypt protocol to provide SHA256 and RSA service. -// -// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Installs runtime Crypt protocol to provide SHA256 and RSA service" - -#string STR_MODULE_DESCRIPTION #language en-US "This driver installs runtime Crypt protocol to provide SHA256 and RSA service." - diff --git a/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxeExtra.uni b/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxeExtra.uni deleted file mode 100644 index 1a042e0546..0000000000 --- a/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxeExtra.uni +++ /dev/null @@ -1,20 +0,0 @@ -// /** @file -// CryptRuntimeDxe Localized Strings and Content -// -// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -// **/ - -#string STR_PROPERTIES_MODULE_NAME -#language en-US -"CryptRuntimeDxe module" - - diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec index 7593ee3c69..00148835f4 100644 --- a/CryptoPkg/CryptoPkg.dec +++ b/CryptoPkg/CryptoPkg.dec @@ -39,9 +39,5 @@ ## TlsLib|Include/Library/TlsLib.h -[Protocols] - ## Include/Protocol/RuntimeCrypt.h - gEfiRuntimeCryptProtocolGuid = { 0xe1475e0c, 0x1746, 0x4802, {0x86, 0x2e, 0x1, 0x1c, 0x2c, 0x2d, 0x9d, 0x86 }} - [UserExtensions.TianoCore."ExtraFiles"] CryptoPkgExtra.uni diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc index b5afdba4b9..a0334d628b 100644 --- a/CryptoPkg/CryptoPkg.dsc +++ b/CryptoPkg/CryptoPkg.dsc @@ -23,7 +23,7 @@ PLATFORM_VERSION = 0.98 DSC_SPECIFICATION = 0x00010005 OUTPUT_DIRECTORY = Build/CryptoPkg - SUPPORTED_ARCHITECTURES = IA32|X64|IPF|ARM|AARCH64 + SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64 BUILD_TARGETS = DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT @@ -78,9 +78,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf -[LibraryClasses.common.DXE_SAL_DRIVER] - BaseCryptLib|CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf - [LibraryClasses.common.UEFI_DRIVER] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf @@ -125,13 +122,8 @@ CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf CryptoPkg/Library/TlsLib/TlsLib.inf - CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.inf - [Components.IA32, Components.X64] CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf -[Components.IPF] - CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf - [BuildOptions] *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/CryptoPkg/Include/Protocol/RuntimeCrypt.h b/CryptoPkg/Include/Protocol/RuntimeCrypt.h deleted file mode 100644 index 35fd43cd75..0000000000 --- a/CryptoPkg/Include/Protocol/RuntimeCrypt.h +++ /dev/null @@ -1,204 +0,0 @@ -/** @file - The runtime cryptographic protocol. - Only limited crypto primitives (SHA-256 and RSA) are provided for runtime - authenticated variable service. - -Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __EFI_RUNTIME_CRYPT_PROTOCOL_H__ -#define __EFI_RUNTIME_CRYPT_PROTOCOL_H__ - -#include - -/// -/// Runtime Cryptographic Protocol GUID. -/// -#define EFI_RUNTIME_CRYPT_PROTOCOL_GUID \ - { \ - 0xe1475e0c, 0x1746, 0x4802, { 0x86, 0x2e, 0x1, 0x1c, 0x2c, 0x2d, 0x9d, 0x86 } \ - } - -/** - Retrieves the size, in bytes, of the context buffer required for SHA-256 operations. - - @return The size, in bytes, of the context buffer required for SHA-256 operations. - -**/ -typedef -UINTN -(EFIAPI *EFI_RUNTIME_CRYPT_SHA256_GET_CONTEXT_SIZE) ( - VOID - ); - - -/** - Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for - subsequent use. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 Context being initialized. - - @retval TRUE SHA-256 context initialization succeeded. - @retval FALSE SHA-256 context initialization failed. - -**/ -typedef -BOOLEAN -(EFIAPI *EFI_RUNTIME_CRYPT_SHA256_INIT) ( - IN OUT VOID *Sha256Context - ); - - -/** - Performs SHA-256 digest on a data buffer of the specified length. This function can - be called multiple times to compute the digest of long or discontinuous data streams. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to the SHA-256 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataLength Length of Data buffer in bytes. - - @retval TRUE SHA-256 data digest succeeded. - @retval FALSE Invalid SHA-256 context. After Sha256Final function has been called, the - SHA-256 context cannot be reused. - -**/ -typedef -BOOLEAN -(EFIAPI *EFI_RUNTIME_CRYPT_SHA256_UPDATE) ( - IN OUT VOID *Sha256Context, - IN CONST VOID *Data, - IN UINTN DataLength - ); - - -/** - Completes SHA-256 hash computation and retrieves the digest value into the specified - memory. After this function has been called, the SHA-256 context cannot be used again. - - If Sha256Context is NULL, then return FALSE. - If HashValue is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 context - @param[out] HashValue Pointer to a buffer that receives the SHA-256 digest - value (32 bytes). - - @retval TRUE SHA-256 digest computation succeeded. - @retval FALSE SHA-256 digest computation failed. - -**/ -typedef -BOOLEAN -(EFIAPI *EFI_RUNTIME_CRYPT_SHA256_FINAL) ( - IN OUT VOID *Sha256Context, - OUT UINT8 *HashValue - ); - - -/** - Allocates and Initializes one RSA Context for subsequent use. - - @return Pointer to the RSA Context that has been initialized. - If the allocations fails, RsaNew() returns NULL. - -**/ -typedef -VOID * -(EFIAPI *EFI_RUNTIME_CRYPT_RSA_NEW) ( - VOID - ); - -/** - Release the specified RSA Context. - - @param[in] RsaContext Pointer to the RSA context to be released. - -**/ -typedef -VOID -(EFIAPI *EFI_RUNTIME_CRYPT_RSA_FREE) ( - IN VOID *RsaContext - ); - -/** - Sets the tag-designated RSA key component into the established RSA context from - the user-specified nonnegative integer (octet string format represented in RSA - PKCS#1). - - If RsaContext is NULL, then return FALSE. - - @param[in, out] RsaContext Pointer to RSA context being set. - @param[in] KeyTag Tag of RSA key component being set. - @param[in] BigNumber Pointer to octet integer buffer. - @param[in] BnLength Length of big number buffer in bytes. - - @return TRUE RSA key component was set successfully. - @return FALSE Invalid RSA key component tag. - -**/ -typedef -BOOLEAN -(EFIAPI *EFI_RUNTIME_CRYPT_RSA_SET_KEY) ( - IN OUT VOID *RsaContext, - IN RSA_KEY_TAG KeyTag, - IN CONST UINT8 *BigNumber, - IN UINTN BnLength - ); - -/** - Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in - RSA PKCS#1. - - If RsaContext is NULL, then return FALSE. - If MessageHash is NULL, then return FALSE. - If Signature is NULL, then return FALSE. - If HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE. - - @param[in] RsaContext Pointer to RSA context for signature verification. - @param[in] MessageHash Pointer to octet message hash to be checked. - @param[in] HashLength Length of the message hash in bytes. - @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified. - @param[in] SigLength Length of signature in bytes. - - @return TRUE Valid signature encoded in PKCS1-v1_5. - @return FALSE Invalid signature or invalid RSA context. - -**/ -typedef -BOOLEAN -(EFIAPI *EFI_RUNTIME_CRYPT_RSA_PKCS1_VERIFY) ( - IN VOID *RsaContext, - IN CONST UINT8 *MessageHash, - IN UINTN HashLength, - IN CONST UINT8 *Signature, - IN UINTN SigLength - ); - -/// -/// Runtime Cryptographic Protocol Structure. -/// -typedef struct { - EFI_RUNTIME_CRYPT_SHA256_GET_CONTEXT_SIZE Sha256GetContextSize; - EFI_RUNTIME_CRYPT_SHA256_INIT Sha256Init; - EFI_RUNTIME_CRYPT_SHA256_UPDATE Sha256Update; - EFI_RUNTIME_CRYPT_SHA256_FINAL Sha256Final; - EFI_RUNTIME_CRYPT_RSA_NEW RsaNew; - EFI_RUNTIME_CRYPT_RSA_FREE RsaFree; - EFI_RUNTIME_CRYPT_RSA_SET_KEY RsaSetKey; - EFI_RUNTIME_CRYPT_RSA_PKCS1_VERIFY RsaPkcs1Verify; -} EFI_RUNTIME_CRYPT_PROTOCOL; - -extern EFI_GUID gEfiRuntimeCryptProtocolGuid; - -#endif diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf index bb91f899ff..f29445ce34 100644 --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf @@ -6,7 +6,7 @@ # This external input must be validated carefully to avoid security issues such as # buffer overflow or integer overflow. # -# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -29,7 +29,7 @@ # # The following information is for reference only and not required by the build tools. # -# VALID_ARCHITECTURES = IA32 X64 IPF ARM AARCH64 +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 # [Sources] @@ -66,9 +66,6 @@ [Sources.X64] Rand/CryptRandTsc.c -[Sources.IPF] - Rand/CryptRandItc.c - [Sources.ARM] Rand/CryptRand.c diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf index 44a97fd114..32628c8835 100644 --- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf @@ -35,7 +35,7 @@ # # The following information is for reference only and not required by the build tools. # -# VALID_ARCHITECTURES = IA32 X64 IPF ARM AARCH64 +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 # [Sources] @@ -71,9 +71,6 @@ [Sources.X64] Rand/CryptRandTsc.c -[Sources.IPF] - Rand/CryptRandItc.c - [Sources.ARM] Rand/CryptRand.c diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf index 38328cc5aa..4829669c1f 100644 --- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf @@ -71,9 +71,6 @@ [Sources.X64] Rand/CryptRandTsc.c -[Sources.IPF] - Rand/CryptRandItc.c - [Sources.ARM] Rand/CryptRand.c diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf deleted file mode 100644 index bf2d87925c..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf +++ /dev/null @@ -1,76 +0,0 @@ -## @file -# Cryptographic Library Instance based on Runtime Crypt Protocol. -# This instance will be only used by the Authenticated Variable driver for IPF. -# -# Note: MD4/MD5/SHA1 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, -# AES/TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign/verify -# functions, Diffie-Hellman functions, X.509 certificate handler functions, -# authenticode signature verification functions, PEM handler functions, -# pseudorandom number generator functions, and Sha256Duplicate() are not supported -# in this instance. -# -# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -## - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = BaseCryptLibRuntimeCryptProtocol - MODULE_UNI_FILE = BaseCryptLibRuntimeCryptProtocol.uni - FILE_GUID = BBB31581-855A-44D7-A550-8A585D9B2DE9 - MODULE_TYPE = DXE_RUNTIME_DRIVER - VERSION_STRING = 1.0 - LIBRARY_CLASS = BaseCryptLib|DXE_RUNTIME_DRIVER DXE_SAL_DRIVER - CONSTRUCTOR = RuntimeDxeIpfCryptLibConstructor - DESTRUCTOR = RuntimeDxeIpfCryptLibDestructor -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IPF -# - -[Sources] - RuntimeDxeIpfCryptLib.c - InternalCryptLib.h - Hash/CryptMd4Null.c - Hash/CryptMd5Null.c - Hash/CryptSha1Null.c - Hmac/CryptHmacMd5Null.c - Hmac/CryptHmacSha1Null.c - Cipher/CryptAesNull.c - Cipher/CryptTdesNull.c - Cipher/CryptArc4Null.c - Pk/CryptRsaExtNull.c - Pk/CryptPkcs7SignNull.c - Pk/CryptPkcs7VerifyNull.c - Pk/CryptDhNull.c - Pk/CryptX509Null.c - Pk/CryptAuthenticodeNull.c - Pem/CryptPemNull.c - Rand/CryptRandNull.c - -[Packages] - MdePkg/MdePkg.dec - CryptoPkg/CryptoPkg.dec - -[LibraryClasses] - BaseLib - DebugLib - UefiBootServicesTableLib - UefiRuntimeLib - -[Guids] - gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event - -[Protocols] - gEfiRuntimeCryptProtocolGuid ## CONSUMES - -[Depex] - gEfiRuntimeCryptProtocolGuid diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.uni b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.uni deleted file mode 100644 index 1f39c2efdf..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.uni +++ /dev/null @@ -1,29 +0,0 @@ -// /** @file -// Cryptographic Library Instance based on Runtime Crypt Protocol. -// -// This instance will be only used by the Authenticated Variable driver for IPF. -// -// Note: MD4/MD5/SHA1 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, -// AES/TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign/verify -// functions, Diffie-Hellman functions, X.509 certificate handler functions, -// authenticode signature verification functions, PEM handler functions, -// pseudorandom number generator functions, and Sha256Duplicate() are not supported -// in this instance. -// -// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance based on Runtime Crypt Protocol" - -#string STR_MODULE_DESCRIPTION #language en-US "This instance will be only used by the Authenticated Variable driver for IPF. Note: MD4/MD5/SHA1 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign/verify functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, pseudorandom number generator functions, and Sha256Duplicate() are not supported in this instance." - diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptAesNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptAesNull.c deleted file mode 100644 index 6e3acf5e78..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptAesNull.c +++ /dev/null @@ -1,165 +0,0 @@ -/** @file - AES Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieves the size, in bytes, of the context buffer required for AES operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -AesGetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory as AES context for subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] AesContext Pointer to AES context being initialized. - @param[in] Key Pointer to the user-supplied AES key. - @param[in] KeyLength Length of AES key in bits. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -AesInit ( - OUT VOID *AesContext, - IN CONST UINT8 *Key, - IN UINTN KeyLength - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs AES encryption on a data buffer of the specified size in ECB mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] AesContext Pointer to the AES context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[out] Output Pointer to a buffer that receives the AES encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -AesEcbEncrypt ( - IN VOID *AesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs AES decryption on a data buffer of the specified size in ECB mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] AesContext Pointer to the AES context. - @param[in] Input Pointer to the buffer containing the data to be decrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[out] Output Pointer to a buffer that receives the AES decryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -AesEcbDecrypt ( - IN VOID *AesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs AES encryption on a data buffer of the specified size in CBC mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] AesContext Pointer to the AES context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[in] Ivec Pointer to initialization vector. - @param[out] Output Pointer to a buffer that receives the AES encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -AesCbcEncrypt ( - IN VOID *AesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - IN CONST UINT8 *Ivec, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs AES decryption on a data buffer of the specified size in CBC mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] AesContext Pointer to the AES context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[in] Ivec Pointer to initialization vector. - @param[out] Output Pointer to a buffer that receives the AES encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -AesCbcDecrypt ( - IN VOID *AesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - IN CONST UINT8 *Ivec, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c deleted file mode 100644 index 5b48e445f2..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c +++ /dev/null @@ -1,130 +0,0 @@ -/** @file - ARC4 Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieves the size, in bytes, of the context buffer required for ARC4 operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - - -**/ -UINTN -EFIAPI -Arc4GetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory as ARC4 context for subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] Arc4Context Pointer to ARC4 context being initialized. - @param[in] Key Pointer to the user-supplied ARC4 key. - @param[in] KeySize Size of ARC4 key in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Arc4Init ( - OUT VOID *Arc4Context, - IN CONST UINT8 *Key, - IN UINTN KeySize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs ARC4 encryption on a data buffer of the specified size. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Arc4Context Pointer to the ARC4 context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[out] Output Pointer to a buffer that receives the ARC4 encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Arc4Encrypt ( - IN OUT VOID *Arc4Context, - IN CONST UINT8 *Input, - IN UINTN InputSize, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs ARC4 decryption on a data buffer of the specified size. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Arc4Context Pointer to the ARC4 context. - @param[in] Input Pointer to the buffer containing the data to be decrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[out] Output Pointer to a buffer that receives the ARC4 decryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Arc4Decrypt ( - IN OUT VOID *Arc4Context, - IN UINT8 *Input, - IN UINTN InputSize, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Resets the ARC4 context to the initial state. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Arc4Context Pointer to the ARC4 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Arc4Reset ( - IN OUT VOID *Arc4Context - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptTdesNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptTdesNull.c deleted file mode 100644 index cec33b6275..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptTdesNull.c +++ /dev/null @@ -1,166 +0,0 @@ -/** @file - TDES Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieves the size, in bytes, of the context buffer required for TDES operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -TdesGetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory as TDES context for subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] TdesContext Pointer to TDES context being initialized. - @param[in] Key Pointer to the user-supplied TDES key. - @param[in] KeyLength Length of TDES key in bits. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -TdesInit ( - OUT VOID *TdesContext, - IN CONST UINT8 *Key, - IN UINTN KeyLength - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs TDES encryption on a data buffer of the specified size in ECB mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] TdesContext Pointer to the TDES context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[out] Output Pointer to a buffer that receives the TDES encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -TdesEcbEncrypt ( - IN VOID *TdesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs TDES decryption on a data buffer of the specified size in ECB mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] TdesContext Pointer to the TDES context. - @param[in] Input Pointer to the buffer containing the data to be decrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[out] Output Pointer to a buffer that receives the TDES decryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -TdesEcbDecrypt ( - IN VOID *TdesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs TDES encryption on a data buffer of the specified size in CBC mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] TdesContext Pointer to the TDES context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[in] Ivec Pointer to initialization vector. - @param[out] Output Pointer to a buffer that receives the TDES encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -TdesCbcEncrypt ( - IN VOID *TdesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - IN CONST UINT8 *Ivec, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Performs TDES decryption on a data buffer of the specified size in CBC mode. - - Return FALSE to indicate this interface is not supported. - - @param[in] TdesContext Pointer to the TDES context. - @param[in] Input Pointer to the buffer containing the data to be encrypted. - @param[in] InputSize Size of the Input buffer in bytes. - @param[in] Ivec Pointer to initialization vector. - @param[out] Output Pointer to a buffer that receives the TDES encryption output. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -TdesCbcDecrypt ( - IN VOID *TdesContext, - IN CONST UINT8 *Input, - IN UINTN InputSize, - IN CONST UINT8 *Ivec, - OUT UINT8 *Output - ) -{ - ASSERT (FALSE); - return FALSE; -} - diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd4Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd4Null.c deleted file mode 100644 index 6327d983a9..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd4Null.c +++ /dev/null @@ -1,124 +0,0 @@ -/** @file - MD4 Digest Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieves the size, in bytes, of the context buffer required for MD4 hash - operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -Md4GetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory pointed by Md4Context as MD4 hash context for - subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] Md4Context Pointer to MD4 context being initialized. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md4Init ( - OUT VOID *Md4Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Makes a copy of an existing MD4 context. - - Return FALSE to indicate this interface is not supported. - - @param[in] Md4Context Pointer to MD4 context being copied. - @param[out] NewMd4Context Pointer to new MD4 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md4Duplicate ( - IN CONST VOID *Md4Context, - OUT VOID *NewMd4Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Digests the input data and updates MD4 context. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Md4Context Pointer to the MD4 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataSize Size of Data buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md4Update ( - IN OUT VOID *Md4Context, - IN CONST VOID *Data, - IN UINTN DataSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Completes computation of the MD4 digest value. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Md4Context Pointer to the MD4 context. - @param[out] HashValue Pointer to a buffer that receives the MD4 digest - value (16 bytes). - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md4Final ( - IN OUT VOID *Md4Context, - OUT UINT8 *HashValue - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd5Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd5Null.c deleted file mode 100644 index b9283d1746..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd5Null.c +++ /dev/null @@ -1,125 +0,0 @@ -/** @file - MD5 Digest Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - - -/** - Retrieves the size, in bytes, of the context buffer required for MD5 hash operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -Md5GetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - - -/** - Initializes user-supplied memory pointed by Md5Context as MD5 hash context for - subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] Md5Context Pointer to MD5 context being initialized. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md5Init ( - OUT VOID *Md5Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Makes a copy of an existing MD5 context. - - Return FALSE to indicate this interface is not supported. - - @param[in] Md5Context Pointer to MD5 context being copied. - @param[out] NewMd5Context Pointer to new MD5 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md5Duplicate ( - IN CONST VOID *Md5Context, - OUT VOID *NewMd5Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Digests the input data and updates MD5 context. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Md5Context Pointer to the MD5 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataSize Size of Data buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md5Update ( - IN OUT VOID *Md5Context, - IN CONST VOID *Data, - IN UINTN DataSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Completes computation of the MD5 digest value. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Md5Context Pointer to the MD5 context. - @param[out] HashValue Pointer to a buffer that receives the MD5 digest - value (16 bytes). - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Md5Final ( - IN OUT VOID *Md5Context, - OUT UINT8 *HashValue - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptSha1Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptSha1Null.c deleted file mode 100644 index 7d7aac52d2..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptSha1Null.c +++ /dev/null @@ -1,125 +0,0 @@ -/** @file - SHA-1 Digest Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - - -/** - Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations. - - Return zero to indicate this interface is not supported. - - @return The size, in bytes, of the context buffer required for SHA-1 hash operations. - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -Sha1GetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for - subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] Sha1Context Pointer to SHA-1 context being initialized. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Sha1Init ( - OUT VOID *Sha1Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Makes a copy of an existing SHA-1 context. - - Return FALSE to indicate this interface is not supported. - - @param[in] Sha1Context Pointer to SHA-1 context being copied. - @param[out] NewSha1Context Pointer to new SHA-1 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Sha1Duplicate ( - IN CONST VOID *Sha1Context, - OUT VOID *NewSha1Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Digests the input data and updates SHA-1 context. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Sha1Context Pointer to the SHA-1 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataSize Size of Data buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Sha1Update ( - IN OUT VOID *Sha1Context, - IN CONST VOID *Data, - IN UINTN DataSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Completes computation of the SHA-1 digest value. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] Sha1Context Pointer to the SHA-1 context. - @param[out] HashValue Pointer to a buffer that receives the SHA-1 digest - value (20 bytes). - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Sha1Final ( - IN OUT VOID *Sha1Context, - OUT UINT8 *HashValue - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacMd5Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacMd5Null.c deleted file mode 100644 index b09b5a8731..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacMd5Null.c +++ /dev/null @@ -1,127 +0,0 @@ -/** @file - HMAC-MD5 Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -HmacMd5GetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for - subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized. - @param[in] Key Pointer to the user-supplied key. - @param[in] KeySize Key size in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacMd5Init ( - OUT VOID *HmacMd5Context, - IN CONST UINT8 *Key, - IN UINTN KeySize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Makes a copy of an existing HMAC-MD5 context. - - Return FALSE to indicate this interface is not supported. - - @param[in] HmacMd5Context Pointer to HMAC-MD5 context being copied. - @param[out] NewHmacMd5Context Pointer to new HMAC-MD5 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacMd5Duplicate ( - IN CONST VOID *HmacMd5Context, - OUT VOID *NewHmacMd5Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Digests the input data and updates HMAC-MD5 context. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] HmacMd5Context Pointer to the HMAC-MD5 context. - @param[in] Data Pointer to the buffer containing the data to be digested. - @param[in] DataSize Size of Data buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacMd5Update ( - IN OUT VOID *HmacMd5Context, - IN CONST VOID *Data, - IN UINTN DataSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Completes computation of the HMAC-MD5 digest value. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] HmacMd5Context Pointer to the HMAC-MD5 context. - @param[out] HmacValue Pointer to a buffer that receives the HMAC-MD5 digest - value (16 bytes). - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacMd5Final ( - IN OUT VOID *HmacMd5Context, - OUT UINT8 *HmacValue - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacSha1Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacSha1Null.c deleted file mode 100644 index 97403ee00b..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacSha1Null.c +++ /dev/null @@ -1,127 +0,0 @@ -/** @file - HMAC-SHA1 Wrapper Implementation which does not provide real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations. - - Return zero to indicate this interface is not supported. - - @retval 0 This interface is not supported. - -**/ -UINTN -EFIAPI -HmacSha1GetContextSize ( - VOID - ) -{ - ASSERT (FALSE); - return 0; -} - -/** - Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for - subsequent use. - - Return FALSE to indicate this interface is not supported. - - @param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized. - @param[in] Key Pointer to the user-supplied key. - @param[in] KeySize Key size in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacSha1Init ( - OUT VOID *HmacSha1Context, - IN CONST UINT8 *Key, - IN UINTN KeySize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Makes a copy of an existing HMAC-SHA1 context. - - Return FALSE to indicate this interface is not supported. - - @param[in] HmacSha1Context Pointer to HMAC-SHA1 context being copied. - @param[out] NewHmacSha1Context Pointer to new HMAC-SHA1 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacSha1Duplicate ( - IN CONST VOID *HmacSha1Context, - OUT VOID *NewHmacSha1Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Digests the input data and updates HMAC-SHA1 context. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context. - @param[in] Data Pointer to the buffer containing the data to be digested. - @param[in] DataSize Size of Data buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacSha1Update ( - IN OUT VOID *HmacSha1Context, - IN CONST VOID *Data, - IN UINTN DataSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Completes computation of the HMAC-SHA1 digest value. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context. - @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA1 digest - value (20 bytes). - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -HmacSha1Final ( - IN OUT VOID *HmacSha1Context, - OUT UINT8 *HmacValue - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/InternalCryptLib.h b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/InternalCryptLib.h deleted file mode 100644 index 45144abd0a..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/InternalCryptLib.h +++ /dev/null @@ -1,23 +0,0 @@ -/** @file - Internal include file for BaseCryptLibRuntimeCryptProtocol. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __INTERNAL_CRYPT_LIB_H__ -#define __INTERNAL_CRYPT_LIB_H__ - -#include -#include -#include - -#endif - diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pem/CryptPemNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pem/CryptPemNull.c deleted file mode 100644 index 8c9e4f0bb5..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pem/CryptPemNull.c +++ /dev/null @@ -1,44 +0,0 @@ -/** @file - PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation which does - not provide real capabilities. - -Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Retrieve the RSA Private Key from the password-protected PEM key data. - - Return FALSE to indicate this interface is not supported. - - @param[in] PemData Pointer to the PEM-encoded key data to be retrieved. - @param[in] PemSize Size of the PEM key data in bytes. - @param[in] Password NULL-terminated passphrase used for encrypted PEM key data. - @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved - RSA private key component. Use RsaFree() function to free the - resource. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RsaGetPrivateKeyFromPem ( - IN CONST UINT8 *PemData, - IN UINTN PemSize, - IN CONST CHAR8 *Password, - OUT VOID **RsaContext - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptAuthenticodeNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptAuthenticodeNull.c deleted file mode 100644 index afec025dfa..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptAuthenticodeNull.c +++ /dev/null @@ -1,51 +0,0 @@ -/** @file - Authenticode Portable Executable Signature Verification which does not provide - real capabilities. - -Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Verifies the validity of a PE/COFF Authenticode Signature as described in "Windows - Authenticode Portable Executable Signature Format". - - Return FALSE to indicate this interface is not supported. - - @param[in] AuthData Pointer to the Authenticode Signature retrieved from signed - PE/COFF image to be verified. - @param[in] DataSize Size of the Authenticode Signature in bytes. - @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which - is used for certificate chain verification. - @param[in] CertSize Size of the trusted certificate in bytes. - @param[in] ImageHash Pointer to the original image file hash value. The procedure - for calculating the image hash value is described in Authenticode - specification. - @param[in] HashSize Size of Image hash value in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -AuthenticodeVerify ( - IN CONST UINT8 *AuthData, - IN UINTN DataSize, - IN CONST UINT8 *TrustedCert, - IN UINTN CertSize, - IN CONST UINT8 *ImageHash, - IN UINTN HashSize - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptDhNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptDhNull.c deleted file mode 100644 index 4def517162..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptDhNull.c +++ /dev/null @@ -1,156 +0,0 @@ -/** @file - Diffie-Hellman Wrapper Implementation which does not provide - real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Allocates and Initializes one Diffie-Hellman Context for subsequent use. - - @return Pointer to the Diffie-Hellman Context that has been initialized. - If the interface is not supported, DhNew() returns NULL. - -**/ -VOID * -EFIAPI -DhNew ( - VOID - ) -{ - ASSERT (FALSE); - return NULL; -} - -/** - Release the specified DH context. - - If the interface is not supported, then ASSERT(). - - @param[in] DhContext Pointer to the DH context to be released. - -**/ -VOID -EFIAPI -DhFree ( - IN VOID *DhContext - ) -{ - ASSERT (FALSE); -} - -/** - Generates DH parameter. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] DhContext Pointer to the DH context. - @param[in] Generator Value of generator. - @param[in] PrimeLength Length in bits of prime to be generated. - @param[out] Prime Pointer to the buffer to receive the generated prime number. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -DhGenerateParameter ( - IN OUT VOID *DhContext, - IN UINTN Generator, - IN UINTN PrimeLength, - OUT UINT8 *Prime - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Sets generator and prime parameters for DH. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] DhContext Pointer to the DH context. - @param[in] Generator Value of generator. - @param[in] PrimeLength Length in bits of prime to be generated. - @param[in] Prime Pointer to the prime number. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -DhSetParameter ( - IN OUT VOID *DhContext, - IN UINTN Generator, - IN UINTN PrimeLength, - IN CONST UINT8 *Prime - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Generates DH public key. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] DhContext Pointer to the DH context. - @param[out] PublicKey Pointer to the buffer to receive generated public key. - @param[in, out] PublicKeySize On input, the size of PublicKey buffer in bytes. - On output, the size of data returned in PublicKey buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -DhGenerateKey ( - IN OUT VOID *DhContext, - OUT UINT8 *PublicKey, - IN OUT UINTN *PublicKeySize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Computes exchanged common key. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] DhContext Pointer to the DH context. - @param[in] PeerPublicKey Pointer to the peer's public key. - @param[in] PeerPublicKeySize Size of peer's public key in bytes. - @param[out] Key Pointer to the buffer to receive generated key. - @param[in, out] KeySize On input, the size of Key buffer in bytes. - On output, the size of data returned in Key buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -DhComputeKey ( - IN OUT VOID *DhContext, - IN CONST UINT8 *PeerPublicKey, - IN UINTN PeerPublicKeySize, - OUT UINT8 *Key, - IN OUT UINTN *KeySize - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7SignNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7SignNull.c deleted file mode 100644 index 539bb6b7d5..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7SignNull.c +++ /dev/null @@ -1,59 +0,0 @@ -/** @file - PKCS#7 SignedData Sign Wrapper Implementation which does not provide real - capabilities. - -Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Creates a PKCS#7 signedData as described in "PKCS #7: Cryptographic Message - Syntax Standard, version 1.5". This interface is only intended to be used for - application to perform PKCS#7 functionality validation. - - Return FALSE to indicate this interface is not supported. - - @param[in] PrivateKey Pointer to the PEM-formatted private key data for - data signing. - @param[in] PrivateKeySize Size of the PEM private key data in bytes. - @param[in] KeyPassword NULL-terminated passphrase used for encrypted PEM - key data. - @param[in] InData Pointer to the content to be signed. - @param[in] InDataSize Size of InData in bytes. - @param[in] SignCert Pointer to signer's DER-encoded certificate to sign with. - @param[in] OtherCerts Pointer to an optional additional set of certificates to - include in the PKCS#7 signedData (e.g. any intermediate - CAs in the chain). - @param[out] SignedData Pointer to output PKCS#7 signedData. - @param[out] SignedDataSize Size of SignedData in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Pkcs7Sign ( - IN CONST UINT8 *PrivateKey, - IN UINTN PrivateKeySize, - IN CONST UINT8 *KeyPassword, - IN UINT8 *InData, - IN UINTN InDataSize, - IN UINT8 *SignCert, - IN UINT8 *OtherCerts OPTIONAL, - OUT UINT8 **SignedData, - OUT UINTN *SignedDataSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7VerifyNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7VerifyNull.c deleted file mode 100644 index ae1c13c23e..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7VerifyNull.c +++ /dev/null @@ -1,163 +0,0 @@ -/** @file - PKCS#7 SignedData Verification Wrapper Implementation which does not provide - real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Get the signer's certificates from PKCS#7 signed data as described in "PKCS #7: - Cryptographic Message Syntax Standard". The input signed data could be wrapped - in a ContentInfo structure. - - Return FALSE to indicate this interface is not supported. - - @param[in] P7Data Pointer to the PKCS#7 message to verify. - @param[in] P7Length Length of the PKCS#7 message in bytes. - @param[out] CertStack Pointer to Signer's certificates retrieved from P7Data. - It's caller's responsibility to free the buffer. - @param[out] StackLength Length of signer's certificates in bytes. - @param[out] TrustedCert Pointer to a trusted certificate from Signer's certificates. - It's caller's responsibility to free the buffer. - @param[out] CertLength Length of the trusted certificate in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Pkcs7GetSigners ( - IN CONST UINT8 *P7Data, - IN UINTN P7Length, - OUT UINT8 **CertStack, - OUT UINTN *StackLength, - OUT UINT8 **TrustedCert, - OUT UINTN *CertLength - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Wrap function to use free() to free allocated memory for certificates. - - If the interface is not supported, then ASSERT(). - - @param[in] Certs Pointer to the certificates to be freed. - -**/ -VOID -EFIAPI -Pkcs7FreeSigners ( - IN UINT8 *Certs - ) -{ - ASSERT (FALSE); -} - -/** - Retrieves all embedded certificates from PKCS#7 signed data as described in "PKCS #7: - Cryptographic Message Syntax Standard", and outputs two certificate lists chained and - unchained to the signer's certificates. - The input signed data could be wrapped in a ContentInfo structure. - - @param[in] P7Data Pointer to the PKCS#7 message. - @param[in] P7Length Length of the PKCS#7 message in bytes. - @param[out] SignerChainCerts Pointer to the certificates list chained to signer's - certificate. It's caller's responsibility to free the buffer. - @param[out] ChainLength Length of the chained certificates list buffer in bytes. - @param[out] UnchainCerts Pointer to the unchained certificates lists. It's caller's - responsibility to free the buffer. - @param[out] UnchainLength Length of the unchained certificates list buffer in bytes. - - @retval TRUE The operation is finished successfully. - @retval FALSE Error occurs during the operation. - -**/ -BOOLEAN -EFIAPI -Pkcs7GetCertificatesList ( - IN CONST UINT8 *P7Data, - IN UINTN P7Length, - OUT UINT8 **SignerChainCerts, - OUT UINTN *ChainLength, - OUT UINT8 **UnchainCerts, - OUT UINTN *UnchainLength - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Verifies the validity of a PKCS#7 signed data as described in "PKCS #7: - Cryptographic Message Syntax Standard". The input signed data could be wrapped - in a ContentInfo structure. - - Return FALSE to indicate this interface is not supported. - - @param[in] P7Data Pointer to the PKCS#7 message to verify. - @param[in] P7Length Length of the PKCS#7 message in bytes. - @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which - is used for certificate chain verification. - @param[in] CertLength Length of the trusted certificate in bytes. - @param[in] InData Pointer to the content to be verified. - @param[in] DataLength Length of InData in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Pkcs7Verify ( - IN CONST UINT8 *P7Data, - IN UINTN P7Length, - IN CONST UINT8 *TrustedCert, - IN UINTN CertLength, - IN CONST UINT8 *InData, - IN UINTN DataLength - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Extracts the attached content from a PKCS#7 signed data if existed. The input signed - data could be wrapped in a ContentInfo structure. - - Return FALSE to indicate this interface is not supported. - - @param[in] P7Data Pointer to the PKCS#7 signed data to process. - @param[in] P7Length Length of the PKCS#7 signed data in bytes. - @param[out] Content Pointer to the extracted content from the PKCS#7 signedData. - It's caller's responsibility to free the buffer. - @param[out] ContentSize The size of the extracted content in bytes. - - @retval TRUE The P7Data was correctly formatted for processing. - @retval FALSE The P7Data was not correctly formatted for processing. - -**/ -BOOLEAN -EFIAPI -Pkcs7GetAttachedContent ( - IN CONST UINT8 *P7Data, - IN UINTN P7Length, - OUT VOID **Content, - OUT UINTN *ContentSize - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c deleted file mode 100644 index b72079a8d5..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c +++ /dev/null @@ -1,125 +0,0 @@ -/** @file - RSA Asymmetric Cipher Wrapper Implementation over OpenSSL. - - This file does not provide real capabilities for following APIs in RSA handling: - 1) RsaGetKey - 2) RsaGenerateKey - 3) RsaCheckKey - 4) RsaPkcs1Sign - -Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Gets the tag-designated RSA key component from the established RSA context. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] RsaContext Pointer to RSA context being set. - @param[in] KeyTag Tag of RSA key component being set. - @param[out] BigNumber Pointer to octet integer buffer. - @param[in, out] BnSize On input, the size of big number buffer in bytes. - On output, the size of data returned in big number buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RsaGetKey ( - IN OUT VOID *RsaContext, - IN RSA_KEY_TAG KeyTag, - OUT UINT8 *BigNumber, - IN OUT UINTN *BnSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Generates RSA key components. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] RsaContext Pointer to RSA context being set. - @param[in] ModulusLength Length of RSA modulus N in bits. - @param[in] PublicExponent Pointer to RSA public exponent. - @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RsaGenerateKey ( - IN OUT VOID *RsaContext, - IN UINTN ModulusLength, - IN CONST UINT8 *PublicExponent, - IN UINTN PublicExponentSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Validates key components of RSA context. - - Return FALSE to indicate this interface is not supported. - - @param[in] RsaContext Pointer to RSA context to check. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RsaCheckKey ( - IN VOID *RsaContext - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme. - - Return FALSE to indicate this interface is not supported. - - @param[in] RsaContext Pointer to RSA context for signature generation. - @param[in] MessageHash Pointer to octet message hash to be signed. - @param[in] HashSize Size of the message hash in bytes. - @param[out] Signature Pointer to buffer to receive RSA PKCS1-v1_5 signature. - @param[in, out] SigSize On input, the size of Signature buffer in bytes. - On output, the size of data returned in Signature buffer in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RsaPkcs1Sign ( - IN VOID *RsaContext, - IN CONST UINT8 *MessageHash, - IN UINTN HashSize, - OUT UINT8 *Signature, - IN OUT UINTN *SigSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - - diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptX509Null.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptX509Null.c deleted file mode 100644 index f95a2c0a89..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptX509Null.c +++ /dev/null @@ -1,238 +0,0 @@ -/** @file - X.509 Certificate Handler Wrapper Implementation which does not provide - real capabilities. - -Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - -/** - Construct a X509 object from DER-encoded certificate data. - - Return FALSE to indicate this interface is not supported. - - @param[in] Cert Pointer to the DER-encoded certificate data. - @param[in] CertSize The size of certificate data in bytes. - @param[out] SingleX509Cert The generated X509 object. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -X509ConstructCertificate ( - IN CONST UINT8 *Cert, - IN UINTN CertSize, - OUT UINT8 **SingleX509Cert - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Construct a X509 stack object from a list of DER-encoded certificate data. - - Return FALSE to indicate this interface is not supported. - - @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object. - On output, pointer to the X509 stack object with new - inserted X509 certificate. - @param ... A list of DER-encoded single certificate data followed - by certificate size. A NULL terminates the list. The - pairs are the arguments to X509ConstructCertificate(). - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -X509ConstructCertificateStack ( - IN OUT UINT8 **X509Stack, - ... - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Release the specified X509 object. - - If the interface is not supported, then ASSERT(). - - @param[in] X509Cert Pointer to the X509 object to be released. - -**/ -VOID -EFIAPI -X509Free ( - IN VOID *X509Cert - ) -{ - ASSERT (FALSE); -} - -/** - Release the specified X509 stack object. - - If the interface is not supported, then ASSERT(). - - @param[in] X509Stack Pointer to the X509 stack object to be released. - -**/ -VOID -EFIAPI -X509StackFree ( - IN VOID *X509Stack - ) -{ - ASSERT (FALSE); -} - -/** - Retrieve the subject bytes from one X.509 certificate. - - Return FALSE to indicate this interface is not supported. - - @param[in] Cert Pointer to the DER-encoded X509 certificate. - @param[in] CertSize Size of the X509 certificate in bytes. - @param[out] CertSubject Pointer to the retrieved certificate subject bytes. - @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input, - and the size of buffer returned CertSubject on output. - - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -X509GetSubjectName ( - IN CONST UINT8 *Cert, - IN UINTN CertSize, - OUT UINT8 *CertSubject, - IN OUT UINTN *SubjectSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Retrieve the common name (CN) string from one X.509 certificate. - - Return RETURN_UNSUPPORTED to indicate this interface is not supported. - - @param[in] Cert Pointer to the DER-encoded X509 certificate. - @param[in] CertSize Size of the X509 certificate in bytes. - @param[out] CommonName Buffer to contain the retrieved certificate common - name string. At most CommonNameSize bytes will be - written and the string will be null terminated. May be - NULL in order to determine the size buffer needed. - @param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input, - and the size of buffer returned CommonName on output. - If CommonName is NULL then the amount of space needed - in buffer (including the final null) is returned. - - @retval RETURN_UNSUPPORTED The operation is not supported. - -**/ -RETURN_STATUS -EFIAPI -X509GetCommonName ( - IN CONST UINT8 *Cert, - IN UINTN CertSize, - OUT CHAR8 *CommonName, OPTIONAL - IN OUT UINTN *CommonNameSize - ) -{ - ASSERT (FALSE); - return RETURN_UNSUPPORTED; -} - -/** - Retrieve the RSA Public Key from one DER-encoded X509 certificate. - - Return FALSE to indicate this interface is not supported. - - @param[in] Cert Pointer to the DER-encoded X509 certificate. - @param[in] CertSize Size of the X509 certificate in bytes. - @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved - RSA public key component. Use RsaFree() function to free the - resource. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RsaGetPublicKeyFromX509 ( - IN CONST UINT8 *Cert, - IN UINTN CertSize, - OUT VOID **RsaContext - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Verify one X509 certificate was issued by the trusted CA. - - Return FALSE to indicate this interface is not supported. - - @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified. - @param[in] CertSize Size of the X509 certificate in bytes. - @param[in] CACert Pointer to the DER-encoded trusted CA certificate. - @param[in] CACertSize Size of the CA Certificate in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -X509VerifyCert ( - IN CONST UINT8 *Cert, - IN UINTN CertSize, - IN CONST UINT8 *CACert, - IN UINTN CACertSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Retrieve the TBSCertificate from one given X.509 certificate. - - Return FALSE to indicate this interface is not supported. - - @param[in] Cert Pointer to the given DER-encoded X509 certificate. - @param[in] CertSize Size of the X509 certificate in bytes. - @param[out] TBSCert DER-Encoded To-Be-Signed certificate. - @param[out] TBSCertSize Size of the TBS certificate in bytes. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -X509GetTBSCert ( - IN CONST UINT8 *Cert, - IN UINTN CertSize, - OUT UINT8 **TBSCert, - OUT UINTN *TBSCertSize - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Rand/CryptRandNull.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Rand/CryptRandNull.c deleted file mode 100644 index c292a2301e..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Rand/CryptRandNull.c +++ /dev/null @@ -1,63 +0,0 @@ -/** @file - Pseudorandom Number Generator Wrapper Implementation which does not provide - real capabilities. - -Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "InternalCryptLib.h" - - -/** - Sets up the seed value for the pseudorandom number generator. - - Return FALSE to indicate this interface is not supported. - - @param[in] Seed Pointer to seed value. - If NULL, default seed is used. - @param[in] SeedSize Size of seed value. - If Seed is NULL, this parameter is ignored. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RandomSeed ( - IN CONST UINT8 *Seed OPTIONAL, - IN UINTN SeedSize - ) -{ - ASSERT (FALSE); - return FALSE; -} - -/** - Generates a pseudorandom byte stream of the specified size. - - Return FALSE to indicate this interface is not supported. - - @param[out] Output Pointer to buffer to receive random value. - @param[in] Size Size of random bytes to generate. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -RandomBytes ( - OUT UINT8 *Output, - IN UINTN Size - ) -{ - ASSERT (FALSE); - return FALSE; -} diff --git a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/RuntimeDxeIpfCryptLib.c b/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/RuntimeDxeIpfCryptLib.c deleted file mode 100644 index 9babc7e952..0000000000 --- a/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/RuntimeDxeIpfCryptLib.c +++ /dev/null @@ -1,419 +0,0 @@ -/** @file - Implementation of The runtime cryptographic library instance (for IPF). - -Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include - -#include -#include -#include -#include - -#include - -#include - -EFI_RUNTIME_CRYPT_PROTOCOL *mCryptProtocol = NULL; -EFI_EVENT mIpfCryptLibVirtualNotifyEvent; - -/** - Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, which converts - pointer to new virtual address. - - @param Event Event whose notification function is being invoked. - @param Context Pointer to the notification function's context - -**/ -VOID -EFIAPI -IpfCryptLibAddressChangeEvent ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - // - // Convert Address of Runtime Crypto Protocol. - // - EfiConvertPointer (0x0, (VOID **) &mCryptProtocol); -} - -/** - Constructor of IPF Crypto Library Instance. - This function locates the Runtime Crypt Protocol and register notification - function for EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. - - @param ImageHandle The firmware allocated handle for the EFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -RuntimeDxeIpfCryptLibConstructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Locate Runtime Crypt Protocol Instance - // - Status = gBS->LocateProtocol ( - &gEfiRuntimeCryptProtocolGuid, - NULL, - (VOID**) &mCryptProtocol - ); - ASSERT_EFI_ERROR (Status); - ASSERT (mCryptProtocol != NULL); - - // - // Register SetVirtualAddressMap () notify function - // - Status = gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_NOTIFY, - IpfCryptLibAddressChangeEvent, - NULL, - &gEfiEventVirtualAddressChangeGuid, - &mIpfCryptLibVirtualNotifyEvent - ); - ASSERT_EFI_ERROR (Status); - - return Status; -} - -/** - Destructor of IPF Crypto Library Instance. - - @param ImageHandle The firmware allocated handle for the EFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The destructor completed successfully. - @retval Other value The destructor did not complete successfully. - -**/ -EFI_STATUS -EFIAPI -RuntimeDxeIpfCryptLibDestructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Close the Set Virtual Address Map event - // - Status = gBS->CloseEvent (mIpfCryptLibVirtualNotifyEvent); - ASSERT_EFI_ERROR (Status); - - return Status; -} - -/** - Check whether crypto service provided by Runtime Crypt protocol is ready to use. - - Crypto service is available if the call is in physical mode prior to - SetVirtualAddressMap() or virtual mode after SetVirtualAddressMap(). If either - of these two conditions are met, this routine will return TRUE; if neither of - these conditions are met, this routine will return FALSE. - - @retval TRUE The Crypto service is ready to use. - @retval FALSE The Crypto service is not available. - -**/ -BOOLEAN -EFIAPI -InternalIsCryptServiveAvailable ( - VOID - ) -{ - INT64 CpuMode; - BOOLEAN GoneVirtual; - - CpuMode = AsmCpuVirtual(); - if (CpuMode < 0) { - // - // CPU is in mixed mode, return failing the operation gracefully. - // - return FALSE; - } - - GoneVirtual = EfiGoneVirtual(); - - if ((CpuMode > 0) && !GoneVirtual) { - // - // CPU is in virtual mode, but SetVirtualAddressMap() has not been called, - // so return failing the operation gracefully. - // - return FALSE; - } - - if ((CpuMode == 0) && GoneVirtual) { - // - // CPU is in physical mode, but SetVirtualAddressMap() has been called, - // so return failing the operation gracefully. - // - return FALSE; - } - - return TRUE; -} - -/** - Retrieves the size, in bytes, of the context buffer required for SHA-256 operations. - - @return The size, in bytes, of the context buffer required for SHA-256 operations. - -**/ -UINTN -EFIAPI -Sha256GetContextSize ( - VOID - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return 0; - } - - return mCryptProtocol->Sha256GetContextSize (); -} - -/** - Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for - subsequent use. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 Context being initialized. - - @retval TRUE SHA-256 context initialization succeeded. - @retval FALSE SHA-256 context initialization failed. - -**/ -BOOLEAN -EFIAPI -Sha256Init ( - IN OUT VOID *Sha256Context - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return FALSE; - } - - return mCryptProtocol->Sha256Init (Sha256Context); -} - - -/** - Makes a copy of an existing SHA-256 context. - - Return FALSE to indicate this interface is not supported. - - @param[in] Sha256Context Pointer to SHA-256 context being copied. - @param[out] NewSha256Context Pointer to new SHA-256 context. - - @retval FALSE This interface is not supported. - -**/ -BOOLEAN -EFIAPI -Sha256Duplicate ( - IN CONST VOID *Sha256Context, - OUT VOID *NewSha256Context - ) -{ - ASSERT (FALSE); - return FALSE; -} - - -/** - Performs SHA-256 digest on a data buffer of the specified length. This function can - be called multiple times to compute the digest of long or discontinuous data streams. - - If Sha256Context is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to the SHA-256 context. - @param[in] Data Pointer to the buffer containing the data to be hashed. - @param[in] DataLength Length of Data buffer in bytes. - - @retval TRUE SHA-256 data digest succeeded. - @retval FALSE Invalid SHA-256 context. After Sha256Final function has been called, the - SHA-256 context cannot be reused. - -**/ -BOOLEAN -EFIAPI -Sha256Update ( - IN OUT VOID *Sha256Context, - IN CONST VOID *Data, - IN UINTN DataLength - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return FALSE; - } - - return mCryptProtocol->Sha256Update (Sha256Context, Data, DataLength); -} - -/** - Completes SHA-256 hash computation and retrieves the digest value into the specified - memory. After this function has been called, the SHA-256 context cannot be used again. - - If Sha256Context is NULL, then return FALSE. - If HashValue is NULL, then return FALSE. - - @param[in, out] Sha256Context Pointer to SHA-256 context - @param[out] HashValue Pointer to a buffer that receives the SHA-256 digest - value (32 bytes). - - @retval TRUE SHA-256 digest computation succeeded. - @retval FALSE SHA-256 digest computation failed. - -**/ -BOOLEAN -EFIAPI -Sha256Final ( - IN OUT VOID *Sha256Context, - OUT UINT8 *HashValue - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return FALSE; - } - - return mCryptProtocol->Sha256Final (Sha256Context, HashValue); -} - -/** - Allocates and initializes one RSA context for subsequent use. - - @return Pointer to the RSA context that has been initialized. - If the allocations fails, RsaNew() returns NULL. - -**/ -VOID * -EFIAPI -RsaNew ( - VOID - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return FALSE; - } - - return mCryptProtocol->RsaNew (); -} - -/** - Release the specified RSA context. - - @param[in] RsaContext Pointer to the RSA context to be released. - -**/ -VOID -EFIAPI -RsaFree ( - IN VOID *RsaContext - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return; - } - - mCryptProtocol->RsaFree (RsaContext); -} - -/** - Sets the tag-designated key component into the established RSA context. - - This function sets the tag-designated RSA key component into the established - RSA context from the user-specified non-negative integer (octet string format - represented in RSA PKCS#1). - If BigNumber is NULL, then the specified key component in RSA context is cleared. - - If RsaContext is NULL, then return FALSE. - - @param[in, out] RsaContext Pointer to RSA context being set. - @param[in] KeyTag Tag of RSA key component being set. - @param[in] BigNumber Pointer to octet integer buffer. - If NULL, then the specified key component in RSA - context is cleared. - @param[in] BnSize Size of big number buffer in bytes. - If BigNumber is NULL, then it is ignored. - - @retval TRUE RSA key component was set successfully. - @retval FALSE Invalid RSA key component tag. - -**/ -BOOLEAN -EFIAPI -RsaSetKey ( - IN OUT VOID *RsaContext, - IN RSA_KEY_TAG KeyTag, - IN CONST UINT8 *BigNumber, - IN UINTN BnSize - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return FALSE; - } - - return mCryptProtocol->RsaSetKey (RsaContext, KeyTag, BigNumber, BnSize); -} - -/** - Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in - RSA PKCS#1. - - If RsaContext is NULL, then return FALSE. - If MessageHash is NULL, then return FALSE. - If Signature is NULL, then return FALSE. - If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE. - - @param[in] RsaContext Pointer to RSA context for signature verification. - @param[in] MessageHash Pointer to octet message hash to be checked. - @param[in] HashSize Size of the message hash in bytes. - @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified. - @param[in] SigSize Size of signature in bytes. - - @retval TRUE Valid signature encoded in PKCS1-v1_5. - @retval FALSE Invalid signature or invalid RSA context. - -**/ -BOOLEAN -EFIAPI -RsaPkcs1Verify ( - IN VOID *RsaContext, - IN CONST UINT8 *MessageHash, - IN UINTN HashSize, - IN CONST UINT8 *Signature, - IN UINTN SigSize - ) -{ - if (!InternalIsCryptServiveAvailable ()) { - return FALSE; - } - - return mCryptProtocol->RsaPkcs1Verify ( - RsaContext, - MessageHash, - HashSize, - Signature, - SigSize - ); -} diff --git a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf index 91e5eb79b2..579da34aff 100644 --- a/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf +++ b/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf @@ -1,7 +1,7 @@ ## @file # Intrinsic Routines Wrapper Library Instance. # -# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -24,7 +24,7 @@ # # The following information is for reference only and not required by the build tools. # -# VALID_ARCHITECTURES = IA32 X64 IPF +# VALID_ARCHITECTURES = IA32 X64 # [Sources] @@ -47,15 +47,6 @@ [Sources.X64] CopyMem.c -[Sources.IPF] - CopyMem.c | MSFT - CopyMem.c | INTEL -# -# In tools_def.txt, GCC rename symbol name memcpy to be CopyMem for IPF, -# i.e. "DEFINE GCC_IPF_SYMRENAME_FLAGS = --redefine-sym memcpy=CopyMem", -# so there will be no source file CopyMem.c for GCC compiler family. -# - [Packages] MdePkg/MdePkg.dec @@ -78,6 +69,4 @@ MSFT:RELEASE_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF MSFT:DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm MSFT:RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF - MSFT:DEBUG_*_IPF_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /FIAutoGen.h /QIPF_fr32 /Zi - MSFT:RELEASE_*_IPF_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /FIAutoGen.h /QIPF_fr32 INTEL:*_*_*_CC_FLAGS = /Oi- diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf index 55a6fa362a..0300856cf2 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -1,7 +1,7 @@ ## @file # This module provides OpenSSL Library implementation. # -# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -24,7 +24,7 @@ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNO_SYSLOG # -# VALID_ARCHITECTURES = IA32 X64 IPF ARM AARCH64 +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 # [Sources] @@ -544,11 +544,9 @@ # MSFT:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4389 /wd4702 /wd4706 /wd4819 MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819 - MSFT:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819 INTEL:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w - INTEL:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w # # Suppress the following build warnings in openssl so we don't break the build with -Werror @@ -558,7 +556,6 @@ # GCC:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -DNO_MSABI_VA_FUNCS - GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf index f542998961..23be4e1e14 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf @@ -1,7 +1,7 @@ ## @file # This module provides OpenSSL Library implementation. # -# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -24,7 +24,7 @@ DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNO_SYSLOG # -# VALID_ARCHITECTURES = IA32 X64 IPF ARM AARCH64 +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 # [Sources] @@ -505,11 +505,9 @@ # MSFT:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4389 /wd4702 /wd4706 /wd4819 MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819 - MSFT:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819 INTEL:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w - INTEL:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w # # Suppress the following build warnings in openssl so we don't break the build with -Werror @@ -519,7 +517,6 @@ # GCC:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -DNO_MSABI_VA_FUNCS - GCC:*_*_IPF_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format diff --git a/CryptoPkg/Library/TlsLib/TlsLib.inf b/CryptoPkg/Library/TlsLib/TlsLib.inf index 4dacb2fab0..7bf56f26a1 100644 --- a/CryptoPkg/Library/TlsLib/TlsLib.inf +++ b/CryptoPkg/Library/TlsLib/TlsLib.inf @@ -1,7 +1,7 @@ ## @file # SSL/TLS Wrapper Library Instance based on OpenSSL. # -# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -25,7 +25,7 @@ # # The following information is for reference only and not required by the build tools. # -# VALID_ARCHITECTURES = IA32 X64 IPF ARM AARCH64 +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 # [Sources]