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
49c11910
Commit
49c11910
authored
Nov 05, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Explicitly clear unused memory when exporting a private key.
parent
de00535c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
implglue.c
dlls/rsaenh/implglue.c
+21
-0
No files found.
dlls/rsaenh/implglue.c
View file @
49c11910
...
...
@@ -397,24 +397,45 @@ BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD
{
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
N
,
pbDest
);
reverse_bytes
(
pbDest
,
dwKeyLen
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
N
)
<
dwKeyLen
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
N
),
0
,
dwKeyLen
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
N
));
pbDest
+=
dwKeyLen
;
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
p
,
pbDest
);
reverse_bytes
(
pbDest
,
(
dwKeyLen
+
1
)
>>
1
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
p
)
<
(
dwKeyLen
+
1
)
>>
1
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
p
),
0
,
((
dwKeyLen
+
1
)
>>
1
)
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
p
));
pbDest
+=
(
dwKeyLen
+
1
)
>>
1
;
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
q
,
pbDest
);
reverse_bytes
(
pbDest
,
(
dwKeyLen
+
1
)
>>
1
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
q
)
<
(
dwKeyLen
+
1
)
>>
1
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
q
),
0
,
((
dwKeyLen
+
1
)
>>
1
)
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
q
));
pbDest
+=
(
dwKeyLen
+
1
)
>>
1
;
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
dP
,
pbDest
);
reverse_bytes
(
pbDest
,
(
dwKeyLen
+
1
)
>>
1
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
dP
)
<
(
dwKeyLen
+
1
)
>>
1
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
dP
),
0
,
((
dwKeyLen
+
1
)
>>
1
)
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
dP
));
pbDest
+=
(
dwKeyLen
+
1
)
>>
1
;
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
dQ
,
pbDest
);
reverse_bytes
(
pbDest
,
(
dwKeyLen
+
1
)
>>
1
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
dQ
)
<
(
dwKeyLen
+
1
)
>>
1
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
dQ
),
0
,
((
dwKeyLen
+
1
)
>>
1
)
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
dQ
));
pbDest
+=
(
dwKeyLen
+
1
)
>>
1
;
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
qP
,
pbDest
);
reverse_bytes
(
pbDest
,
(
dwKeyLen
+
1
)
>>
1
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
qP
)
<
(
dwKeyLen
+
1
)
>>
1
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
qP
),
0
,
((
dwKeyLen
+
1
)
>>
1
)
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
qP
));
pbDest
+=
(
dwKeyLen
+
1
)
>>
1
;
mp_to_unsigned_bin
(
&
pKeyContext
->
rsa
.
d
,
pbDest
);
reverse_bytes
(
pbDest
,
dwKeyLen
);
if
(
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
d
)
<
dwKeyLen
)
memset
(
pbDest
+
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
d
),
0
,
dwKeyLen
-
mp_unsigned_bin_size
(
&
pKeyContext
->
rsa
.
d
));
*
pdwPubExp
=
(
DWORD
)
mp_get_int
(
&
pKeyContext
->
rsa
.
e
);
return
TRUE
;
...
...
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