REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1898

Add a internal worker function to indicate the deprecated functions.
It would print out debug messages and asserts ot inform the consumer
they are using a deprecated function.

Cc: Jian J Wang <jian.j.w...@intel.com>
Cc: Xiaoyu Lu <xiaoyux...@intel.com>
Cc: Siyuan Fu <siyuan...@intel.com>
Cc: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Signed-off-by: Zhichao Gao <zhichao....@intel.com>
---
 CryptoPkg/Driver/Crypto.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
index 35bf2d3d92..05ad4b5d55 100644
--- a/CryptoPkg/Driver/Crypto.c
+++ b/CryptoPkg/Driver/Crypto.c
@@ -86,6 +86,24 @@ BaseCryptLibServciceNotEnabled (
   ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
 }
 
+/**
+  Internal worker function that prints a debug message and asserts if a call is
+  made to a BaseCryptLib function that is deprecated and unsupported any 
longer.
+
+  @param[in]  FunctionName  Null-terminated ASCII string that is the name of an
+                            EDK II Crypto service.
+
+**/
+static
+VOID
+BaseCryptLibServciceDeprecated (
+  IN CONST CHAR8  *FunctionName
+  )
+{
+  DEBUG ((DEBUG_ERROR, "[%a] Function %a() is deprecated and unsupported any 
longer\n", gEfiCallerBaseName, FunctionName));
+  ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
+}
+
 /**
   Returns the version of the EDK II Crypto Protocol.
 
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58757): https://edk2.groups.io/g/devel/message/58757
Mute This Topic: https://groups.io/mt/74041186/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to