Commit 4ff40a67 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

rsaenh: Validate pbData in CPSetKeyParam().

parent 5f984f8c
...@@ -3797,7 +3797,7 @@ BOOL WINAPI RSAENH_CPGetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwPa ...@@ -3797,7 +3797,7 @@ BOOL WINAPI RSAENH_CPGetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwPa
* CRYPT_EXPORT, CRYPT_READ, CRYPT_WRITE, CRYPT_MAC * CRYPT_EXPORT, CRYPT_READ, CRYPT_WRITE, CRYPT_MAC
* - KP_IV: Initialization vector * - KP_IV: Initialization vector
*/ */
BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData,
DWORD dwFlags) DWORD dwFlags)
{ {
CRYPTKEY *pCryptKey; CRYPTKEY *pCryptKey;
...@@ -3815,13 +3815,19 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam ...@@ -3815,13 +3815,19 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam
SetLastError(NTE_BAD_FLAGS); SetLastError(NTE_BAD_FLAGS);
return FALSE; return FALSE;
} }
if (!lookup_handle(&handle_table, hKey, RSAENH_MAGIC_KEY, (OBJECTHDR**)&pCryptKey)) if (!lookup_handle(&handle_table, hKey, RSAENH_MAGIC_KEY, (OBJECTHDR**)&pCryptKey))
{ {
SetLastError(NTE_BAD_KEY); SetLastError(NTE_BAD_KEY);
return FALSE; return FALSE;
} }
if (!pbData)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
switch (dwParam) { switch (dwParam) {
case KP_PADDING: case KP_PADDING:
/* The MS providers only support PKCS5_PADDING */ /* The MS providers only support PKCS5_PADDING */
......
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