diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index bc10fc731fd..c22b3dcaf1e 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -3628,17 +3628,18 @@ BOOL WINAPI RSAENH_CPGetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwPa &pCryptHash->tpPRFParams.blobSeed, pbData, *pdwDataLen); } - if ( pbData == NULL ) { - *pdwDataLen = pCryptHash->dwHashSize; - return TRUE; - } - - if (pbData && (pCryptHash->dwState != RSAENH_HASHSTATE_FINISHED)) + if (pCryptHash->dwState != RSAENH_HASHSTATE_FINISHED) { finalize_hash(pCryptHash); pCryptHash->dwState = RSAENH_HASHSTATE_FINISHED; } + if (!pbData) + { + *pdwDataLen = pCryptHash->dwHashSize; + return TRUE; + } + return copy_param(pbData, pdwDataLen, pCryptHash->abHashValue, pCryptHash->dwHashSize);