]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Driver/Crypto.c
CryptoPkg/CryptoDxe: Add function to indicate the deprecated algorithm
[mirror_edk2.git] / CryptoPkg / Driver / Crypto.c
index 35bf2d3d923fa4dcdaac91531f8ab7c83844764f..ed0083cccf8fd539c396a96847a83aad0df3a87b 100644 (file)
@@ -41,7 +41,7 @@
 #define CALL_BASECRYPTLIB(Enable, Function, Args, ErrorReturnValue) \\r
   EDKII_CRYPTO_PCD->Enable                                          \\r
     ? Function Args                                                 \\r
-    : (BaseCryptLibServciceNotEnabled (#Function), ErrorReturnValue)\r
+    : (BaseCryptLibServiceNotEnabled (#Function), ErrorReturnValue)\r
 \r
 /**\r
   A macro used to call a void BaseCryptLib function if it is enabled.\r
@@ -61,7 +61,7 @@
 #define CALL_VOID_BASECRYPTLIB(Enable, Function, Args)  \\r
   EDKII_CRYPTO_PCD->Enable                              \\r
     ? Function Args                                     \\r
-    : BaseCryptLibServciceNotEnabled (#Function)\r
+    : BaseCryptLibServiceNotEnabled (#Function)\r
 \r
 /**\r
   Internal worker function that prints a debug message and asserts if a call is\r
@@ -78,7 +78,7 @@
 **/\r
 static\r
 VOID\r
-BaseCryptLibServciceNotEnabled (\r
+BaseCryptLibServiceNotEnabled (\r
   IN CONST CHAR8  *FunctionName\r
   )\r
 {\r
@@ -86,6 +86,24 @@ BaseCryptLibServciceNotEnabled (
   ASSERT_EFI_ERROR (EFI_UNSUPPORTED);\r
 }\r
 \r
+/**\r
+  Internal worker function that prints a debug message and asserts if a call is\r
+  made to a BaseCryptLib function that is deprecated and unsupported any longer.\r
+\r
+  @param[in]  FunctionName  Null-terminated ASCII string that is the name of an\r
+                            EDK II Crypto service.\r
+\r
+**/\r
+static\r
+VOID\r
+BaseCryptLibServiceDeprecated (\r
+  IN CONST CHAR8  *FunctionName\r
+  )\r
+{\r
+  DEBUG ((DEBUG_ERROR, "[%a] Function %a() is deprecated and unsupported any longer\n", gEfiCallerBaseName, FunctionName));\r
+  ASSERT_EFI_ERROR (EFI_UNSUPPORTED);\r
+}\r
+\r
 /**\r
   Returns the version of the EDK II Crypto Protocol.\r
 \r