Module: wine Branch: master Commit: 2d0653e2b2851131540a56d24950746dcca36a48 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2d0653e2b2851131540a56d249...
Author: Qian Hong qhong@codeweavers.com Date: Sat Jun 29 00:51:30 2013 +0800
rsaenh: Restore key state even after decrypting a block of bad data.
---
dlls/rsaenh/rsaenh.c | 2 ++ dlls/rsaenh/tests/rsaenh.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index d0fc5be..b4e4b35 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -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; } } diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 9577d8c..f43a4e4 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -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))