Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0768dc3b
Commit
0768dc3b
authored
Dec 10, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Fix some memory leaks in the tests.
Remove an incorrect CryptProviderRelease call.
parent
d458a599
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+19
-1
No files found.
dlls/rsaenh/tests/rsaenh.c
View file @
0768dc3b
...
...
@@ -477,6 +477,8 @@ static void test_block_cipher_modes(void)
dwLen
=
23
;
result
=
CryptEncrypt
(
hKey
,
(
HCRYPTHASH
)
NULL
,
TRUE
,
0
,
abData
,
&
dwLen
,
24
);
ok
(
!
result
&&
GetLastError
()
==
NTE_BAD_ALGID
,
"%08x
\n
"
,
GetLastError
());
CryptDestroyKey
(
hKey
);
}
static
void
test_3des112
(
void
)
...
...
@@ -1133,18 +1135,23 @@ static void test_import_private(void)
result
=
CryptDecrypt
(
hSessionKey
,
0
,
TRUE
,
0
,
abEncryptedMessage
,
&
dwLen
);
ok
(
result
&&
dwLen
==
12
&&
!
memcmp
(
abEncryptedMessage
,
"Wine rocks!"
,
12
),
"%08x, len: %d
\n
"
,
GetLastError
(),
dwLen
);
CryptDestroyKey
(
hSessionKey
);
if
(
!
derive_key
(
CALG_RC4
,
&
hSessionKey
,
56
))
return
;
dwLen
=
(
DWORD
)
sizeof
(
abSessionKey
);
result
=
CryptExportKey
(
hSessionKey
,
hKeyExchangeKey
,
SIMPLEBLOB
,
0
,
abSessionKey
,
&
dwLen
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
CryptDestroyKey
(
hSessionKey
);
if
(
!
result
)
return
;
dwLen
=
(
DWORD
)
sizeof
(
abSessionKey
);
result
=
CryptImportKey
(
hProv
,
abSessionKey
,
dwLen
,
hKeyExchangeKey
,
0
,
&
hSessionKey
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
CryptDestroyKey
(
hSessionKey
);
CryptDestroyKey
(
hKeyExchangeKey
);
}
static
void
test_verify_signature
(
void
)
{
...
...
@@ -1364,6 +1371,8 @@ static void test_verify_signature(void) {
ok(!result && GetLastError()==NTE_BAD_SIGNATURE, "%08lx\n", GetLastError());
if (result) return;*/
CryptDestroyHash
(
hHash
);
result
=
CryptCreateHash
(
hProv
,
CALG_MD4
,
0
,
0
,
&
hHash
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
...
...
@@ -1380,6 +1389,8 @@ static void test_verify_signature(void) {
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
CryptDestroyHash
(
hHash
);
result
=
CryptCreateHash
(
hProv
,
CALG_MD5
,
0
,
0
,
&
hHash
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
...
...
@@ -1396,6 +1407,8 @@ static void test_verify_signature(void) {
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
CryptDestroyHash
(
hHash
);
result
=
CryptCreateHash
(
hProv
,
CALG_SHA
,
0
,
0
,
&
hHash
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
...
...
@@ -1411,6 +1424,9 @@ static void test_verify_signature(void) {
result
=
CryptVerifySignature
(
hHash
,
abSignatureSHANoOID
,
128
,
hPubSignKey
,
NULL
,
CRYPT_NOHASHOID
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
CryptDestroyHash
(
hHash
);
CryptDestroyKey
(
hPubSignKey
);
}
static
void
test_rsa_encrypt
(
void
)
...
...
@@ -1485,6 +1501,8 @@ static void test_import_export(void)
ok
(
result
,
"failed to export the fresh imported public key
\n
"
);
ok
(
dwLen
==
84
,
"Expected exported key to be 84 bytes long but got %d bytes.
\n
"
,
dwLen
);
ok
(
!
memcmp
(
emptyKey
,
abPlainPublicKey
,
dwLen
),
"exported key is different from the imported key
\n
"
);
CryptDestroyKey
(
hPublicKey
);
}
static
void
test_schannel_provider
(
void
)
...
...
@@ -1929,6 +1947,7 @@ static void test_null_provider(void)
if
(
!
result
)
return
;
result
=
CryptImportKey
(
prov
,
signBlob
,
sizeof
(
signBlob
),
0
,
0
,
&
key
);
ok
(
result
,
"CryptGenKey failed: %08x
\n
"
,
GetLastError
());
CryptDestroyKey
(
key
);
/* doesn't allow access to the key exchange key.. */
result
=
CryptGetUserKey
(
prov
,
AT_KEYEXCHANGE
,
&
key
);
ok
(
!
result
&&
GetLastError
()
==
NTE_NO_KEY
,
...
...
@@ -1961,7 +1980,6 @@ static void test_null_provider(void)
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
CryptReleaseContext
(
prov
,
0
);
/* test the machine key set */
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment