Commit bf1ad6c3 authored by Karsten Elfenbein's avatar Karsten Elfenbein Committed by Alexandre Julliard

rsaenh: Fix the case when the CPEncrypt function is asked for the needed buffer size.

parent 4b792c6d
......@@ -1889,6 +1889,12 @@ BOOL WINAPI RSAENH_CPEncrypt(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash,
}
dwEncryptedLen = (*pdwDataLen/pCryptKey->dwBlockLen+(Final?1:0))*pCryptKey->dwBlockLen;
if (pbData == NULL) {
*pdwDataLen = dwEncryptedLen;
return TRUE;
}
for (i=*pdwDataLen; i<dwEncryptedLen && i<dwBufLen; i++) pbData[i] = dwEncryptedLen - *pdwDataLen;
*pdwDataLen = dwEncryptedLen;
......
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