From 85efd02fab2440686a812a7c6d58f339259113ec Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 3 Oct 2007 11:54:18 -0700 Subject: [PATCH] wintrust: Copy time to verify from cert info. --- dlls/wintrust/softpub.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 5a2aab5522e..f1aae3b8fd0 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -276,7 +276,19 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) CRYPT_PROVIDER_SGNR signer = { sizeof(signer), { 0 } }; DWORD i; - /* Add empty signer, so we can add a cert to it */ + /* Add a signer with nothing but the time to verify, so we can + * add a cert to it + */ + if (data->pWintrustData->u.pCert->psftVerifyAsOf) + memcpy(&data->sftSystemTime, &signer.sftVerifyAsOf, + sizeof(FILETIME)); + else + { + SYSTEMTIME sysTime; + + GetSystemTime(&sysTime); + SystemTimeToFileTime(&sysTime, &signer.sftVerifyAsOf); + } ret = data->psPfns->pfnAddSgnr2Chain(data, FALSE, 0, &signer); if (!ret) goto error;