mirror of
https://github.com/wine-mirror/wine
synced 2024-07-01 07:14:31 +00:00
wintrust: Initialize CRYPT_PROVIDER_SIGSTATE structure in Softpub provider.
This commit is contained in:
parent
6071205974
commit
2f5ad179e5
|
@ -832,14 +832,32 @@ static DWORD WINTRUST_VerifySigner(CRYPT_PROVIDER_DATA *data, DWORD signerIdx)
|
|||
|
||||
HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data)
|
||||
{
|
||||
DWORD err;
|
||||
DWORD err = ERROR_SUCCESS;
|
||||
|
||||
TRACE("(%p)\n", data);
|
||||
|
||||
if (!data->padwTrustStepErrors)
|
||||
return S_FALSE;
|
||||
|
||||
if (data->hMsg)
|
||||
if (data->pSigState)
|
||||
{
|
||||
/* We did not initialize this, probably an unsupported usage. */
|
||||
FIXME("pSigState %p already initialized.\n", data->pSigState);
|
||||
}
|
||||
if (!(data->pSigState = data->psPfns->pfnAlloc(sizeof(*data->pSigState))))
|
||||
{
|
||||
err = ERROR_OUTOFMEMORY;
|
||||
}
|
||||
else
|
||||
{
|
||||
data->pSigState->cbStruct = sizeof(*data->pSigState);
|
||||
data->pSigState->fSupportMultiSig = TRUE;
|
||||
data->pSigState->dwCryptoPolicySupport = WSS_SIGTRUST_SUPPORT | WSS_OBJTRUST_SUPPORT | WSS_CERTTRUST_SUPPORT;
|
||||
if (data->hMsg)
|
||||
data->pSigState->hPrimarySig = CryptMsgDuplicate(data->hMsg);
|
||||
}
|
||||
|
||||
if (!err && data->hMsg)
|
||||
{
|
||||
DWORD signerCount, size;
|
||||
|
||||
|
@ -859,8 +877,7 @@ HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data)
|
|||
else
|
||||
err = TRUST_E_NOSIGNATURE;
|
||||
}
|
||||
else
|
||||
err = ERROR_SUCCESS;
|
||||
|
||||
if (err)
|
||||
data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_SIGPROV] = err;
|
||||
return !err ? S_OK : S_FALSE;
|
||||
|
@ -1375,6 +1392,13 @@ HRESULT WINAPI SoftpubCleanup(CRYPT_PROVIDER_DATA *data)
|
|||
data->psPfns->pfnFree(data->u.pPDSip->psIndirectData);
|
||||
}
|
||||
|
||||
if (WVT_ISINSTRUCT(CRYPT_PROVIDER_DATA, data->cbStruct, pSigState) && data->pSigState)
|
||||
{
|
||||
CryptMsgClose(data->pSigState->hPrimarySig);
|
||||
for (i = 0; i < data->pSigState->cSecondarySigs; ++i)
|
||||
CryptMsgClose(data->pSigState->rhSecondarySigs[i]);
|
||||
data->psPfns->pfnFree(data->pSigState);
|
||||
}
|
||||
CryptMsgClose(data->hMsg);
|
||||
|
||||
if (data->fOpenedFile &&
|
||||
|
|
|
@ -1831,7 +1831,7 @@ static void test_multiple_signatures(void)
|
|||
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);
|
||||
todo_wine 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)
|
||||
{
|
||||
ok(prov->pSigState->cbStruct == sizeof(*prov->pSigState)
|
||||
|
|
Loading…
Reference in New Issue
Block a user