From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com []) by mx.groups.io with SMTP id smtpd.web10.1248.1588809475802592557 for ; Wed, 06 May 2020 16:57:56 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) IronPort-SDR: 027wh3nwwu6xdLuVO1k0EnZ6q9U4v++CQOykEMRwOmUfBusjBCThd3ILRgyjssiuIOyfhb+sFW gNUKxkr5rVtg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 16:57:56 -0700 IronPort-SDR: 6egJo4PkMDr5iaZtVZKdc2l4bDWE9j19fevv0qovH4DNfCEVPcgTW1jEwT7lyb//DkwkdREsL3 rNIEe4jbgU0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,361,1583222400"; d="scan'208";a="278413593" Received: from fieedk001.ccr.corp.intel.com ([10.239.33.114]) by orsmga002.jf.intel.com with ESMTP; 06 May 2020 16:57:54 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Xiaoyu Lu , Siyuan Fu , Michael D Kinney , Jiewen Yao Subject: [PATCH V3 1/8] CryptoPkg/CryptoDxe: Add function to indicate the deprecated algorithm Date: Thu, 7 May 2020 07:57:39 +0800 Message-Id: <20200506235746.19500-2-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200506235746.19500-1-zhichao.gao@intel.com> References: <20200506235746.19500-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Xiaoyu Lu Cc: Siyuan Fu Cc: Michael D Kinney Cc: Jiewen Yao Signed-off-by: Zhichao Gao --- 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