mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
CryptoPkg/CryptoDxe: Add function to indicate the deprecated algorithm
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 to inform the consumer they are using a deprecated function. Change the Name of BaseCryptLibServciceNotEnabled to correct spelling BaseCryptLibServiceNotEnabled. 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>
This commit is contained in:
parent
0f30087b9a
commit
aaa90aacaf
@ -41,7 +41,7 @@
|
|||||||
#define CALL_BASECRYPTLIB(Enable, Function, Args, ErrorReturnValue) \
|
#define CALL_BASECRYPTLIB(Enable, Function, Args, ErrorReturnValue) \
|
||||||
EDKII_CRYPTO_PCD->Enable \
|
EDKII_CRYPTO_PCD->Enable \
|
||||||
? Function Args \
|
? Function Args \
|
||||||
: (BaseCryptLibServciceNotEnabled (#Function), ErrorReturnValue)
|
: (BaseCryptLibServiceNotEnabled (#Function), ErrorReturnValue)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A macro used to call a void BaseCryptLib function if it is enabled.
|
A macro used to call a void BaseCryptLib function if it is enabled.
|
||||||
@ -61,7 +61,7 @@
|
|||||||
#define CALL_VOID_BASECRYPTLIB(Enable, Function, Args) \
|
#define CALL_VOID_BASECRYPTLIB(Enable, Function, Args) \
|
||||||
EDKII_CRYPTO_PCD->Enable \
|
EDKII_CRYPTO_PCD->Enable \
|
||||||
? Function Args \
|
? Function Args \
|
||||||
: BaseCryptLibServciceNotEnabled (#Function)
|
: BaseCryptLibServiceNotEnabled (#Function)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Internal worker function that prints a debug message and asserts if a call is
|
Internal worker function that prints a debug message and asserts if a call is
|
||||||
@ -78,7 +78,7 @@
|
|||||||
**/
|
**/
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
BaseCryptLibServciceNotEnabled (
|
BaseCryptLibServiceNotEnabled (
|
||||||
IN CONST CHAR8 *FunctionName
|
IN CONST CHAR8 *FunctionName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -86,6 +86,24 @@ BaseCryptLibServciceNotEnabled (
|
|||||||
ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
|
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
|
||||||
|
BaseCryptLibServiceDeprecated (
|
||||||
|
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.
|
Returns the version of the EDK II Crypto Protocol.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user