CryptoPkg/TlsLib: use unsigned long for ErrorCode

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Brian J. Johnson <brian.johnson@hpe.com>
Tested-by: Kenneth Lautner <klautner@microsoft.com>
This commit is contained in:
Gerd Hoffmann 2023-08-03 12:37:37 +08:00 committed by mergify[bot]
parent 20193b20b5
commit bdf3142eb7
2 changed files with 4 additions and 2 deletions

View File

@ -701,7 +701,6 @@ TlsSetCaCertificate (
TLS_CONNECTION *TlsConn; TLS_CONNECTION *TlsConn;
SSL_CTX *SslCtx; SSL_CTX *SslCtx;
INTN Ret; INTN Ret;
UINTN ErrorCode;
BioCert = NULL; BioCert = NULL;
Cert = NULL; Cert = NULL;
@ -753,6 +752,8 @@ TlsSetCaCertificate (
// //
Ret = X509_STORE_add_cert (X509Store, Cert); Ret = X509_STORE_add_cert (X509Store, Cert);
if (Ret != 1) { if (Ret != 1) {
unsigned long ErrorCode;
ErrorCode = ERR_peek_last_error (); ErrorCode = ERR_peek_last_error ();
// //
// Ignore "already in table" errors // Ignore "already in table" errors

View File

@ -81,7 +81,6 @@ TlsDoHandshake (
TLS_CONNECTION *TlsConn; TLS_CONNECTION *TlsConn;
UINTN PendingBufferSize; UINTN PendingBufferSize;
INTN Ret; INTN Ret;
UINTN ErrorCode;
TlsConn = (TLS_CONNECTION *)Tls; TlsConn = (TLS_CONNECTION *)Tls;
PendingBufferSize = 0; PendingBufferSize = 0;
@ -133,6 +132,8 @@ TlsDoHandshake (
)); ));
DEBUG_CODE_BEGIN (); DEBUG_CODE_BEGIN ();
while (TRUE) { while (TRUE) {
unsigned long ErrorCode;
ErrorCode = ERR_get_error (); ErrorCode = ERR_get_error ();
if (ErrorCode == 0) { if (ErrorCode == 0) {
break; break;