rsaenh: Restore key state even after decrypting a block of bad data.

This commit is contained in:
Qian Hong 2013-06-29 00:51:30 +08:00 committed by Alexandre Julliard
parent b84e11ecbd
commit 2d0653e2b2
2 changed files with 2 additions and 2 deletions

View File

@ -2380,11 +2380,13 @@ BOOL WINAPI RSAENH_CPDecrypt(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash,
*pdwDataLen -= pbData[*pdwDataLen-1];
else {
SetLastError(NTE_BAD_DATA);
setup_key(pCryptKey);
return FALSE;
}
}
else {
SetLastError(NTE_BAD_DATA);
setup_key(pCryptKey);
return FALSE;
}
}

View File

@ -840,7 +840,6 @@ static void test_3des112(void)
result = CryptDecrypt(hKey, 0, TRUE, 0, pbData, &dwLen);
ok(result, "%08x\n", GetLastError());
ok(dwLen==cTestData[i].enclen,"length incorrect, got %d, expected %d\n",dwLen,cTestData[i].enclen);
todo_wine
ok(memcmp(pbData,cTestData[i].decstr,cTestData[1].enclen)==0,"decryption incorrect %d\n",i);
if((dwLen != cTestData[i].enclen) ||
memcmp(pbData,cTestData[i].decstr,cTestData[i].enclen))
@ -1019,7 +1018,6 @@ static void test_3des(void)
result = CryptDecrypt(hKey, 0, TRUE, 0, pbData, &dwLen);
ok(result, "%08x\n", GetLastError());
ok(dwLen==cTestData[i].enclen,"length incorrect, got %d, expected %d\n",dwLen,cTestData[i].enclen);
todo_wine
ok(memcmp(pbData,cTestData[i].decstr,cTestData[1].enclen)==0,"decryption incorrect %d\n",i);
if((dwLen != cTestData[i].enclen) ||
memcmp(pbData,cTestData[i].decstr,cTestData[i].enclen))