Added wintrust-WTHelperGetProvCertFromChain patchset

This commit is contained in:
Alistair Leslie-Hughes 2018-04-26 11:24:46 +10:00
parent 792181ca4e
commit 9832547e5c
3 changed files with 83 additions and 0 deletions

View File

@ -418,6 +418,7 @@ patch_enable_all ()
enable_wininet_Internet_Settings="$1"
enable_winmm_Delay_Import_Depends="$1"
enable_winmm_mciSendCommandA="$1"
enable_wintrust_WTHelperGetProvCertFromChain="$1"
enable_wintrust_WinVerifyTrust="$1"
enable_wpcap_Dynamic_Linking="$1"
enable_ws2_32_APC_Performance="$1"
@ -1444,6 +1445,9 @@ patch_enable ()
winmm-mciSendCommandA)
enable_winmm_mciSendCommandA="$2"
;;
wintrust-WTHelperGetProvCertFromChain)
enable_wintrust_WTHelperGetProvCertFromChain="$2"
;;
wintrust-WinVerifyTrust)
enable_wintrust_WinVerifyTrust="$2"
;;
@ -1858,6 +1862,13 @@ if test "$enable_ws2_32_TransmitFile" -eq 1; then
enable_server_Desktop_Refcount=1
fi
if test "$enable_wintrust_WTHelperGetProvCertFromChain" -eq 1; then
if test "$enable_wintrust_WinVerifyTrust" -gt 1; then
abort "Patchset wintrust-WinVerifyTrust disabled, but wintrust-WTHelperGetProvCertFromChain depends on that."
fi
enable_wintrust_WinVerifyTrust=1
fi
if test "$enable_winex11_WM_WINDOWPOSCHANGING" -eq 1; then
if test "$enable_winex11__NET_ACTIVE_WINDOW" -gt 1; then
abort "Patchset winex11-_NET_ACTIVE_WINDOW disabled, but winex11-WM_WINDOWPOSCHANGING depends on that."
@ -8487,6 +8498,24 @@ if test "$enable_wintrust_WinVerifyTrust" -eq 1; then
) >> "$patchlist"
fi
# Patchset wintrust-WTHelperGetProvCertFromChain
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * wintrust-WinVerifyTrust
# |
# | This patchset fixes the following Wine bugs:
# | * [#44061] Check Parameter in WTHelperGetProvCertFromChain
# |
# | Modified files:
# | * dlls/wintrust/tests/softpub.c, dlls/wintrust/wintrust_main.c
# |
if test "$enable_wintrust_WTHelperGetProvCertFromChain" -eq 1; then
patch_apply wintrust-WTHelperGetProvCertFromChain/0001-wintrust-Add-parameter-check-in-WTHelperGetProvCertF.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "wintrust: Add parameter check in WTHelperGetProvCertFromChain.", 1 },';
) >> "$patchlist"
fi
# Patchset wpcap-Dynamic_Linking
# |
# | Modified files:

View File

@ -0,0 +1,52 @@
From 563f0ccc4f47914e1e2952cc4bc5673cbb97a5ae Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 18 Apr 2018 03:55:16 +0000
Subject: [PATCH] wintrust: Add parameter check in WTHelperGetProvCertFromChain
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/wintrust/tests/softpub.c | 9 +++++++++
dlls/wintrust/wintrust_main.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c
index 1f87234..8b02e77 100644
--- a/dlls/wintrust/tests/softpub.c
+++ b/dlls/wintrust/tests/softpub.c
@@ -1300,6 +1300,14 @@ static void test_get_known_usages(void)
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
+static void test_WTHelperGetProvCertFromChain(void)
+{
+ CRYPT_PROVIDER_CERT *cert;
+
+ cert = WTHelperGetProvCertFromChain(NULL, 0);
+ ok(!cert, "got certificate\n");
+}
+
START_TEST(softpub)
{
InitFunctionPtrs();
@@ -1308,4 +1316,5 @@ START_TEST(softpub)
test_wintrust();
test_wintrust_digest();
test_get_known_usages();
+ test_WTHelperGetProvCertFromChain();
}
diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c
index 58e3ac3..bb52282 100644
--- a/dlls/wintrust/wintrust_main.c
+++ b/dlls/wintrust/wintrust_main.c
@@ -787,7 +787,7 @@ CRYPT_PROVIDER_CERT * WINAPI WTHelperGetProvCertFromChain(
TRACE("(%p %d)\n", pSgnr, idxCert);
- if (idxCert >= pSgnr->csCertChain || !pSgnr->pasCertChain)
+ if (!pSgnr || idxCert >= pSgnr->csCertChain || !pSgnr->pasCertChain)
return NULL;
cert = &pSgnr->pasCertChain[idxCert];
TRACE("returning %p\n", cert);
--
1.9.1

View File

@ -0,0 +1,2 @@
Fixes: [44061] Check Parameter in WTHelperGetProvCertFromChain
Depends: wintrust-WinVerifyTrust