Author: winesync Date: Mon Jan 14 19:27:48 2008 New Revision: 31793
URL: http://svn.reactos.org/svn/reactos?rev=31793&view=rev Log: Autosyncing with Wine HEAD
Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.c trunk/reactos/dll/win32/rsaenh/rsaenh.rbuild
Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rsaenh/rsaenh.c?r... ============================================================================== --- trunk/reactos/dll/win32/rsaenh/rsaenh.c (original) +++ trunk/reactos/dll/win32/rsaenh/rsaenh.c Mon Jan 14 19:27:48 2008 @@ -2798,6 +2798,14 @@ }
switch (dwParam) { + case KP_PADDING: + /* The MS providers only support PKCS5_PADDING */ + if (*(DWORD *)pbData != PKCS5_PADDING) { + SetLastError(NTE_BAD_DATA); + return FALSE; + } + return TRUE; + case KP_MODE: pCryptKey->dwMode = *(DWORD*)pbData; return TRUE; @@ -2814,6 +2822,23 @@ memcpy(pCryptKey->abInitVector, pbData, pCryptKey->dwBlockLen); setup_key(pCryptKey); return TRUE; + + case KP_SALT_EX: + { + CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)pbData; + + /* salt length can't be greater than 128 bits = 16 bytes */ + if (blob->cbData > 16) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + memcpy(pCryptKey->abKeyValue + pCryptKey->dwKeyLen, blob->pbData, + blob->cbData); + pCryptKey->dwSaltLen = blob->cbData; + setup_key(pCryptKey); + return TRUE; + }
case KP_EFFECTIVE_KEYLEN: switch (pCryptKey->aiAlgid) { @@ -2901,7 +2926,7 @@ DWORD *pdwDataLen, DWORD dwFlags) { CRYPTKEY *pCryptKey; - DWORD dwBitLen; + DWORD dwValue;
TRACE("(hProv=%08lx, hKey=%08lx, dwParam=%08x, pbData=%p, pdwDataLen=%p dwFlags=%08x)\n", hProv, hKey, dwParam, pbData, pdwDataLen, dwFlags); @@ -2933,20 +2958,24 @@ return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptKey->abKeyValue[pCryptKey->dwKeyLen], pCryptKey->dwSaltLen);
+ case KP_PADDING: + dwValue = PKCS5_PADDING; + return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD)); + case KP_KEYLEN: - dwBitLen = pCryptKey->dwKeyLen << 3; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwBitLen, sizeof(DWORD)); + dwValue = pCryptKey->dwKeyLen << 3; + return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD));
case KP_EFFECTIVE_KEYLEN: if (pCryptKey->dwEffectiveKeyLen) - dwBitLen = pCryptKey->dwEffectiveKeyLen; + dwValue = pCryptKey->dwEffectiveKeyLen; else - dwBitLen = pCryptKey->dwKeyLen << 3; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwBitLen, sizeof(DWORD)); + dwValue = pCryptKey->dwKeyLen << 3; + return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD));
case KP_BLOCKLEN: - dwBitLen = pCryptKey->dwBlockLen << 3; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwBitLen, sizeof(DWORD)); + dwValue = pCryptKey->dwBlockLen << 3; + return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD));
case KP_MODE: return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptKey->dwMode, sizeof(DWORD));
Modified: trunk/reactos/dll/win32/rsaenh/rsaenh.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rsaenh/rsaenh.rbu... ============================================================================== --- trunk/reactos/dll/win32/rsaenh/rsaenh.rbuild (original) +++ trunk/reactos/dll/win32/rsaenh/rsaenh.rbuild Mon Jan 14 19:27:48 2008 @@ -1,5 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> <module name="rsaenh" type="win32dll" baseaddress="${BASEADDRESS_RSAENH}" installbase="system32" installname="rsaenh.dll" allowwarnings="true"> <autoregister infsection="OleControlDlls" type="DllRegisterServer" /> <importlibrary definition="rsaenh.spec.def" /> @@ -26,3 +27,4 @@ <file>version.rc</file> <file>rsaenh.spec</file> </module> +</group>