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
e705dfc2
Commit
e705dfc2
authored
Apr 30, 2017
by
Akihiro Sagawa
Committed by
Alexandre Julliard
May 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Don't import a public key to a key container.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b6ca6825
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
rsaenh.c
dlls/rsaenh/rsaenh.c
+4
-17
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+1
-1
No files found.
dlls/rsaenh/rsaenh.c
View file @
e705dfc2
...
...
@@ -2822,15 +2822,14 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat
/******************************************************************************
* import_public_key [Internal]
*
* Import a BLOB'ed public key
into a key container
.
* Import a BLOB'ed public key.
*
* PARAMS
* hProv [I]
Key container into which the public key is to be imported
.
* hProv [I]
A CSP
.
* pbData [I] Pointer to a buffer which holds the public key BLOB.
* dwDataLen [I] Length of data in buffer at pbData.
* dwFlags [I] One of:
* CRYPT_EXPORTABLE: the imported key is marked exportable
* fStoreKey [I] If TRUE, the imported key is stored to the registry.
* phKey [O] Handle to the imported key.
*
*
...
...
@@ -2843,9 +2842,8 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat
* Failure: FALSE.
*/
static
BOOL
import_public_key
(
HCRYPTPROV
hProv
,
const
BYTE
*
pbData
,
DWORD
dwDataLen
,
DWORD
dwFlags
,
BOOL
fStoreKey
,
HCRYPTKEY
*
phKey
)
DWORD
dwFlags
,
HCRYPTKEY
*
phKey
)
{
KEYCONTAINER
*
pKeyContainer
;
CRYPTKEY
*
pCryptKey
;
const
BLOBHEADER
*
pBlobHeader
=
(
const
BLOBHEADER
*
)
pbData
;
const
RSAPUBKEY
*
pRSAPubKey
=
(
const
RSAPUBKEY
*
)(
pBlobHeader
+
1
);
...
...
@@ -2858,8 +2856,6 @@ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwData
SetLastError
(
NTE_BAD_FLAGS
);
return
FALSE
;
}
if
(
!
(
pKeyContainer
=
get_key_container
(
hProv
)))
return
FALSE
;
if
((
dwDataLen
<
sizeof
(
BLOBHEADER
)
+
sizeof
(
RSAPUBKEY
))
||
(
pRSAPubKey
->
magic
!=
RSAENH_MAGIC_RSA1
)
||
...
...
@@ -2881,15 +2877,6 @@ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwData
if
(
ret
)
{
if
(
dwFlags
&
CRYPT_EXPORTABLE
)
pCryptKey
->
dwPermissions
|=
CRYPT_EXPORT
;
switch
(
pBlobHeader
->
aiKeyAlg
)
{
case
AT_KEYEXCHANGE
:
case
CALG_RSA_KEYX
:
TRACE
(
"installing public key
\n
"
);
release_and_install_key
(
hProv
,
*
phKey
,
&
pKeyContainer
->
hKeyExchangeKeyPair
,
fStoreKey
);
break
;
}
}
return
ret
;
}
...
...
@@ -3103,7 +3090,7 @@ static BOOL import_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HC
case
PUBLICKEYBLOB
:
return
import_public_key
(
hProv
,
pbData
,
dwDataLen
,
dwFlags
,
fStoreKey
,
phKey
);
phKey
);
case
SIMPLEBLOB
:
return
import_symmetric_key
(
hProv
,
pbData
,
dwDataLen
,
hPubKey
,
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
e705dfc2
...
...
@@ -2642,7 +2642,7 @@ static void test_import_export(void)
CryptDestroyKey
(
hPrivKey
);
result
=
!
memcmp
(
exported_key
,
exported_key2
,
dwDataLen
);
todo_wine
ok
(
result
,
"unexpected value
\n
"
);
ok
(
result
,
"unexpected value
\n
"
);
if
(
!
result
&&
winetest_debug
>
1
)
{
trace
(
"Expected public key (%u):
\n
"
,
dwDataLen
);
trace_hex
(
exported_key
,
dwDataLen
);
...
...
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