wintrust: Support WSS_GET_SECONDARY_SIG_COUNT in Softpub provider.

This commit is contained in:
Paul Gofman 2022-09-30 21:37:51 -05:00 committed by Alexandre Julliard
parent 71f58158c1
commit 2c9ab24366
3 changed files with 12 additions and 3 deletions

View file

@ -909,6 +909,11 @@ HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data)
data->pSigState->hPrimarySig = CryptMsgDuplicate(data->hMsg);
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)

View file

@ -1830,7 +1830,7 @@ static void test_multiple_signatures(void)
prov = (CRYPT_PROVIDER_DATA *)data.hWVTStateData;
ok(prov->cbStruct == sizeof(*prov), "Got size %lu.\n", prov->cbStruct);
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);
if (prov->cbStruct == sizeof(*prov) && prov->pSigState)
{
@ -1867,7 +1867,7 @@ static void test_multiple_signatures(void)
settings.dwVerifiedSigIndex = 0xcccccccc;
status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data);
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);
data.dwStateAction = WTD_STATEACTION_CLOSE;
@ -1881,7 +1881,7 @@ static void test_multiple_signatures(void)
settings.dwIndex = 1;
status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data);
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);
settings.dwIndex = 0;

View file

@ -294,6 +294,10 @@ static LONG WINTRUST_DefaultVerify(HWND hwnd, GUID *actionID,
data->hWVTStateData = provData;
provData->pWintrustData = data;
if (WVT_ISINSTRUCT(WINTRUST_DATA, data->cbStruct, pSignatureSettings))
provData->pSigSettings = data->pSignatureSettings;
if (hwnd == INVALID_HANDLE_VALUE)
provData->hWndParent = GetDesktopWindow();
else