crypt32: Support setting the salt value through KP_SALT_EX.

This commit is contained in:
Juan Lang 2007-11-28 09:27:36 -08:00 committed by Alexandre Julliard
parent c9e0fa442a
commit 83f74fef2c
1 changed files with 17 additions and 0 deletions

View File

@ -2823,6 +2823,23 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam
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) {
case CALG_RC2: