From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.14704.1678696232794120979 for ; Mon, 13 Mar 2023 01:30:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fkIOIhCC; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678696231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rhW5QcZOCBuPPLmZkpQcHIaFPwXktUhwEcgXQMsXbtg=; b=fkIOIhCCsiMP00E+pgpM+QJU+Wiz+F+nhBn9ZGwbo56tM644VyHfhjVAZQqMoQxy3aeZT1 cIp5XdsBZ4z/6BgDpJHyKcd1wQEPzEoB5mGyGOS6sqiHk8SLcvjWOGpED91soEWfg0U3Nv wB6xJX1wm0fVIDx0wpxHcwhwBYPOjag= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-eACKVCrRPBq9xrYwDA-qaA-1; Mon, 13 Mar 2023 04:30:28 -0400 X-MC-Unique: eACKVCrRPBq9xrYwDA-qaA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C3FD101A52E; Mon, 13 Mar 2023 08:30:28 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA8CC1410F1B; Mon, 13 Mar 2023 08:30:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 634F81801E8B; Mon, 13 Mar 2023 09:30:16 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jian J Wang , Pawel Polawski , Xiaoyu Lu , Ard Biesheuvel , Guomin Jiang , Gerd Hoffmann , Jiewen Yao , Oliver Steffen , Jordan Justen Subject: [PATCH 11/22] CryptoPkg/TlsLib: use unsigned long for ErrorCode Date: Mon, 13 Mar 2023 09:30:05 +0100 Message-Id: <20230313083016.136448-12-kraxel@redhat.com> In-Reply-To: <20230313083016.136448-1-kraxel@redhat.com> References: <20230313083016.136448-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Signed-off-by: Gerd Hoffmann --- 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 37f6cfc27095..a05633fce490 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 1d63d6268125..b3002a94bbb9 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.39.2