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
30764edd
Commit
30764edd
authored
Jan 28, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jan 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Use helper function to install keys.
parent
8f4a4914
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
rsaenh.c
dlls/rsaenh/rsaenh.c
+23
-9
No files found.
dlls/rsaenh/rsaenh.c
View file @
30764edd
...
...
@@ -2443,6 +2443,23 @@ BOOL WINAPI RSAENH_CPExportKey(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTKEY hPubK
}
/******************************************************************************
* release_and_install_key [Internal]
*
* Release an existing key, if present, and replaces it with a new one.
*
* PARAMS
* hProv [I] Key container into which the key is to be imported.
* src [I] Key which will replace *dest
* dest [I] Points to key to be released and replaced with src
*/
static
void
release_and_install_key
(
HCRYPTPROV
hProv
,
HCRYPTKEY
src
,
HCRYPTKEY
*
dest
)
{
RSAENH_CPDestroyKey
(
hProv
,
*
dest
);
copy_handle
(
&
handle_table
,
src
,
RSAENH_MAGIC_KEY
,
dest
);
}
/******************************************************************************
* CPImportKey (RSAENH.@)
*
* Import a BLOB'ed key into a key container.
...
...
@@ -2517,16 +2534,14 @@ BOOL WINAPI RSAENH_CPImportKey(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDat
case
AT_SIGNATURE
:
case
CALG_RSA_SIGN
:
TRACE
(
"installing signing key
\n
"
);
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hSignatureKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hSignatureKeyPair
);
release_and_install_key
(
hProv
,
*
phKey
,
&
pKeyContainer
->
hSignatureKeyPair
);
break
;
case
AT_KEYEXCHANGE
:
case
CALG_RSA_KEYX
:
TRACE
(
"installing key exchange key
\n
"
);
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hKeyExchangeKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hKeyExchangeKeyPair
);
release_and_install_key
(
hProv
,
*
phKey
,
&
pKeyContainer
->
hKeyExchangeKeyPair
);
break
;
}
}
...
...
@@ -2558,9 +2573,8 @@ BOOL WINAPI RSAENH_CPImportKey(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDat
case
AT_KEYEXCHANGE
:
case
CALG_RSA_KEYX
:
TRACE
(
"installing public key
\n
"
);
RSAENH_CPDestroyKey
(
hProv
,
pKeyContainer
->
hKeyExchangeKeyPair
);
copy_handle
(
&
handle_table
,
*
phKey
,
RSAENH_MAGIC_KEY
,
&
pKeyContainer
->
hKeyExchangeKeyPair
);
release_and_install_key
(
hProv
,
*
phKey
,
&
pKeyContainer
->
hKeyExchangeKeyPair
);
break
;
}
}
...
...
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