From nobody Mon Sep 16 19:27:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101324+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101324+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1679043733; cv=none; d=zohomail.com; s=zohoarc; b=mRNIyP7wjPnaQkKwKq9C5qezVAU2zkTlALfVVLRXBwWtUTMXQJOeDbMQdFC8hKnrwkuOJvlUjfD/jedx7+xoDZL4klAa/Q4InB1tCTMOima6TEoy1x7gYUrWBk9vRpCF/GQWJogr2sIHRMwd8LcR0WRz7biMsJjhAlugvum+z84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679043733; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=LA7mXWuR8iW6201w0B5Z44nC+A+x6MwCGy1bb09iuEA=; b=dKx3xd8H7N4Xr7na9w5ny9/5MRnp88afwW76e8Iw0hiDEx9P0Tl3dEiX6mL+wMr5aWpVOJUXP3itr+ARl/a3UE9PmB1jBA57rW1NwSGIVZtotIcf/RLq7TXoaN4H0QWlFDxW1TBPTeF6Ljbu8kQ9A3Y2yr9C9ZGCb4LyUwtvMt0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101324+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1679043733306319.7332659549985; Fri, 17 Mar 2023 02:02:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id AoHQYY1788612xJdkgbZEU7f; Fri, 17 Mar 2023 02:02:12 -0700 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.14911.1679043720870874677 for ; Fri, 17 Mar 2023 02:02:12 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="317871173" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="317871173" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2023 02:02:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="926066896" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="926066896" X-Received: from shwdejointd777.ccr.corp.intel.com ([10.239.157.39]) by fmsmga006.fm.intel.com with ESMTP; 17 Mar 2023 02:02:11 -0700 From: "Wenxing Hou" To: devel@edk2.groups.io Cc: Wenxing Hou Subject: [edk2-devel] [edk2-staging/OpenSSL11_EOL PATCH 7/7] Clean SysCall api by adding platform_util.c Date: Fri, 17 Mar 2023 17:00:53 +0800 Message-Id: <20230317090053.1895-8-wenxing.hou@intel.com> In-Reply-To: <20230317090053.1895-1-wenxing.hou@intel.com> References: <20230317090053.1895-1-wenxing.hou@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wenxing.hou@intel.com X-Gm-Message-State: 1Tivq2hm1j7ohnCXrPgF22Kfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1679043732; bh=5nPbwJ61k4DosIc8aG38ug+NPxBVh9DzyqhQfu+blMs=; h=Cc:Date:From:Reply-To:Subject:To; b=C6udvXJFjzbsgwIKZebqgokEZmhXLYl9Fo50Hta8P2/ZzM6LUn7DNvnQsKTKz/A5IL7 6UveAYiWmA55drDC5y/z+QYuOugHBH1i1Jx/QicZoxPFQj3cj+7SDY+E+Hwl2mMyoiniL vy7id8vs5KLUgiZPB6JnaAcGf9u+Ke6XiHU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1679043735293100013 Content-Type: text/plain; charset="utf-8" Signed-off-by: Wenxing Hou --- .../BaseCryptLibMbedTls/Rand/CryptRandTsc.c | 7 +++++++ .../SysCall/ConstantTimeClock.c | 14 -------------- .../BaseCryptLibMbedTls/SysCall/CrtWrapper.c | 5 ----- .../BaseCryptLibMbedTls/SysCall/TimerWrapper.c | 14 -------------- CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf | 1 + 5 files changed, 8 insertions(+), 33 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c b/Cr= yptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c index 96d18eb7aa..a4ece17680 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c @@ -59,3 +59,10 @@ RandomBytes ( =20 return TRUE; } + +int myrand( void *rng_state, unsigned char *output, size_t len ) +{ + RandomBytes (output, len); + + return 0; +} diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeCloc= k.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c index 41a1fdd634..6c1d8a400d 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c @@ -59,17 +59,3 @@ struct tm * gmtime (const time_t *timer) time_t _time64 (time_t* t) { return time (t); } - -struct tm *mbedtls_platform_gmtime_r( const time_t *tt, - struct tm *tm_buf ) -{ - struct tm * lt; - - lt =3D gmtime (tt); - - if (lt !=3D NULL) { - CopyMem (tm_buf, lt, sizeof(struct tm)); - } - - return ((lt =3D=3D NULL) ? NULL : tm_buf); -} diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c b/C= ryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c index c401dae861..25074d3bfb 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c @@ -31,11 +31,6 @@ int mbedtls_vsnprintf(char *str, size_t size, const char= *format, ...) return 0; } =20 -void mbedtls_platform_zeroize( void *buf, unsigned int len ) -{ - ZeroMem (buf, len); -} - int rand () { // TBD diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c b= /CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c index abb9a2226c..d940abb7f0 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c @@ -190,17 +190,3 @@ struct tm * gmtime (const time_t *timer) time_t _time64 (time_t* t) { return time (t); } - -struct tm *mbedtls_platform_gmtime_r( const time_t *tt, - struct tm *tm_buf ) -{ - struct tm * lt; - - lt =3D gmtime (tt); - - if (lt !=3D NULL) { - CopyMem (tm_buf, lt, sizeof(struct tm)); - } - - return ((lt =3D=3D NULL) ? NULL : tm_buf); -} diff --git a/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf b/CryptoPkg/Librar= y/MbedTlsLib/MbedTlsLib.inf index 69d712b9c6..e2fd9e6e1e 100644 --- a/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf +++ b/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf @@ -109,6 +109,7 @@ mbedtls/library/x509_crt.c mbedtls/library/x509_csr.c mbedtls/library/pkcs7.c + mbedtls/library/platform_util.c =20 [Packages] MdePkg/MdePkg.dec --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101324): https://edk2.groups.io/g/devel/message/101324 Mute This Topic: https://groups.io/mt/97669086/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-