Commit 2c9ab243 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

wintrust: Support WSS_GET_SECONDARY_SIG_COUNT in Softpub provider.

parent 71f58158
...@@ -909,6 +909,11 @@ HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data) ...@@ -909,6 +909,11 @@ HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data)
data->pSigState->hPrimarySig = CryptMsgDuplicate(data->hMsg); data->pSigState->hPrimarySig = CryptMsgDuplicate(data->hMsg);
load_secondary_signatures(data, data->pSigState->hPrimarySig); load_secondary_signatures(data, data->pSigState->hPrimarySig);
} }
if (data->pSigSettings)
{
if (data->pSigSettings->dwFlags & WSS_GET_SECONDARY_SIG_COUNT)
data->pSigSettings->cSecondarySigs = data->pSigState->cSecondarySigs;
}
} }
if (!err && data->hMsg) if (!err && data->hMsg)
......
...@@ -1830,7 +1830,7 @@ static void test_multiple_signatures(void) ...@@ -1830,7 +1830,7 @@ static void test_multiple_signatures(void)
prov = (CRYPT_PROVIDER_DATA *)data.hWVTStateData; prov = (CRYPT_PROVIDER_DATA *)data.hWVTStateData;
ok(prov->cbStruct == sizeof(*prov), "Got size %lu.\n", prov->cbStruct); ok(prov->cbStruct == sizeof(*prov), "Got size %lu.\n", prov->cbStruct);
ok(prov->csSigners == 1, "Got %lu.\n", prov->csSigners); ok(prov->csSigners == 1, "Got %lu.\n", prov->csSigners);
todo_wine ok(prov->pSigSettings == &settings, "Got %p, expected %p.\n", prov->pSigSettings, &settings); ok(prov->pSigSettings == &settings, "Got %p, expected %p.\n", prov->pSigSettings, &settings);
ok(!!prov->pSigState, "Got %p, expected %p.\n", prov->pSigSettings, &settings); ok(!!prov->pSigState, "Got %p, expected %p.\n", prov->pSigSettings, &settings);
if (prov->cbStruct == sizeof(*prov) && prov->pSigState) if (prov->cbStruct == sizeof(*prov) && prov->pSigState)
{ {
...@@ -1867,7 +1867,7 @@ static void test_multiple_signatures(void) ...@@ -1867,7 +1867,7 @@ static void test_multiple_signatures(void)
settings.dwVerifiedSigIndex = 0xcccccccc; settings.dwVerifiedSigIndex = 0xcccccccc;
status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data); status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data);
todo_wine ok(status == CERT_E_UNTRUSTEDROOT || status == CERT_E_CHAINING, "Failed, ret %#lx\n", status); todo_wine ok(status == CERT_E_UNTRUSTEDROOT || status == CERT_E_CHAINING, "Failed, ret %#lx\n", status);
todo_wine ok(settings.cSecondarySigs == 2, "Got %lu.\n", settings.cSecondarySigs); ok(settings.cSecondarySigs == 2, "Got %lu.\n", settings.cSecondarySigs);
todo_wine ok(settings.dwVerifiedSigIndex == 2, "Got %lu.\n", settings.dwVerifiedSigIndex); todo_wine ok(settings.dwVerifiedSigIndex == 2, "Got %lu.\n", settings.dwVerifiedSigIndex);
data.dwStateAction = WTD_STATEACTION_CLOSE; data.dwStateAction = WTD_STATEACTION_CLOSE;
...@@ -1881,7 +1881,7 @@ static void test_multiple_signatures(void) ...@@ -1881,7 +1881,7 @@ static void test_multiple_signatures(void)
settings.dwIndex = 1; settings.dwIndex = 1;
status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data); status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data);
todo_wine ok(status == CERT_E_UNTRUSTEDROOT || status == CERT_E_CHAINING, "Failed, ret %#lx\n", status); todo_wine ok(status == CERT_E_UNTRUSTEDROOT || status == CERT_E_CHAINING, "Failed, ret %#lx\n", status);
todo_wine ok(settings.cSecondarySigs == 2, "Got %lu.\n", settings.cSecondarySigs); ok(settings.cSecondarySigs == 2, "Got %lu.\n", settings.cSecondarySigs);
todo_wine ok(settings.dwVerifiedSigIndex == 1, "Got %lu.\n", settings.dwVerifiedSigIndex); todo_wine ok(settings.dwVerifiedSigIndex == 1, "Got %lu.\n", settings.dwVerifiedSigIndex);
settings.dwIndex = 0; settings.dwIndex = 0;
......
...@@ -294,6 +294,10 @@ static LONG WINTRUST_DefaultVerify(HWND hwnd, GUID *actionID, ...@@ -294,6 +294,10 @@ static LONG WINTRUST_DefaultVerify(HWND hwnd, GUID *actionID,
data->hWVTStateData = provData; data->hWVTStateData = provData;
provData->pWintrustData = data; provData->pWintrustData = data;
if (WVT_ISINSTRUCT(WINTRUST_DATA, data->cbStruct, pSignatureSettings))
provData->pSigSettings = data->pSignatureSettings;
if (hwnd == INVALID_HANDLE_VALUE) if (hwnd == INVALID_HANDLE_VALUE)
provData->hWndParent = GetDesktopWindow(); provData->hWndParent = GetDesktopWindow();
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment