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
d2827be0
Commit
d2827be0
authored
Aug 07, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Aug 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Implement exporting PLAINTEXTKEYBLOBs.
parent
ff6328ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
rsaenh.c
dlls/rsaenh/rsaenh.c
+30
-0
No files found.
dlls/rsaenh/rsaenh.c
View file @
d2827be0
...
...
@@ -2481,6 +2481,33 @@ static BOOL crypt_export_private_key(CRYPTKEY *pCryptKey, BOOL force,
return
TRUE
;
}
static
BOOL
crypt_export_plaintext_key
(
CRYPTKEY
*
pCryptKey
,
BYTE
*
pbData
,
DWORD
*
pdwDataLen
)
{
BLOBHEADER
*
pBlobHeader
=
(
BLOBHEADER
*
)
pbData
;
DWORD
*
pKeyLen
=
(
DWORD
*
)(
pBlobHeader
+
1
);
BYTE
*
pbKey
=
(
BYTE
*
)(
pKeyLen
+
1
);
DWORD
dwDataLen
;
dwDataLen
=
sizeof
(
BLOBHEADER
)
+
sizeof
(
DWORD
)
+
pCryptKey
->
dwKeyLen
;
if
(
pbData
)
{
if
(
*
pdwDataLen
<
dwDataLen
)
{
SetLastError
(
ERROR_MORE_DATA
);
*
pdwDataLen
=
dwDataLen
;
return
FALSE
;
}
pBlobHeader
->
bType
=
PLAINTEXTKEYBLOB
;
pBlobHeader
->
bVersion
=
CUR_BLOB_VERSION
;
pBlobHeader
->
reserved
=
0
;
pBlobHeader
->
aiKeyAlg
=
pCryptKey
->
aiAlgid
;
*
pKeyLen
=
pCryptKey
->
dwKeyLen
;
memcpy
(
pbKey
,
&
pCryptKey
->
abKeyValue
,
pCryptKey
->
dwKeyLen
);
}
*
pdwDataLen
=
dwDataLen
;
return
TRUE
;
}
/******************************************************************************
* crypt_export_key [Internal]
*
...
...
@@ -2535,6 +2562,9 @@ static BOOL crypt_export_key(CRYPTKEY *pCryptKey, HCRYPTKEY hPubKey,
case
PRIVATEKEYBLOB
:
return
crypt_export_private_key
(
pCryptKey
,
force
,
pbData
,
pdwDataLen
);
case
PLAINTEXTKEYBLOB
:
return
crypt_export_plaintext_key
(
pCryptKey
,
pbData
,
pdwDataLen
);
default:
SetLastError
(
NTE_BAD_TYPE
);
/* FIXME: error code? */
...
...
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