rsaenh: Fix the case when the CPEncrypt function is asked for the needed buffer size.
This commit is contained in:
parent
4b792c6d56
commit
bf1ad6c324
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue