From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web11.3159.1600131479614931624 for ; Mon, 14 Sep 2020 17:58:00 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: christopher.j.zurcher@intel.com) IronPort-SDR: XwDcBSW8R/ogyCRUzIlR0JMe4bQGCGn+MuANfSIpk4797GS27T9K9rsTyhmq1YFf7br1+vvBhn KhoRmQ66MuQA== X-IronPort-AV: E=McAfee;i="6000,8403,9744"; a="220738219" X-IronPort-AV: E=Sophos;i="5.76,427,1592895600"; d="scan'208";a="220738219" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 17:57:58 -0700 IronPort-SDR: a6W2SiEzYIYp33rRbcs7QqbThzIcBF5wlBF+CyHsIfhBa7pqYFSgJc5PcucnJNmHQVUxlmzO0E gz20bQu0szsw== X-IronPort-AV: E=Sophos;i="5.76,427,1592895600"; d="scan'208";a="301949615" Received: from cjzurch-desk.amr.corp.intel.com ([10.9.70.181]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 17:57:58 -0700 From: "Zurcher, Christopher J" To: devel@edk2.groups.io Cc: Laszlo Ersek , Jiewen Yao , Jian J Wang , Xiaoyu Lu Subject: [PATCH v2 0/3] CryptoPkg/BaseCryptLib: Add EVP (Envelope) Digest interface Date: Mon, 14 Sep 2020 17:57:46 -0700 Message-Id: <20200915005749.5331-1-christopher.j.zurcher@intel.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2545 V2 changes: Added NullLib implementation Added Crypto Service implementation Rebased Hash2DxeCrypto to use EVP interface instead of low-level functions Removed unnecessary casts Added "HashAll" utility function Merged "New" and "Init" functions as well as "Final" and "Free" functions Retained "Init/Update/Final" naming instead of "New/Update/Free" as this conforms with common usage Low-level interfaces to message digest (hash) functions have been deprecated in OpenSSL 3. In order to upgrade to OpenSSL 3, all direct calls to low-level functions (such as SHA256_Init() in CryptSha256.c) will need to be replaced by EVP inteface calls. References: https://www.openssl.org/docs/manmaster/man7/evp.html https://www.openssl.org/docs/manmaster/man3/SHA256_Init.html Cc: Laszlo Ersek Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Christopher J Zurcher (3): CryptoPkg/BaseCryptLib: Add EVP (Envelope) Digest interface CryptoPkg: Add EVP to Crypto Service driver interface SecurityPkg/Hash2DxeCrypto: Rebase Hash2DxeCrypto onto the EVP interface CryptoPkg/CryptoPkg.dsc | 3 + CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 + CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 1 + CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 1 + CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 1 + CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf | 1 + CryptoPkg/Include/Library/BaseCryptLib.h | 125 +++++++ CryptoPkg/Include/Pcd/PcdCryptoServiceFamilyEnable.h | 10 + CryptoPkg/Private/Protocol/Crypto.h | 127 +++++++ SecurityPkg/Hash2DxeCrypto/Driver.h | 1 - CryptoPkg/Driver/Crypto.c | 148 ++++++++- CryptoPkg/Library/BaseCryptLib/Evp/CryptEvpMd.c | 253 ++++++++++++++ CryptoPkg/Library/BaseCryptLib/Evp/CryptEvpMdNull.c | 124 +++++++ CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 140 ++++++++ SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.c | 345 ++------------------ 15 files changed, 965 insertions(+), 316 deletions(-) create mode 100644 CryptoPkg/Library/BaseCryptLib/Evp/CryptEvpMd.c create mode 100644 CryptoPkg/Library/BaseCryptLib/Evp/CryptEvpMdNull.c -- 2.28.0.windows.1