]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg/BaseCryptLib: Retire ARC4 algorithm
authorZhichao Gao <zhichao.gao@intel.com>
Wed, 22 Apr 2020 09:44:12 +0000 (17:44 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 15 May 2020 07:22:36 +0000 (07:22 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1898

ARC4 is not secure any longer.
Remove the ARC4 support from edk2.
Change the ARC4 field name in EDKII_CRYPTO_PROTOCOL to indicate the
function is unsupported any longer.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
15 files changed:
CryptoPkg/Driver/Crypto.c
CryptoPkg/Include/Library/BaseCryptLib.h
CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c [deleted file]
CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c [deleted file]
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
CryptoPkg/Library/BaseCryptLib/PeiCryptLib.uni
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.uni
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.uni
CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
CryptoPkg/Library/BaseCryptLibNull/Cipher/CryptArc4Null.c [deleted file]
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c
CryptoPkg/Private/Protocol/Crypto.h

index 53ee0edea5c4ab8fc70d915446bf267649d6e482..af6148291949d0d1b6094cd2e402a4190a7e1bf0 100644 (file)
@@ -2037,150 +2037,107 @@ CryptoServiceAesCbcDecrypt (
 }\r
 \r
 /**\r
-  Retrieves the size, in bytes, of the context buffer required for ARC4 operations.\r
-\r
-  If this interface is not supported, then return zero.\r
+  ARC4 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 ARC4 operations.\r
   @retval  0   This interface is not supported.\r
 \r
 **/\r
 UINTN\r
 EFIAPI\r
-CryptoServiceArc4GetContextSize (\r
+DeprecatedCryptoServiceArc4GetContextSize (\r
   VOID\r
   )\r
 {\r
-  return CALL_BASECRYPTLIB (Arc4.Services.GetContextSize, Arc4GetContextSize, (), 0);\r
+  return BaseCryptLibServiceDeprecated ("Arc4GetContextSize"), 0;\r
 }\r
 \r
 /**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.\r
-  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption\r
-  operations.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Key is NULL, then return FALSE.\r
-  If KeySize does not in the range of [5, 256] bytes, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
+  ARC4 is deprecated and unsupported any longer.\r
+  Keep the function field for binary compability.\r
 \r
   @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
   @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
   @param[in]   KeySize      Size of ARC4 key in bytes.\r
 \r
-  @retval TRUE   ARC4 context initialization succeeded.\r
-  @retval FALSE  ARC4 context initialization failed.\r
   @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
-CryptoServiceArc4Init (\r
+DeprecatedCryptoServiceArc4Init (\r
   OUT  VOID         *Arc4Context,\r
   IN   CONST UINT8  *Key,\r
   IN   UINTN        KeySize\r
   )\r
 {\r
-  return CALL_BASECRYPTLIB (Arc4.Services.Init, Arc4Init, (Arc4Context, Key, KeySize), FALSE);\r
+  return BaseCryptLibServiceDeprecated ("Arc4Init"), FALSE;\r
 }\r
 \r
 /**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 encryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
+  ARC4 is deprecated and unsupported any longer.\r
+  Keep the function field for binary compability.\r
 \r
   @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
 \r
-  @retval TRUE   ARC4 encryption succeeded.\r
-  @retval FALSE  ARC4 encryption failed.\r
   @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
-CryptoServiceArc4Encrypt (\r
+DeprecatedCryptoServiceArc4Encrypt (\r
   IN OUT  VOID         *Arc4Context,\r
   IN      CONST UINT8  *Input,\r
   IN      UINTN        InputSize,\r
   OUT     UINT8        *Output\r
   )\r
 {\r
-  return CALL_BASECRYPTLIB (Arc4.Services.Encrypt, Arc4Encrypt, (Arc4Context, Input, InputSize, Output), FALSE);\r
+  return BaseCryptLibServiceDeprecated ("Arc4Encrypt"), FALSE;\r
 }\r
 \r
 /**\r
-  Performs ARC4 decryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 decryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
+  ARC4 is deprecated and unsupported any longer.\r
+  Keep the function field for binary compability.\r
 \r
   @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
 \r
-  @retval TRUE   ARC4 decryption succeeded.\r
-  @retval FALSE  ARC4 decryption failed.\r
   @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
-CryptoServiceArc4Decrypt (\r
+DeprecatedCryptoServiceArc4Decrypt (\r
   IN OUT  VOID   *Arc4Context,\r
   IN      UINT8  *Input,\r
   IN      UINTN  InputSize,\r
   OUT     UINT8  *Output\r
   )\r
 {\r
-  return CALL_BASECRYPTLIB (Arc4.Services.Decrypt, Arc4Decrypt, (Arc4Context, Input, InputSize, Output), FALSE);\r
+  return BaseCryptLibServiceDeprecated ("Arc4Decrypt"), FALSE;\r
 }\r
 \r
 /**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  The function resets the ARC4 context to the state it had immediately after the\r
-  ARC4Init() function call.\r
-  Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context\r
-  should be already correctly initialized by ARC4Init().\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
+  ARC4 is deprecated and unsupported any longer.\r
+  Keep the function field for binary compability.\r
 \r
   @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
 \r
-  @retval TRUE   ARC4 reset succeeded.\r
-  @retval FALSE  ARC4 reset failed.\r
   @retval FALSE  This interface is not supported.\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
-CryptoServiceArc4Reset (\r
+DeprecatedCryptoServiceArc4Reset (\r
   IN OUT  VOID  *Arc4Context\r
   )\r
 {\r
-  return CALL_BASECRYPTLIB (Arc4.Services.Reset, Arc4Reset, (Arc4Context), FALSE);\r
+  return BaseCryptLibServiceDeprecated ("Arc4Reset"), FALSE;\r
 }\r
 \r
 //=====================================================================================\r
@@ -4502,12 +4459,12 @@ const EDKII_CRYPTO_PROTOCOL mEdkiiCrypto = {
   CryptoServiceAesEcbDecrypt,\r
   CryptoServiceAesCbcEncrypt,\r
   CryptoServiceAesCbcDecrypt,\r
-  /// Arc4\r
-  CryptoServiceArc4GetContextSize,\r
-  CryptoServiceArc4Init,\r
-  CryptoServiceArc4Encrypt,\r
-  CryptoServiceArc4Decrypt,\r
-  CryptoServiceArc4Reset,\r
+  /// Arc4 - deprecated and unsupported\r
+  DeprecatedCryptoServiceArc4GetContextSize,\r
+  DeprecatedCryptoServiceArc4Init,\r
+  DeprecatedCryptoServiceArc4Encrypt,\r
+  DeprecatedCryptoServiceArc4Decrypt,\r
+  DeprecatedCryptoServiceArc4Reset,\r
   /// SM3\r
   CryptoServiceSm3GetContextSize,\r
   CryptoServiceSm3Init,\r
index c862f0334fe6ae9efb78589a71a593fedf1702ae..25e236c4a30f63c990b8de006279190991d12f54 100644 (file)
@@ -1667,138 +1667,6 @@ AesCbcDecrypt (
   OUT  UINT8        *Output\r
   );\r
 \r
-/**\r
-  Retrieves the size, in bytes, of the context buffer required for ARC4 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 ARC4 operations.\r
-  @retval  0   This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Arc4GetContextSize (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.\r
-  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption\r
-  operations.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Key is NULL, then return FALSE.\r
-  If KeySize does not in the range of [5, 256] bytes, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
-  @param[in]   KeySize      Size of ARC4 key in bytes.\r
-\r
-  @retval TRUE   ARC4 context initialization succeeded.\r
-  @retval FALSE  ARC4 context initialization failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Init (\r
-  OUT  VOID         *Arc4Context,\r
-  IN   CONST UINT8  *Key,\r
-  IN   UINTN        KeySize\r
-  );\r
-\r
-/**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 encryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input 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, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
-  @retval TRUE   ARC4 encryption succeeded.\r
-  @retval FALSE  ARC4 encryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Encrypt (\r
-  IN OUT  VOID         *Arc4Context,\r
-  IN      CONST UINT8  *Input,\r
-  IN      UINTN        InputSize,\r
-  OUT     UINT8        *Output\r
-  );\r
-\r
-/**\r
-  Performs ARC4 decryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 decryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input 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, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
-  @retval TRUE   ARC4 decryption succeeded.\r
-  @retval FALSE  ARC4 decryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Decrypt (\r
-  IN OUT  VOID   *Arc4Context,\r
-  IN      UINT8  *Input,\r
-  IN      UINTN  InputSize,\r
-  OUT     UINT8  *Output\r
-  );\r
-\r
-/**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  The function resets the ARC4 context to the state it had immediately after the\r
-  ARC4Init() function call.\r
-  Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context\r
-  should be already correctly initialized by ARC4Init().\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
-\r
-  @retval TRUE   ARC4 reset succeeded.\r
-  @retval FALSE  ARC4 reset failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Reset (\r
-  IN OUT  VOID  *Arc4Context\r
-  );\r
-\r
 //=====================================================================================\r
 //    Asymmetric Cryptography Primitive\r
 //=====================================================================================\r
index 22992e7d43a577a094334bfaeeb2b352cb39dc4a..da38ea552ff63498356156c8ba27641a200ab308 100644 (file)
@@ -40,7 +40,6 @@
   Kdf/CryptHkdf.c\r
   Cipher/CryptAes.c\r
   Cipher/CryptTdes.c\r
-  Cipher/CryptArc4.c\r
   Pk/CryptRsaBasic.c\r
   Pk/CryptRsaExt.c\r
   Pk/CryptPkcs1Oaep.c\r
diff --git a/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c b/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c
deleted file mode 100644 (file)
index 388d312..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/** @file\r
-  ARC4 Wrapper Implementation over OpenSSL.\r
-\r
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "InternalCryptLib.h"\r
-#include <openssl/rc4.h>\r
-\r
-/**\r
-  Retrieves the size, in bytes, of the context buffer required for ARC4 operations.\r
-\r
-  @return  The size, in bytes, of the context buffer required for ARC4 operations.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Arc4GetContextSize (\r
-  VOID\r
-  )\r
-{\r
-  //\r
-  // Memory for 2 copies of RC4_KEY is allocated, one for working copy, and the other\r
-  // for backup copy. When Arc4Reset() is called, we can use the backup copy to restore\r
-  // the working copy to the initial state.\r
-  //\r
-  return (UINTN) (2 * sizeof (RC4_KEY));\r
-}\r
-\r
-/**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.\r
-  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption\r
-  operations.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Key is NULL, then return FALSE.\r
-  If KeySize does not in the range of [5, 256] bytes, then return FALSE.\r
-\r
-  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
-  @param[in]   KeySize      Size of ARC4 key in bytes.\r
-\r
-  @retval TRUE   ARC4 context initialization succeeded.\r
-  @retval FALSE  ARC4 context initialization failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Init (\r
-  OUT  VOID         *Arc4Context,\r
-  IN   CONST UINT8  *Key,\r
-  IN   UINTN        KeySize\r
-  )\r
-{\r
-  RC4_KEY  *Rc4Key;\r
-\r
-  //\r
-  // Check input parameters.\r
-  //\r
-  if (Arc4Context == NULL || Key == NULL || (KeySize < 5 || KeySize > 256)) {\r
-    return FALSE;\r
-  }\r
-\r
-  Rc4Key = (RC4_KEY *) Arc4Context;\r
-\r
-  RC4_set_key (Rc4Key, (UINT32) KeySize, Key);\r
-\r
-  CopyMem (Rc4Key +  1, Rc4Key, sizeof (RC4_KEY));\r
-\r
-  return TRUE;\r
-}\r
-\r
-/**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 encryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
-  @retval TRUE   ARC4 encryption succeeded.\r
-  @retval FALSE  ARC4 encryption failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Encrypt (\r
-  IN OUT  VOID         *Arc4Context,\r
-  IN      CONST UINT8  *Input,\r
-  IN      UINTN        InputSize,\r
-  OUT     UINT8        *Output\r
-  )\r
-{\r
-  RC4_KEY  *Rc4Key;\r
-\r
-  //\r
-  // Check input parameters.\r
-  //\r
-  if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {\r
-    return FALSE;\r
-  }\r
-\r
-  Rc4Key = (RC4_KEY *) Arc4Context;\r
-\r
-  RC4 (Rc4Key, (UINT32) InputSize, Input, Output);\r
-\r
-  return TRUE;\r
-}\r
-\r
-/**\r
-  Performs ARC4 decryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 decryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input is NULL, then return FALSE.\r
-  If Output is NULL, then return FALSE.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
-  @retval TRUE   ARC4 decryption succeeded.\r
-  @retval FALSE  ARC4 decryption failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Decrypt (\r
-  IN OUT  VOID   *Arc4Context,\r
-  IN      UINT8  *Input,\r
-  IN      UINTN  InputSize,\r
-  OUT     UINT8  *Output\r
-  )\r
-{\r
-  RC4_KEY  *Rc4Key;\r
-\r
-  //\r
-  // Check input parameters.\r
-  //\r
-  if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {\r
-    return FALSE;\r
-  }\r
-\r
-  Rc4Key = (RC4_KEY *) Arc4Context;\r
-\r
-  RC4 (Rc4Key, (UINT32) InputSize, Input, Output);\r
-\r
-  return TRUE;\r
-}\r
-\r
-/**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  The function resets the ARC4 context to the state it had immediately after the\r
-  ARC4Init() function call.\r
-  Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context\r
-  should be already correctly initialized by ARC4Init().\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
-\r
-  @retval TRUE   ARC4 reset succeeded.\r
-  @retval FALSE  ARC4 reset failed.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Reset (\r
-  IN OUT  VOID  *Arc4Context\r
-  )\r
-{\r
-  RC4_KEY  *Rc4Key;\r
-\r
-  //\r
-  // Check input parameters.\r
-  //\r
-  if (Arc4Context == NULL) {\r
-    return FALSE;\r
-  }\r
-\r
-  Rc4Key = (RC4_KEY *) Arc4Context;\r
-\r
-  CopyMem (Rc4Key, Rc4Key + 1, sizeof (RC4_KEY));\r
-\r
-  return TRUE;\r
-}\r
diff --git a/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c b/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c
deleted file mode 100644 (file)
index 1f09bfa..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/** @file\r
-  ARC4 Wrapper Implementation which does not provide real capabilities.\r
-\r
-Copyright (c) 2012 - 2018, 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 ARC4 operations.\r
-\r
-  Return zero to indicate this interface is not supported.\r
-\r
-  @retval  0   This interface is not supported.\r
-\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Arc4GetContextSize (\r
-  VOID\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return 0;\r
-}\r
-\r
-/**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
-  @param[in]   KeySize      Size of ARC4 key in bytes.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Init (\r
-  OUT  VOID         *Arc4Context,\r
-  IN   CONST UINT8  *Key,\r
-  IN   UINTN        KeySize\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return FALSE;\r
-}\r
-\r
-/**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Encrypt (\r
-  IN OUT  VOID         *Arc4Context,\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 ARC4 decryption on a data buffer of the specified size.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Decrypt (\r
-  IN OUT  VOID   *Arc4Context,\r
-  IN      UINT8  *Input,\r
-  IN      UINTN  InputSize,\r
-  OUT     UINT8  *Output\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return FALSE;\r
-}\r
-\r
-/**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Reset (\r
-  IN OUT  VOID  *Arc4Context\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return FALSE;\r
-}\r
index e9add0127d5cc47ce222d4eab287635ed4f2ef2c..f43953b78c1d97f215e30e7bb70fd250e14a5eca 100644 (file)
@@ -7,7 +7,7 @@
 #  buffer overflow or integer overflow.\r
 #\r
 #  Note:\r
-#  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external\r
+#  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES 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
@@ -46,7 +46,6 @@
   Kdf/CryptHkdfNull.c\r
   Cipher/CryptAesNull.c\r
   Cipher/CryptTdesNull.c\r
-  Cipher/CryptArc4Null.c\r
   Pk/CryptRsaBasic.c\r
   Pk/CryptRsaExtNull.c\r
   Pk/CryptPkcs1OaepNull.c\r
index 374bfb3f65d7451430f31d0645f615362eec94b5..5abd8e8dfb48d2d03c652c1b675e4ebd6fc74a22 100644 (file)
@@ -7,7 +7,7 @@
 // buffer overflow or integer overflow.\r
 //\r
 // Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/\r
-// TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,\r
+// TDES 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
@@ -21,5 +21,5 @@
 \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/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, and pseudorandom number generator functions are not supported in this instance."\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
 \r
index 0a2eb0323272b18971eb54bdf57aa53de42f2bbd..f1eb099b6721f72f07b9a340233a2d706e326700 100644 (file)
@@ -7,7 +7,7 @@
 #  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/ARC4 functions, RSA external\r
+#  HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES 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
@@ -46,7 +46,6 @@
   Kdf/CryptHkdfNull.c\r
   Cipher/CryptAesNull.c\r
   Cipher/CryptTdesNull.c\r
-  Cipher/CryptArc4Null.c\r
   Pk/CryptRsaBasic.c\r
   Pk/CryptRsaExtNull.c\r
   Pk/CryptPkcs1OaepNull.c\r
index b6d751176ec690964a6dcd0f877de742fb802fb8..5a48d2a308f630be9331ad9a07c8b1a19cb4d016 100644 (file)
@@ -7,7 +7,7 @@
 // buffer overflow or integer overflow.\r
 //\r
 // Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/\r
-// TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,\r
+// TDES 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
@@ -20,5 +20,5 @@
 \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/ARC4 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/ 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
 \r
index 139983075ebdc4674b1251875c71c6d2c0a5cd6b..3a9465577592ba3cec677c8cd73dab986b37392c 100644 (file)
@@ -7,7 +7,7 @@
 #  buffer overflow or integer overflow.\r
 #\r
 #  Note: SHA-384 Digest functions, SHA-512 Digest functions,\r
-#  HMAC-MD5 functions, HMAC-SHA1 functions, TDES/ARC4 functions, RSA external\r
+#  HMAC-MD5 functions, HMAC-SHA1 functions, TDES 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
@@ -45,7 +45,6 @@
   Kdf/CryptHkdfNull.c\r
   Cipher/CryptAes.c\r
   Cipher/CryptTdesNull.c\r
-  Cipher/CryptArc4Null.c\r
   Pk/CryptRsaBasic.c\r
   Pk/CryptRsaExtNull.c\r
   Pk/CryptPkcs1Oaep.c\r
index b8d7953d2b3b3c1d196acd28fef3283f7ad632e4..0561f107e88cda08ab0318972b65bcb3352b16b3 100644 (file)
@@ -7,7 +7,7 @@
 // buffer overflow or integer overflow.\r
 //\r
 // Note: HMAC-MD5 functions, HMAC-SHA1 functions, AES/\r
-// TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,\r
+// TDES 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
@@ -20,5 +20,5 @@
 \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/ARC4 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/ 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
 \r
index b03681b14626418dd2816c8df1ad72fcfb3c43e8..a205c9005d85207d1027cb217a0684f1f513a98a 100644 (file)
@@ -40,7 +40,6 @@
   Kdf/CryptHkdfNull.c\r
   Cipher/CryptAesNull.c\r
   Cipher/CryptTdesNull.c\r
-  Cipher/CryptArc4Null.c\r
   Pk/CryptRsaBasicNull.c\r
   Pk/CryptRsaExtNull.c\r
   Pk/CryptPkcs1OaepNull.c\r
diff --git a/CryptoPkg/Library/BaseCryptLibNull/Cipher/CryptArc4Null.c b/CryptoPkg/Library/BaseCryptLibNull/Cipher/CryptArc4Null.c
deleted file mode 100644 (file)
index 1f09bfa..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/** @file\r
-  ARC4 Wrapper Implementation which does not provide real capabilities.\r
-\r
-Copyright (c) 2012 - 2018, 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 ARC4 operations.\r
-\r
-  Return zero to indicate this interface is not supported.\r
-\r
-  @retval  0   This interface is not supported.\r
-\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Arc4GetContextSize (\r
-  VOID\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return 0;\r
-}\r
-\r
-/**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
-  @param[in]   KeySize      Size of ARC4 key in bytes.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Init (\r
-  OUT  VOID         *Arc4Context,\r
-  IN   CONST UINT8  *Key,\r
-  IN   UINTN        KeySize\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return FALSE;\r
-}\r
-\r
-/**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Encrypt (\r
-  IN OUT  VOID         *Arc4Context,\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 ARC4 decryption on a data buffer of the specified size.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Decrypt (\r
-  IN OUT  VOID   *Arc4Context,\r
-  IN      UINT8  *Input,\r
-  IN      UINTN  InputSize,\r
-  OUT     UINT8  *Output\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return FALSE;\r
-}\r
-\r
-/**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  Return FALSE to indicate this interface is not supported.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
-\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Reset (\r
-  IN OUT  VOID  *Arc4Context\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return FALSE;\r
-}\r
index 5e470028f47d418063964ac3f98b7a4a88133686..77915bdb864833e1e6c2ed4e486773ec782dccf1 100644 (file)
@@ -1892,153 +1892,6 @@ AesCbcDecrypt (
   CALL_CRYPTO_SERVICE (AesCbcDecrypt, (AesContext, Input, InputSize, Ivec, Output), FALSE);\r
 }\r
 \r
-/**\r
-  Retrieves the size, in bytes, of the context buffer required for ARC4 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 ARC4 operations.\r
-  @retval  0   This interface is not supported.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Arc4GetContextSize (\r
-  VOID\r
-  )\r
-{\r
-  CALL_CRYPTO_SERVICE (Arc4GetContextSize, (), 0);\r
-}\r
-\r
-/**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.\r
-  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption\r
-  operations.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Key is NULL, then return FALSE.\r
-  If KeySize does not in the range of [5, 256] bytes, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
-  @param[in]   KeySize      Size of ARC4 key in bytes.\r
-\r
-  @retval TRUE   ARC4 context initialization succeeded.\r
-  @retval FALSE  ARC4 context initialization failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Init (\r
-  OUT  VOID         *Arc4Context,\r
-  IN   CONST UINT8  *Key,\r
-  IN   UINTN        KeySize\r
-  )\r
-{\r
-  CALL_CRYPTO_SERVICE (Arc4Init, (Arc4Context, Key, KeySize), FALSE);\r
-}\r
-\r
-/**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 encryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input 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, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
-  @retval TRUE   ARC4 encryption succeeded.\r
-  @retval FALSE  ARC4 encryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Encrypt (\r
-  IN OUT  VOID         *Arc4Context,\r
-  IN      CONST UINT8  *Input,\r
-  IN      UINTN        InputSize,\r
-  OUT     UINT8        *Output\r
-  )\r
-{\r
-  CALL_CRYPTO_SERVICE (Arc4Encrypt, (Arc4Context, Input, InputSize, Output), FALSE);\r
-}\r
-\r
-/**\r
-  Performs ARC4 decryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 decryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input 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, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
-  @retval TRUE   ARC4 decryption succeeded.\r
-  @retval FALSE  ARC4 decryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Decrypt (\r
-  IN OUT  VOID   *Arc4Context,\r
-  IN      UINT8  *Input,\r
-  IN      UINTN  InputSize,\r
-  OUT     UINT8  *Output\r
-  )\r
-{\r
-  CALL_CRYPTO_SERVICE (Arc4Decrypt, (Arc4Context, Input, InputSize, Output), FALSE);\r
-}\r
-\r
-/**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  The function resets the ARC4 context to the state it had immediately after the\r
-  ARC4Init() function call.\r
-  Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context\r
-  should be already correctly initialized by ARC4Init().\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
-\r
-  @retval TRUE   ARC4 reset succeeded.\r
-  @retval FALSE  ARC4 reset failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-Arc4Reset (\r
-  IN OUT  VOID  *Arc4Context\r
-  )\r
-{\r
-  CALL_CRYPTO_SERVICE (Arc4Reset, (Arc4Context), FALSE);\r
-}\r
-\r
 //=====================================================================================\r
 //    Asymmetric Cryptography Primitive\r
 //=====================================================================================\r
index ae0f29695c61ec29d694af9f7caf8fc94fb14752..f36c5c1aff4dbe8a1ba84c312e03bd23bcdd82bb 100644 (file)
@@ -2785,134 +2785,45 @@ BOOLEAN
   );\r
 \r
 /**\r
-  Retrieves the size, in bytes, of the context buffer required for ARC4 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 ARC4 operations.\r
-  @retval  0   This interface is not supported.\r
+  ARC4 is deprecated and unsupported any longer.\r
+  Keep the function field for binary compability.\r
 \r
 **/\r
 typedef\r
 UINTN\r
-(EFIAPI *EDKII_CRYPTO_ARC4_GET_CONTEXT_SIZE) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_ARC4_GET_CONTEXT_SIZE) (\r
   VOID\r
   );\r
 \r
-/**\r
-  Initializes user-supplied memory as ARC4 context for subsequent use.\r
-\r
-  This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.\r
-  In addition, it sets up all ARC4 key materials for subsequent encryption and decryption\r
-  operations.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Key is NULL, then return FALSE.\r
-  If KeySize does not in the range of [5, 256] bytes, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[out]  Arc4Context  Pointer to ARC4 context being initialized.\r
-  @param[in]   Key          Pointer to the user-supplied ARC4 key.\r
-  @param[in]   KeySize      Size of ARC4 key in bytes.\r
-\r
-  @retval TRUE   ARC4 context initialization succeeded.\r
-  @retval FALSE  ARC4 context initialization failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_ARC4_INIT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_ARC4_INIT) (\r
   OUT  VOID         *Arc4Context,\r
   IN   CONST UINT8  *Key,\r
   IN   UINTN        KeySize\r
   );\r
 \r
-/**\r
-  Performs ARC4 encryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 encryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input 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, out]  Arc4Context  Pointer to the ARC4 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 ARC4 encryption output.\r
-\r
-  @retval TRUE   ARC4 encryption succeeded.\r
-  @retval FALSE  ARC4 encryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_ARC4_ENCRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_ARC4_ENCRYPT) (\r
   IN OUT  VOID         *Arc4Context,\r
   IN      CONST UINT8  *Input,\r
   IN      UINTN        InputSize,\r
   OUT     UINT8        *Output\r
   );\r
 \r
-/**\r
-  Performs ARC4 decryption on a data buffer of the specified size.\r
-\r
-  This function performs ARC4 decryption on data buffer pointed by Input, of specified\r
-  size of InputSize.\r
-  Arc4Context should be already correctly initialized by Arc4Init(). Behavior with\r
-  invalid ARC4 context is undefined.\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If Input 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, out]  Arc4Context  Pointer to the ARC4 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 ARC4 decryption output.\r
-\r
-  @retval TRUE   ARC4 decryption succeeded.\r
-  @retval FALSE  ARC4 decryption failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_ARC4_DECRYPT) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_ARC4_DECRYPT) (\r
   IN OUT  VOID   *Arc4Context,\r
   IN      UINT8  *Input,\r
   IN      UINTN  InputSize,\r
   OUT     UINT8  *Output\r
   );\r
 \r
-/**\r
-  Resets the ARC4 context to the initial state.\r
-\r
-  The function resets the ARC4 context to the state it had immediately after the\r
-  ARC4Init() function call.\r
-  Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context\r
-  should be already correctly initialized by ARC4Init().\r
-\r
-  If Arc4Context is NULL, then return FALSE.\r
-  If this interface is not supported, then return FALSE.\r
-\r
-  @param[in, out]  Arc4Context  Pointer to the ARC4 context.\r
-\r
-  @retval TRUE   ARC4 reset succeeded.\r
-  @retval FALSE  ARC4 reset failed.\r
-  @retval FALSE  This interface is not supported.\r
-\r
-**/\r
 typedef\r
 BOOLEAN\r
-(EFIAPI *EDKII_CRYPTO_ARC4_RESET) (\r
+(EFIAPI *DEPRECATED_EDKII_CRYPTO_ARC4_RESET) (\r
   IN OUT  VOID  *Arc4Context\r
   );\r
 \r
@@ -4014,12 +3925,12 @@ struct _EDKII_CRYPTO_PROTOCOL {
   EDKII_CRYPTO_AES_ECB_DECRYPT                    AesEcbDecrypt;\r
   EDKII_CRYPTO_AES_CBC_ENCRYPT                    AesCbcEncrypt;\r
   EDKII_CRYPTO_AES_CBC_DECRYPT                    AesCbcDecrypt;\r
-  /// Arc4\r
-  EDKII_CRYPTO_ARC4_GET_CONTEXT_SIZE              Arc4GetContextSize;\r
-  EDKII_CRYPTO_ARC4_INIT                          Arc4Init;\r
-  EDKII_CRYPTO_ARC4_ENCRYPT                       Arc4Encrypt;\r
-  EDKII_CRYPTO_ARC4_DECRYPT                       Arc4Decrypt;\r
-  EDKII_CRYPTO_ARC4_RESET                         Arc4Reset;\r
+  /// Arc4 - deprecated and unsupported\r
+  DEPRECATED_EDKII_CRYPTO_ARC4_GET_CONTEXT_SIZE   DeprecatedArc4GetContextSize;\r
+  DEPRECATED_EDKII_CRYPTO_ARC4_INIT               DeprecatedArc4Init;\r
+  DEPRECATED_EDKII_CRYPTO_ARC4_ENCRYPT            DeprecatedArc4Encrypt;\r
+  DEPRECATED_EDKII_CRYPTO_ARC4_DECRYPT            DeprecatedArc4Decrypt;\r
+  DEPRECATED_EDKII_CRYPTO_ARC4_RESET              DeprecatedArc4Reset;\r
   /// SM3\r
   EDKII_CRYPTO_SM3_GET_CONTEXT_SIZE               Sm3GetContextSize;\r
   EDKII_CRYPTO_SM3_INIT                           Sm3Init;\r