mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-21 14:08:19 +00:00
rsaenh: Don't return salt for algorithms that don't support it.
This commit is contained in:
parent
c5a6b7b366
commit
1991ff2a0c
|
@ -3513,8 +3513,16 @@ BOOL WINAPI RSAENH_CPGetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam
|
|||
pCryptKey->dwBlockLen);
|
||||
|
||||
case KP_SALT:
|
||||
return copy_param(pbData, pdwDataLen,
|
||||
&pCryptKey->abKeyValue[pCryptKey->dwKeyLen], pCryptKey->dwSaltLen);
|
||||
switch (pCryptKey->aiAlgid) {
|
||||
case CALG_RC2:
|
||||
case CALG_RC4:
|
||||
return copy_param(pbData, pdwDataLen,
|
||||
&pCryptKey->abKeyValue[pCryptKey->dwKeyLen],
|
||||
pCryptKey->dwSaltLen);
|
||||
default:
|
||||
SetLastError(NTE_BAD_KEY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
case KP_PADDING:
|
||||
dwValue = PKCS5_PADDING;
|
||||
|
|
|
@ -744,7 +744,6 @@ static void test_aes(int keylen)
|
|||
|
||||
/* AES provider doesn't support salt */
|
||||
result = CryptGetKeyParam(hKey, KP_SALT, NULL, &dwLen, 0);
|
||||
todo_wine
|
||||
ok(!result && (GetLastError() == NTE_BAD_KEY || GetLastError() == ERROR_NO_TOKEN /* Win7 */),
|
||||
"expected NTE_BAD_KEY or ERROR_NO_TOKEN, got %08x\n", GetLastError());
|
||||
|
||||
|
@ -1742,7 +1741,6 @@ static void test_rsa_encrypt(void)
|
|||
|
||||
/* An RSA key doesn't support salt */
|
||||
result = CryptGetKeyParam(hRSAKey, KP_SALT, NULL, &dwLen, 0);
|
||||
todo_wine
|
||||
ok(!result && GetLastError() == NTE_BAD_KEY,
|
||||
"expected NTE_BAD_KEY, got %08x\n", GetLastError());
|
||||
|
||||
|
|
Loading…
Reference in a new issue