From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 139FDD8003E for ; Thu, 3 Aug 2023 04:39:01 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=TKQITXFcRZPRCftpc3RyJMpnigB13U1s4pntNVkq/Z8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1691037540; v=1; b=EZViUgmRw8HeS6XJtf553RMtayyqAVMkNX9MgIm0p7BmcUXt5TilVviYofLfRQ1XreCdKeUT bNuXPz62JMrKAnEhyHfGQjYFds9mh0w/1SY3A7qYI7aFdBQgsLzFlGUB1vfhKTdGbIZ99sSCx5l XxtQUVkWWjOHhfLGSqLnZgLc= X-Received: by 127.0.0.2 with SMTP id Wp8CYY7687511xf1Yo3kR1nv; Wed, 02 Aug 2023 21:39:00 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.7306.1691037531078533765 for ; Wed, 02 Aug 2023 21:38:57 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="456141203" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="456141203" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 21:38:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="794848070" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="794848070" X-Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.10]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 21:38:55 -0700 From: "Li, Yi" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Jiewen Yao , Xiaoyu Lu , Guomin Jiang Subject: [edk2-devel] [PATCH V2 19/29] CryptoPkg/TlsLib: use unsigned long for ErrorCode Date: Thu, 3 Aug 2023 12:37:37 +0800 Message-Id: <4109ff45067477179f4223049fe83de39f7650bf.1691031203.git.yi1.li@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk 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,yi1.li@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 6XF5ZaJRRU05hOc5MkxYtiLRx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=EZViUgmR; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Cc: Jiewen Yao Cc: Xiaoyu Lu Cc: Guomin Jiang --- CryptoPkg/Library/TlsLib/TlsConfig.c | 3 ++- CryptoPkg/Library/TlsLib/TlsProcess.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/TlsLib/TlsConfig.c b/CryptoPkg/Library/TlsLib/TlsConfig.c index 5adb1976e3..f9333165a9 100644 --- a/CryptoPkg/Library/TlsLib/TlsConfig.c +++ b/CryptoPkg/Library/TlsLib/TlsConfig.c @@ -701,7 +701,6 @@ TlsSetCaCertificate ( TLS_CONNECTION *TlsConn; SSL_CTX *SslCtx; INTN Ret; - UINTN ErrorCode; BioCert = NULL; Cert = NULL; @@ -753,6 +752,8 @@ TlsSetCaCertificate ( // Ret = X509_STORE_add_cert (X509Store, Cert); if (Ret != 1) { + unsigned long ErrorCode; + ErrorCode = ERR_peek_last_error (); // // Ignore "already in table" errors diff --git a/CryptoPkg/Library/TlsLib/TlsProcess.c b/CryptoPkg/Library/TlsLib/TlsProcess.c index ddd0317ee6..1b712cd452 100644 --- a/CryptoPkg/Library/TlsLib/TlsProcess.c +++ b/CryptoPkg/Library/TlsLib/TlsProcess.c @@ -81,7 +81,6 @@ TlsDoHandshake ( TLS_CONNECTION *TlsConn; UINTN PendingBufferSize; INTN Ret; - UINTN ErrorCode; TlsConn = (TLS_CONNECTION *)Tls; PendingBufferSize = 0; @@ -133,6 +132,8 @@ TlsDoHandshake ( )); DEBUG_CODE_BEGIN (); while (TRUE) { + unsigned long ErrorCode; + ErrorCode = ERR_get_error (); if (ErrorCode == 0) { break; -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107500): https://edk2.groups.io/g/devel/message/107500 Mute This Topic: https://groups.io/mt/100520603/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-