diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 100abaa86a8..8abca01ff62 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -185,20 +185,17 @@ static BOOL WINAPI CertContext_GetProperty(void *context, DWORD dwPropId, if (ret) { if (!pvData) - { *pcbData = blob.cbData; - ret = TRUE; - } else if (*pcbData < blob.cbData) { SetLastError(ERROR_MORE_DATA); *pcbData = blob.cbData; + ret = FALSE; } else { memcpy(pvData, blob.pbData, blob.cbData); *pcbData = blob.cbData; - ret = TRUE; } } else @@ -320,10 +317,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, if (ret) { if (!pvData) - { *pcbData = sizeof(HCRYPTPROV); - ret = TRUE; - } else if (*pcbData < sizeof(HCRYPTPROV)) { SetLastError(ERROR_MORE_DATA); @@ -331,10 +325,7 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, ret = FALSE; } else - { *(HCRYPTPROV *)pvData = keyContext.hCryptProv; - ret = TRUE; - } } break; } diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c index 32c4f3aa797..aa94f39d10c 100644 --- a/dlls/crypt32/crl.c +++ b/dlls/crypt32/crl.c @@ -302,20 +302,17 @@ static BOOL WINAPI CRLContext_GetProperty(void *context, DWORD dwPropId, if (ret) { if (!pvData) - { *pcbData = blob.cbData; - ret = TRUE; - } else if (*pcbData < blob.cbData) { SetLastError(ERROR_MORE_DATA); *pcbData = blob.cbData; + ret = FALSE; } else { memcpy(pvData, blob.pbData, blob.cbData); *pcbData = blob.cbData; - ret = TRUE; } } else