cryptnet: Respect the timeout also if CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG is not set.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-07-22 00:21:05 -05:00 committed by Alexandre Julliard
parent 17f4407453
commit 3a9d51bf36

View file

@ -1547,8 +1547,7 @@ static DWORD verify_cert_revocation_from_dist_points_ext(const CRYPT_DATA_BLOB *
if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION) if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION)
retrievalFlags |= CRYPT_CACHE_ONLY_RETRIEVAL; retrievalFlags |= CRYPT_CACHE_ONLY_RETRIEVAL;
if ((dwFlags & CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG) && pRevPara if (pRevPara && pRevPara->cbSize >= RTL_SIZEOF_THROUGH_FIELD(CERT_REVOCATION_PARA, dwUrlRetrievalTimeout))
&& pRevPara->cbSize >= RTL_SIZEOF_THROUGH_FIELD(CERT_REVOCATION_PARA, dwUrlRetrievalTimeout))
timeout = pRevPara->dwUrlRetrievalTimeout; timeout = pRevPara->dwUrlRetrievalTimeout;
/* Yes, this is a weird algorithm, but the documentation for /* Yes, this is a weird algorithm, but the documentation for
@ -1577,7 +1576,7 @@ static DWORD verify_cert_revocation_from_dist_points_ext(const CRYPT_DATA_BLOB *
/* We don't check the current time here. This may result in /* We don't check the current time here. This may result in
* less accurate timeouts, but this too seems to be true of * less accurate timeouts, but this too seems to be true of
* Windows. */ * Windows. */
if (GetLastError() == ERROR_TIMEOUT) if ((dwFlags & CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG) && GetLastError() == ERROR_TIMEOUT)
timeout /= 2; timeout /= 2;
error = CRYPT_E_REVOCATION_OFFLINE; error = CRYPT_E_REVOCATION_OFFLINE;
} }