Commit 47e75329 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Return error directly from WINTRUST_SaveSigner.

parent 1781878b
...@@ -474,9 +474,9 @@ static CMSG_SIGNER_INFO *WINTRUST_GetSigner(CRYPT_PROVIDER_DATA *data, ...@@ -474,9 +474,9 @@ static CMSG_SIGNER_INFO *WINTRUST_GetSigner(CRYPT_PROVIDER_DATA *data,
return signerInfo; return signerInfo;
} }
static BOOL WINTRUST_SaveSigner(CRYPT_PROVIDER_DATA *data, DWORD signerIdx) static DWORD WINTRUST_SaveSigner(CRYPT_PROVIDER_DATA *data, DWORD signerIdx)
{ {
BOOL ret; DWORD err;
CMSG_SIGNER_INFO *signerInfo = WINTRUST_GetSigner(data, signerIdx); CMSG_SIGNER_INFO *signerInfo = WINTRUST_GetSigner(data, signerIdx);
if (signerInfo) if (signerInfo)
...@@ -485,11 +485,14 @@ static BOOL WINTRUST_SaveSigner(CRYPT_PROVIDER_DATA *data, DWORD signerIdx) ...@@ -485,11 +485,14 @@ static BOOL WINTRUST_SaveSigner(CRYPT_PROVIDER_DATA *data, DWORD signerIdx)
sgnr.psSigner = signerInfo; sgnr.psSigner = signerInfo;
sgnr.sftVerifyAsOf = data->sftSystemTime; sgnr.sftVerifyAsOf = data->sftSystemTime;
ret = data->psPfns->pfnAddSgnr2Chain(data, FALSE, signerIdx, &sgnr); if (!data->psPfns->pfnAddSgnr2Chain(data, FALSE, signerIdx, &sgnr))
err = GetLastError();
else
err = ERROR_SUCCESS;
} }
else else
ret = FALSE; err = GetLastError();
return ret; return err;
} }
static CERT_INFO *WINTRUST_GetSignerCertInfo(CRYPT_PROVIDER_DATA *data, static CERT_INFO *WINTRUST_GetSignerCertInfo(CRYPT_PROVIDER_DATA *data,
...@@ -574,21 +577,15 @@ HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data) ...@@ -574,21 +577,15 @@ HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data)
if (ret) if (ret)
{ {
DWORD i; DWORD i;
DWORD err = ERROR_SUCCESS;
for (i = 0; ret && i < signerCount; i++) for (i = 0; !err && i < signerCount; i++)
{ {
if ((ret = WINTRUST_SaveSigner(data, i))) if (!(err = WINTRUST_SaveSigner(data, i)))
{
DWORD err;
err = WINTRUST_VerifySigner(data, i); err = WINTRUST_VerifySigner(data, i);
if (err)
{
SetLastError(err);
ret = FALSE;
}
}
} }
if (err)
ret = FALSE;
} }
else else
SetLastError(TRUST_E_NOSIGNATURE); SetLastError(TRUST_E_NOSIGNATURE);
......
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