//=====================================================================================\r
\r
/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- If this interface is not supported, then return zero.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
- @return The size, in bytes, of the context buffer required for TDES operations.\r
@retval 0 This interface is not supported.\r
\r
**/\r
UINTN\r
EFIAPI\r
-CryptoServiceTdesGetContextSize (\r
+DeprecatedCryptoServiceTdesGetContextSize (\r
VOID\r
)\r
{\r
- return CALL_BASECRYPTLIB (Tdes.Services.GetContextSize, TdesGetContextSize, (), 0);\r
+ return BaseCryptLibServiceDeprecated ("TdesGetContextSize"), 0;\r
}\r
\r
/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by TdesContext as TDES context.\r
- In addition, it sets up all TDES key materials for subsequent encryption and decryption\r
- operations.\r
- There are 3 key options as follows:\r
- KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)\r
- KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)\r
- KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Key is NULL, then return FALSE.\r
- If KeyLength is not valid, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
@param[out] TdesContext Pointer to TDES context being initialized.\r
@param[in] Key Pointer to the user-supplied TDES key.\r
@param[in] KeyLength Length of TDES key in bits.\r
\r
- @retval TRUE TDES context initialization succeeded.\r
- @retval FALSE TDES context initialization failed.\r
@retval FALSE This interface is not supported.\r
\r
**/\r
BOOLEAN\r
EFIAPI\r
-CryptoServiceTdesInit (\r
+DeprecatedCryptoServiceTdesInit (\r
OUT VOID *TdesContext,\r
IN CONST UINT8 *Key,\r
IN UINTN KeyLength\r
)\r
{\r
- return CALL_BASECRYPTLIB (Tdes.Services.Init, TdesInit, (TdesContext, Key, KeyLength), FALSE);\r
+ return BaseCryptLibServiceDeprecated ("TdesInit"), FALSE;\r
}\r
\r
/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
@param[in] TdesContext Pointer to the TDES context.\r
@param[in] Input Pointer to the buffer containing the data to be encrypted.\r
@param[in] InputSize Size of the Input buffer in bytes.\r
@param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
@retval FALSE This interface is not supported.\r
\r
**/\r
BOOLEAN\r
EFIAPI\r
-CryptoServiceTdesEcbEncrypt (\r
+DeprecatedCryptoServiceTdesEcbEncrypt (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
)\r
{\r
- return CALL_BASECRYPTLIB (Tdes.Services.EcbEncrypt, TdesEcbEncrypt, (TdesContext, Input, InputSize, Output), FALSE);\r
+ return BaseCryptLibServiceDeprecated ("TdesEcbEncrypt"), FALSE;\r
}\r
\r
/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
@param[in] TdesContext Pointer to the TDES context.\r
@param[in] Input Pointer to the buffer containing the data to be decrypted.\r
@param[in] InputSize Size of the Input buffer in bytes.\r
@param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
@retval FALSE This interface is not supported.\r
\r
**/\r
BOOLEAN\r
EFIAPI\r
-CryptoServiceTdesEcbDecrypt (\r
+DeprecatedCryptoServiceTdesEcbDecrypt (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
)\r
{\r
- return CALL_BASECRYPTLIB (Tdes.Services.EcbDecrypt, TdesEcbDecrypt, (TdesContext, Input, InputSize, Output), FALSE);\r
+ return BaseCryptLibServiceDeprecated ("TdesEcbDecrypt"), FALSE;\r
}\r
\r
/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
@param[in] TdesContext Pointer to the TDES context.\r
@param[in] Input Pointer to the buffer containing the data to be encrypted.\r
@param[in] Ivec Pointer to initialization vector.\r
@param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
@retval FALSE This interface is not supported.\r
\r
**/\r
BOOLEAN\r
EFIAPI\r
-CryptoServiceTdesCbcEncrypt (\r
+DeprecatedCryptoServiceTdesCbcEncrypt (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
)\r
{\r
- return CALL_BASECRYPTLIB (Tdes.Services.CbcEncrypt, TdesCbcEncrypt, (TdesContext, Input, InputSize, Ivec, Output), FALSE);\r
+ return BaseCryptLibServiceDeprecated ("TdesCbcEncrypt"), FALSE;\r
}\r
\r
/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
@param[in] TdesContext Pointer to the TDES context.\r
@param[in] Input Pointer to the buffer containing the data to be encrypted.\r
@param[in] Ivec Pointer to initialization vector.\r
@param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
@retval FALSE This interface is not supported.\r
\r
**/\r
BOOLEAN\r
EFIAPI\r
-CryptoServiceTdesCbcDecrypt (\r
+DeprecatedCryptoServiceTdesCbcDecrypt (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
)\r
{\r
- return CALL_BASECRYPTLIB (Tdes.Services.CbcDecrypt, TdesCbcDecrypt, (TdesContext, Input, InputSize, Ivec, Output), FALSE);\r
+ return BaseCryptLibServiceDeprecated ("TdesCbcDecrypt"), FALSE;\r
}\r
\r
/**\r
CryptoServiceX509Free,\r
CryptoServiceX509StackFree,\r
CryptoServiceX509GetTBSCert,\r
- /// TDES\r
- CryptoServiceTdesGetContextSize,\r
- CryptoServiceTdesInit,\r
- CryptoServiceTdesEcbEncrypt,\r
- CryptoServiceTdesEcbDecrypt,\r
- CryptoServiceTdesCbcEncrypt,\r
- CryptoServiceTdesCbcDecrypt,\r
+ /// TDES - deprecated and unsupported\r
+ DeprecatedCryptoServiceTdesGetContextSize,\r
+ DeprecatedCryptoServiceTdesInit,\r
+ DeprecatedCryptoServiceTdesEcbEncrypt,\r
+ DeprecatedCryptoServiceTdesEcbDecrypt,\r
+ DeprecatedCryptoServiceTdesCbcEncrypt,\r
+ DeprecatedCryptoServiceTdesCbcDecrypt,\r
/// AES\r
CryptoServiceAesGetContextSize,\r
CryptoServiceAesInit,\r
// Symmetric Cryptography Primitive\r
//=====================================================================================\r
\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- If this interface is not supported, then return zero.\r
-\r
- @return The size, in bytes, of the context buffer required for TDES operations.\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-TdesGetContextSize (\r
- VOID\r
- );\r
-\r
-/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by TdesContext as TDES context.\r
- In addition, it sets up all TDES key materials for subsequent encryption and decryption\r
- operations.\r
- There are 3 key options as follows:\r
- KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)\r
- KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)\r
- KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Key is NULL, then return FALSE.\r
- If KeyLength is not valid, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[out] TdesContext Pointer to TDES context being initialized.\r
- @param[in] Key Pointer to the user-supplied TDES key.\r
- @param[in] KeyLength Length of TDES key in bits.\r
-\r
- @retval TRUE TDES context initialization succeeded.\r
- @retval FALSE TDES context initialization failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesInit (\r
- OUT VOID *TdesContext,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeyLength\r
- );\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be decrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- );\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- );\r
-\r
/**\r
Retrieves the size, in bytes, of the context buffer required for AES operations.\r
\r
Hmac/CryptHmacSha256.c\r
Kdf/CryptHkdf.c\r
Cipher/CryptAes.c\r
- Cipher/CryptTdes.c\r
Pk/CryptRsaBasic.c\r
Pk/CryptRsaExt.c\r
Pk/CryptPkcs1Oaep.c\r
+++ /dev/null
-/** @file\r
- TDES Wrapper Implementation over OpenSSL.\r
-\r
-Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "InternalCryptLib.h"\r
-#include <openssl/des.h>\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- @return The size, in bytes, of the context buffer required for TDES operations.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-TdesGetContextSize (\r
- VOID\r
- )\r
-{\r
- //\r
- // Memory for 3 copies of DES_key_schedule is allocated, for K1, K2 and K3 each.\r
- //\r
- return (UINTN) (3 * sizeof (DES_key_schedule));\r
-}\r
-\r
-/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by TdesContext as TDES context.\r
- In addition, it sets up all TDES key materials for subsequent encryption and decryption\r
- operations.\r
- There are 3 key options as follows:\r
- KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)\r
- KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)\r
- KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Key is NULL, then return FALSE.\r
- If KeyLength is not valid, then return FALSE.\r
-\r
- @param[out] TdesContext Pointer to TDES context being initialized.\r
- @param[in] Key Pointer to the user-supplied TDES key.\r
- @param[in] KeyLength Length of TDES key in bits.\r
-\r
- @retval TRUE TDES context initialization succeeded.\r
- @retval FALSE TDES context initialization failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesInit (\r
- OUT VOID *TdesContext,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeyLength\r
- )\r
-{\r
- DES_key_schedule *KeySchedule;\r
-\r
- //\r
- // Check input parameters.\r
- //\r
- if (TdesContext == NULL || Key == NULL || (KeyLength != 64 && KeyLength != 128 && KeyLength != 192)) {\r
- return FALSE;\r
- }\r
-\r
- KeySchedule = (DES_key_schedule *) TdesContext;\r
-\r
- //\r
- // If input Key is a weak key, return error.\r
- //\r
- if (DES_is_weak_key ((const_DES_cblock *) Key) == 1) {\r
- return FALSE;\r
- }\r
-\r
- DES_set_key_unchecked ((const_DES_cblock *) Key, KeySchedule);\r
-\r
- if (KeyLength == 64) {\r
- CopyMem (KeySchedule + 1, KeySchedule, sizeof (DES_key_schedule));\r
- CopyMem (KeySchedule + 2, KeySchedule, sizeof (DES_key_schedule));\r
- return TRUE;\r
- }\r
-\r
- if (DES_is_weak_key ((const_DES_cblock *) (Key + 8)) == 1) {\r
- return FALSE;\r
- }\r
-\r
- DES_set_key_unchecked ((const_DES_cblock *) (Key + 8), KeySchedule + 1);\r
-\r
- if (KeyLength == 128) {\r
- CopyMem (KeySchedule + 2, KeySchedule, sizeof (DES_key_schedule));\r
- return TRUE;\r
- }\r
-\r
- if (DES_is_weak_key ((const_DES_cblock *) (Key + 16)) == 1) {\r
- return FALSE;\r
- }\r
-\r
- DES_set_key_unchecked ((const_DES_cblock *) (Key + 16), KeySchedule + 2);\r
-\r
- return TRUE;\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- DES_key_schedule *KeySchedule;\r
-\r
- //\r
- // Check input parameters.\r
- //\r
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0 || Output == NULL) {\r
- return FALSE;\r
- }\r
-\r
- KeySchedule = (DES_key_schedule *) TdesContext;\r
-\r
- while (InputSize > 0) {\r
- DES_ecb3_encrypt (\r
- (const_DES_cblock *) Input,\r
- (DES_cblock *) Output,\r
- KeySchedule,\r
- KeySchedule + 1,\r
- KeySchedule + 2,\r
- DES_ENCRYPT\r
- );\r
- Input += TDES_BLOCK_SIZE;\r
- Output += TDES_BLOCK_SIZE;\r
- InputSize -= TDES_BLOCK_SIZE;\r
- }\r
-\r
- return TRUE;\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be decrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- DES_key_schedule *KeySchedule;\r
-\r
- //\r
- // Check input parameters.\r
- //\r
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0 || Output == NULL) {\r
- return FALSE;\r
- }\r
-\r
- KeySchedule = (DES_key_schedule *) TdesContext;\r
-\r
- while (InputSize > 0) {\r
- DES_ecb3_encrypt (\r
- (const_DES_cblock *) Input,\r
- (DES_cblock *) Output,\r
- KeySchedule,\r
- KeySchedule + 1,\r
- KeySchedule + 2,\r
- DES_DECRYPT\r
- );\r
- Input += TDES_BLOCK_SIZE;\r
- Output += TDES_BLOCK_SIZE;\r
- InputSize -= TDES_BLOCK_SIZE;\r
- }\r
-\r
- return TRUE;\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- DES_key_schedule *KeySchedule;\r
- UINT8 IvecBuffer[TDES_BLOCK_SIZE];\r
-\r
- //\r
- // Check input parameters.\r
- //\r
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0) {\r
- return FALSE;\r
- }\r
-\r
- if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {\r
- return FALSE;\r
- }\r
-\r
- KeySchedule = (DES_key_schedule *) TdesContext;\r
- CopyMem (IvecBuffer, Ivec, TDES_BLOCK_SIZE);\r
-\r
- DES_ede3_cbc_encrypt (\r
- Input,\r
- Output,\r
- (UINT32) InputSize,\r
- KeySchedule,\r
- KeySchedule + 1,\r
- KeySchedule + 2,\r
- (DES_cblock *) IvecBuffer,\r
- DES_ENCRYPT\r
- );\r
-\r
- return TRUE;\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- DES_key_schedule *KeySchedule;\r
- UINT8 IvecBuffer[TDES_BLOCK_SIZE];\r
-\r
- //\r
- // Check input parameters.\r
- //\r
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0) {\r
- return FALSE;\r
- }\r
-\r
- if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {\r
- return FALSE;\r
- }\r
-\r
- KeySchedule = (DES_key_schedule *) TdesContext;\r
- CopyMem (IvecBuffer, Ivec, TDES_BLOCK_SIZE);\r
-\r
- DES_ede3_cbc_encrypt (\r
- Input,\r
- Output,\r
- (UINT32) InputSize,\r
- KeySchedule,\r
- KeySchedule + 1,\r
- KeySchedule + 2,\r
- (DES_cblock *) IvecBuffer,\r
- DES_DECRYPT\r
- );\r
-\r
- return TRUE;\r
-}\r
-\r
+++ /dev/null
-/** @file\r
- TDES Wrapper Implementation which does not provide real capabilities.\r
-\r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "InternalCryptLib.h"\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- Return zero to indicate this interface is not supported.\r
-\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-TdesGetContextSize (\r
- VOID\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return 0;\r
-}\r
-\r
-/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[out] TdesContext Pointer to TDES context being initialized.\r
- @param[in] Key Pointer to the user-supplied TDES key.\r
- @param[in] KeyLength Length of TDES key in bits.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesInit (\r
- OUT VOID *TdesContext,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeyLength\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be decrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
# buffer overflow or integer overflow.\r
#\r
# Note:\r
-# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES functions, RSA external\r
+# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES functions, RSA external\r
# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509\r
# certificate handler functions, authenticode signature verification functions,\r
# PEM handler functions, and pseudorandom number generator functions are not\r
Hmac/CryptHmacSha256Null.c\r
Kdf/CryptHkdfNull.c\r
Cipher/CryptAesNull.c\r
- Cipher/CryptTdesNull.c\r
Pk/CryptRsaBasic.c\r
Pk/CryptRsaExtNull.c\r
Pk/CryptPkcs1OaepNull.c\r
// This external input must be validated carefully to avoid security issues such as\r
// buffer overflow or integer overflow.\r
//\r
-// Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/\r
-// TDES functions, RSA external functions, PKCS#7 SignedData sign functions,\r
+// Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES\r
+// functions, RSA external functions, PKCS#7 SignedData sign functions,\r
// Diffie-Hellman functions, X.509 certificate handler functions, authenticode\r
// signature verification functions, PEM handler functions, and pseudorandom number\r
// generator functions are not supported in this instance.\r
\r
#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for PEIM"\r
\r
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, and pseudorandom number generator functions are not supported in this instance."\r
+#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, and pseudorandom number generator functions are not supported in this instance."\r
\r
/** @file\r
PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation over OpenSSL.\r
\r
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
//\r
// Add possible block-cipher descriptor for PEM data decryption.\r
- // NOTE: Only support most popular ciphers (3DES, AES) for the encrypted PEM.\r
+ // NOTE: Only support most popular ciphers AES for the encrypted PEM.\r
//\r
- if (EVP_add_cipher (EVP_des_ede3_cbc ()) == 0) {\r
- return FALSE;\r
- }\r
if (EVP_add_cipher (EVP_aes_128_cbc ()) == 0) {\r
return FALSE;\r
}\r
# buffer overflow or integer overflow.\r
#\r
# Note: SHA-384 Digest functions, SHA-512 Digest functions,\r
-# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES functions, RSA external\r
+# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES functions, RSA external\r
# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and\r
# authenticode signature verification functions are not supported in this instance.\r
#\r
Hmac/CryptHmacSha256Null.c\r
Kdf/CryptHkdfNull.c\r
Cipher/CryptAesNull.c\r
- Cipher/CryptTdesNull.c\r
Pk/CryptRsaBasic.c\r
Pk/CryptRsaExtNull.c\r
Pk/CryptPkcs1OaepNull.c\r
// This external input must be validated carefully to avoid security issues such as\r
// buffer overflow or integer overflow.\r
//\r
-// Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/\r
-// TDES functions, RSA external functions, PKCS#7 SignedData sign functions,\r
+// Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES\r
+// functions, RSA external functions, PKCS#7 SignedData sign functions,\r
// Diffie-Hellman functions, and authenticode signature verification functions are\r
// not supported in this instance.\r
//\r
\r
#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for DXE_RUNTIME_DRIVER"\r
\r
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."\r
+#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."\r
\r
# buffer overflow or integer overflow.\r
#\r
# Note: SHA-384 Digest functions, SHA-512 Digest functions,\r
-# HMAC-MD5 functions, HMAC-SHA1 functions, TDES functions, RSA external\r
+# HMAC-MD5 functions, HMAC-SHA1 functions, RSA external\r
# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and\r
# authenticode signature verification functions are not supported in this instance.\r
#\r
Hmac/CryptHmacSha256.c\r
Kdf/CryptHkdfNull.c\r
Cipher/CryptAes.c\r
- Cipher/CryptTdesNull.c\r
Pk/CryptRsaBasic.c\r
Pk/CryptRsaExtNull.c\r
Pk/CryptPkcs1Oaep.c\r
// This external input must be validated carefully to avoid security issues such as\r
// buffer overflow or integer overflow.\r
//\r
-// Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/\r
-// TDES functions, RSA external functions, PKCS#7 SignedData sign functions,\r
+// Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES\r
+// functions, RSA external functions, PKCS#7 SignedData sign functions,\r
// Diffie-Hellman functions, and authenticode signature verification functions are\r
// not supported in this instance.\r
//\r
\r
#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for SMM driver"\r
\r
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."\r
+#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."\r
\r
Hmac/CryptHmacSha256Null.c\r
Kdf/CryptHkdfNull.c\r
Cipher/CryptAesNull.c\r
- Cipher/CryptTdesNull.c\r
Pk/CryptRsaBasicNull.c\r
Pk/CryptRsaExtNull.c\r
Pk/CryptPkcs1OaepNull.c\r
+++ /dev/null
-/** @file\r
- TDES Wrapper Implementation which does not provide real capabilities.\r
-\r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "InternalCryptLib.h"\r
-\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- Return zero to indicate this interface is not supported.\r
-\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-TdesGetContextSize (\r
- VOID\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return 0;\r
-}\r
-\r
-/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[out] TdesContext Pointer to TDES context being initialized.\r
- @param[in] Key Pointer to the user-supplied TDES key.\r
- @param[in] KeyLength Length of TDES key in bits.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesInit (\r
- OUT VOID *TdesContext,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeyLength\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be decrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- Return FALSE to indicate this interface is not supported.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- ASSERT (FALSE);\r
- return FALSE;\r
-}\r
-\r
// Symmetric Cryptography Primitive\r
//=====================================================================================\r
\r
-/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- If this interface is not supported, then return zero.\r
-\r
- @return The size, in bytes, of the context buffer required for TDES operations.\r
- @retval 0 This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-TdesGetContextSize (\r
- VOID\r
- )\r
-{\r
- CALL_CRYPTO_SERVICE (TdesGetContextSize, (), 0);\r
-}\r
-\r
-/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by TdesContext as TDES context.\r
- In addition, it sets up all TDES key materials for subsequent encryption and decryption\r
- operations.\r
- There are 3 key options as follows:\r
- KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)\r
- KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)\r
- KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Key is NULL, then return FALSE.\r
- If KeyLength is not valid, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[out] TdesContext Pointer to TDES context being initialized.\r
- @param[in] Key Pointer to the user-supplied TDES key.\r
- @param[in] KeyLength Length of TDES key in bits.\r
-\r
- @retval TRUE TDES context initialization succeeded.\r
- @retval FALSE TDES context initialization failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesInit (\r
- OUT VOID *TdesContext,\r
- IN CONST UINT8 *Key,\r
- IN UINTN KeyLength\r
- )\r
-{\r
- CALL_CRYPTO_SERVICE (TdesInit, (TdesContext, Key, KeyLength), FALSE);\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- CALL_CRYPTO_SERVICE (TdesEcbEncrypt, (TdesContext, Input, InputSize, Output), FALSE);\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be decrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesEcbDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- CALL_CRYPTO_SERVICE (TdesEcbDecrypt, (TdesContext, Input, InputSize, Output), FALSE);\r
-}\r
-\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcEncrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- CALL_CRYPTO_SERVICE (TdesCbcEncrypt, (TdesContext, Input, InputSize, Ivec, Output), FALSE);\r
-}\r
-\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-TdesCbcDecrypt (\r
- IN VOID *TdesContext,\r
- IN CONST UINT8 *Input,\r
- IN UINTN InputSize,\r
- IN CONST UINT8 *Ivec,\r
- OUT UINT8 *Output\r
- )\r
-{\r
- CALL_CRYPTO_SERVICE (TdesCbcDecrypt, (TdesContext, Input, InputSize, Ivec, Output), FALSE);\r
-}\r
-\r
/**\r
Retrieves the size, in bytes, of the context buffer required for AES operations.\r
\r
//=====================================================================================\r
\r
/**\r
- Retrieves the size, in bytes, of the context buffer required for TDES operations.\r
-\r
- If this interface is not supported, then return zero.\r
-\r
- @return The size, in bytes, of the context buffer required for TDES operations.\r
- @retval 0 This interface is not supported.\r
+ TDES is deprecated and unsupported any longer.\r
+ Keep the function field for binary compability.\r
\r
**/\r
typedef\r
UINTN\r
-(EFIAPI *EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE) (\r
VOID\r
);\r
\r
-/**\r
- Initializes user-supplied memory as TDES context for subsequent use.\r
-\r
- This function initializes user-supplied memory pointed by TdesContext as TDES context.\r
- In addition, it sets up all TDES key materials for subsequent encryption and decryption\r
- operations.\r
- There are 3 key options as follows:\r
- KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)\r
- KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)\r
- KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Key is NULL, then return FALSE.\r
- If KeyLength is not valid, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[out] TdesContext Pointer to TDES context being initialized.\r
- @param[in] Key Pointer to the user-supplied TDES key.\r
- @param[in] KeyLength Length of TDES key in bits.\r
-\r
- @retval TRUE TDES context initialization succeeded.\r
- @retval FALSE TDES context initialization failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
typedef\r
BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_INIT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_INIT) (\r
OUT VOID *TdesContext,\r
IN CONST UINT8 *Key,\r
IN UINTN KeyLength\r
);\r
\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
typedef\r
BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_ECB_ENCRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_ECB_ENCRYPT) (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
);\r
\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in ECB mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in ECB mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be decrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
typedef\r
BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_ECB_DECRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_ECB_DECRYPT) (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
);\r
\r
-/**\r
- Performs TDES encryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES encryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES encryption succeeded.\r
- @retval FALSE TDES encryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
typedef\r
BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_CBC_ENCRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_CBC_ENCRYPT) (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
OUT UINT8 *Output\r
);\r
\r
-/**\r
- Performs TDES decryption on a data buffer of the specified size in CBC mode.\r
-\r
- This function performs TDES decryption on data buffer pointed by Input, of specified\r
- size of InputSize, in CBC mode.\r
- InputSize must be multiple of block size (8 bytes). This function does not perform\r
- padding. Caller must perform padding, if necessary, to ensure valid input data size.\r
- Initialization vector should be one block size (8 bytes).\r
- TdesContext should be already correctly initialized by TdesInit(). Behavior with\r
- invalid TDES context is undefined.\r
-\r
- If TdesContext is NULL, then return FALSE.\r
- If Input is NULL, then return FALSE.\r
- If InputSize is not multiple of block size (8 bytes), then return FALSE.\r
- If Ivec is NULL, then return FALSE.\r
- If Output is NULL, then return FALSE.\r
- If this interface is not supported, then return FALSE.\r
-\r
- @param[in] TdesContext Pointer to the TDES context.\r
- @param[in] Input Pointer to the buffer containing the data to be encrypted.\r
- @param[in] InputSize Size of the Input buffer in bytes.\r
- @param[in] Ivec Pointer to initialization vector.\r
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.\r
-\r
- @retval TRUE TDES decryption succeeded.\r
- @retval FALSE TDES decryption failed.\r
- @retval FALSE This interface is not supported.\r
-\r
-**/\r
typedef\r
BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_TDES_CBC_DECRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_TDES_CBC_DECRYPT) (\r
IN VOID *TdesContext,\r
IN CONST UINT8 *Input,\r
IN UINTN InputSize,\r
EDKII_CRYPTO_X509_FREE X509Free;\r
EDKII_CRYPTO_X509_STACK_FREE X509StackFree;\r
EDKII_CRYPTO_X509_GET_TBS_CERT X509GetTBSCert;\r
- /// TDES\r
- EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE TdesGetContextSize;\r
- EDKII_CRYPTO_TDES_INIT TdesInit;\r
- EDKII_CRYPTO_TDES_ECB_ENCRYPT TdesEcbEncrypt;\r
- EDKII_CRYPTO_TDES_ECB_DECRYPT TdesEcbDecrypt;\r
- EDKII_CRYPTO_TDES_CBC_ENCRYPT TdesCbcEncrypt;\r
- EDKII_CRYPTO_TDES_CBC_DECRYPT TdesCbcDecrypt;\r
+ /// TDES - deprecated and unsupported\r
+ DEPRECATED_EDKII_CRYPTO_TDES_GET_CONTEXT_SIZE DeprecatedTdesGetContextSize;\r
+ DEPRECATED_EDKII_CRYPTO_TDES_INIT DeprecatedTdesInit;\r
+ DEPRECATED_EDKII_CRYPTO_TDES_ECB_ENCRYPT DeprecatedTdesEcbEncrypt;\r
+ DEPRECATED_EDKII_CRYPTO_TDES_ECB_DECRYPT DeprecatedTdesEcbDecrypt;\r
+ DEPRECATED_EDKII_CRYPTO_TDES_CBC_ENCRYPT DeprecatedTdesCbcEncrypt;\r
+ DEPRECATED_EDKII_CRYPTO_TDES_CBC_DECRYPT DeprecatedTdesCbcDecrypt;\r
/// AES\r
EDKII_CRYPTO_AES_GET_CONTEXT_SIZE AesGetContextSize;\r
EDKII_CRYPTO_AES_INIT AesInit;\r