From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.97329.1680602084744828981 for ; Tue, 04 Apr 2023 02:54:44 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=EmK8T0Nw; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: yi1.li@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680602084; x=1712138084; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cMQkd2r9IdmhqWearHg0Kat0rSkUk3IVBkp2KZgh97A=; b=EmK8T0NwjKhMxDBfn+AGy0w8TrmMnQanPVH8zDumilqJd/1t6Ox9cPKu oKAD69SrW24aDF15VVf6IQLthCIevMxLYsR00Gl/ma8R44A5fWXf5Afvd evUlex8YrFPRIfb27uDHDOR/V5Jd4Ei+UwEnrjzjfRywzoNipp7ql/l+K BU6WYAA9/cVQboHJ+NMV8KCbNUoKM6Xm+VUibCx+WHNT9qcYitxqIpnKI AgBROFk9WUoPpzByqM83GHhL8i+ZIO0h+a3fmkLYRhXz3m/k+brHIj06C aR3OVEdRd/yTXm8hzyIEHiNiieyIQn7SFlftx8c2kYaonHi8BdVPv6EbH A==; X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="339626630" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="339626630" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 02:54:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="688830696" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="688830696" Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.82]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 02:54:43 -0700 From: "Li, Yi" To: devel@edk2.groups.io Cc: Yi Li Subject: [edk2-staging/OpenSSL11_EOL][PATCH 2/4] CryptoPkg: sync latest change in uefiprov to minprov Date: Tue, 4 Apr 2023 17:54:31 +0800 Message-Id: X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Yi Li --- .../Library/OpensslLib/OpensslStub/minprov.c | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/OpensslStub/minprov.c b/CryptoPkg/Library/OpensslLib/OpensslStub/minprov.c index 1ba4b4f669..26fad90408 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslStub/minprov.c +++ b/CryptoPkg/Library/OpensslLib/OpensslStub/minprov.c @@ -1,7 +1,5 @@ /** @file - Minimal UEFI Openssl provider implementation, only support PEI crypto feature - without PKCS7. - + Minimal UEFI Openssl provider implementation, only support PEI crypto feature. Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -122,7 +120,6 @@ static const OSSL_ALGORITHM deflt_digests[] = { // { PROV_NAMES_MD5_SHA1, "provider=default", ossl_md5_sha1_functions }, #endif /* OPENSSL_NO_MD5 */ - { PROV_NAMES_NULL, "provider=default", ossl_nullmd_functions }, { NULL, NULL, NULL } }; @@ -165,16 +162,7 @@ static const OSSL_ALGORITHM deflt_rands[] = { { NULL, NULL, NULL } }; -static const OSSL_ALGORITHM deflt_signature[] = { - { PROV_NAMES_RSA, "provider=default", ossl_rsa_signature_functions }, - { NULL, NULL, NULL } -}; - static const OSSL_ALGORITHM deflt_keymgmt[] = { - { PROV_NAMES_RSA, "provider=default", ossl_rsa_keymgmt_functions, - PROV_DESCS_RSA }, - { PROV_NAMES_RSA_PSS, "provider=default", ossl_rsapss_keymgmt_functions, - PROV_DESCS_RSA_PSS }, { PROV_NAMES_HKDF, "provider=default", ossl_kdf_keymgmt_functions, PROV_DESCS_HKDF_SIGN }, { NULL, NULL, NULL } @@ -189,16 +177,16 @@ static const OSSL_ALGORITHM *deflt_query(void *provctx, int operation_id, return deflt_digests; case OSSL_OP_CIPHER: return exported_ciphers; - case OSSL_OP_RAND: - return deflt_rands; case OSSL_OP_MAC: return deflt_macs; case OSSL_OP_KDF: return deflt_kdfs; - case OSSL_OP_KEYEXCH: - return deflt_keyexch; + case OSSL_OP_RAND: + return deflt_rands; case OSSL_OP_KEYMGMT: return deflt_keymgmt; + case OSSL_OP_KEYEXCH: + return deflt_keyexch; } return NULL; } @@ -229,10 +217,8 @@ int ossl_uefi_provider_init(const OSSL_CORE_HANDLE *handle, void **provctx) { OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL; - BIO_METHOD *corebiometh; - if (!ossl_prov_bio_from_dispatch(in) - || !ossl_prov_seeding_from_dispatch(in)) + if (!ossl_prov_seeding_from_dispatch(in)) return 0; for (; in->function_id != 0; in++) { switch (in->function_id) { @@ -262,8 +248,7 @@ int ossl_uefi_provider_init(const OSSL_CORE_HANDLE *handle, * This only works for built-in providers. Most providers should * create their own library context. */ - if ((*provctx = ossl_prov_ctx_new()) == NULL - || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) { + if ((*provctx = ossl_prov_ctx_new()) == NULL) { ossl_prov_ctx_free(*provctx); *provctx = NULL; return 0; @@ -271,7 +256,6 @@ int ossl_uefi_provider_init(const OSSL_CORE_HANDLE *handle, ossl_prov_ctx_set0_libctx(*provctx, (OSSL_LIB_CTX *)c_get_libctx(handle)); ossl_prov_ctx_set0_handle(*provctx, handle); - ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh); *out = deflt_dispatch_table; ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers); -- 2.31.1.windows.1