Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
48975c38
Commit
48975c38
authored
Oct 20, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Store key when algid is a CALG_RSA_* algid, too.
parent
65fc5aa5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
10 deletions
+37
-10
rsaenh.c
dlls/rsaenh/rsaenh.c
+6
-10
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+31
-0
No files found.
dlls/rsaenh/rsaenh.c
View file @
48975c38
...
...
@@ -3059,11 +3059,9 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP
if
(
pCryptKey
)
{
new_key_impl
(
pCryptKey
->
aiAlgid
,
&
pCryptKey
->
context
,
pCryptKey
->
dwKeyLen
);
setup_key
(
pCryptKey
);
if
(
Algid
==
AT_SIGNATURE
)
{
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hSignatureKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hSignatureKeyPair
);
}
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hSignatureKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hSignatureKeyPair
);
}
break
;
...
...
@@ -3073,11 +3071,9 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP
if
(
pCryptKey
)
{
new_key_impl
(
pCryptKey
->
aiAlgid
,
&
pCryptKey
->
context
,
pCryptKey
->
dwKeyLen
);
setup_key
(
pCryptKey
);
if
(
Algid
==
AT_KEYEXCHANGE
)
{
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hKeyExchangeKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hKeyExchangeKeyPair
);
}
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hKeyExchangeKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hKeyExchangeKeyPair
);
}
break
;
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
48975c38
...
...
@@ -2086,6 +2086,37 @@ static void test_null_provider(void)
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
/* Test for being able to get a key generated with CALG_RSA_SIGN. */
result
=
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
ok
(
result
,
"CryptAcquireContext failed: %08x
\n
"
,
GetLastError
());
result
=
CryptGenKey
(
prov
,
CALG_RSA_SIGN
,
0
,
&
key
);
ok
(
result
,
"CryptGenKey with CALG_RSA_SIGN failed with error %08x
\n
"
,
GetLastError
());
result
=
CryptGetUserKey
(
prov
,
AT_KEYEXCHANGE
,
&
key
);
ok
(
!
result
,
"expected CryptGetUserKey to fail
\n
"
);
result
=
CryptGetUserKey
(
prov
,
AT_SIGNATURE
,
&
key
);
ok
(
result
,
"CryptGetUserKey with AT_SIGNATURE failed: %08x
\n
"
,
GetLastError
());
CryptDestroyKey
(
key
);
CryptReleaseContext
(
prov
,
0
);
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
/* Test for being able to get a key generated with CALG_RSA_KEYX. */
result
=
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
ok
(
result
,
"CryptAcquireContext failed: %08x
\n
"
,
GetLastError
());
result
=
CryptGenKey
(
prov
,
CALG_RSA_KEYX
,
0
,
&
key
);
ok
(
result
,
"CryptGenKey with CALG_RSA_KEYX failed with error %08x
\n
"
,
GetLastError
());
result
=
CryptGetUserKey
(
prov
,
AT_KEYEXCHANGE
,
&
key
);
ok
(
result
,
"CryptGetUserKey with AT_KEYEXCHANGE failed: %08x
\n
"
,
GetLastError
());
result
=
CryptGetUserKey
(
prov
,
AT_SIGNATURE
,
&
key
);
ok
(
!
result
,
"expected CryptGetUserKey to fail
\n
"
);
CryptDestroyKey
(
key
);
CryptReleaseContext
(
prov
,
0
);
CryptAcquireContext
(
&
prov
,
szContainer
,
NULL
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
/* test for the bug in accessing the user key in a container
*/
...
...
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