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
8327b063
Commit
8327b063
authored
Oct 12, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Zero-pad RSA Private Key values as needed to fit PRIVATEKEYBLOB.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59ba888e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
decode.c
dlls/crypt32/decode.c
+21
-19
No files found.
dlls/crypt32/decode.c
View file @
8327b063
...
...
@@ -4002,18 +4002,19 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPrivKey(DWORD dwCertEncodingType,
&
size
,
NULL
,
NULL
);
if
(
ret
)
{
halflen
=
decodedKey
->
modulus
.
cbData
/
2
;
if
((
decodedKey
->
modulus
.
cbData
!=
halflen
*
2
)
||
(
decodedKey
->
prime1
.
cbData
!=
halflen
)
||
(
decodedKey
->
prime2
.
cbData
!=
halflen
)
||
(
decodedKey
->
exponent1
.
cbData
!=
halflen
)
||
(
decodedKey
->
exponent2
.
cbData
!=
halflen
)
||
(
decodedKey
->
coefficient
.
cbData
!=
halflen
)
||
(
decodedKey
->
privexp
.
cbData
!=
halflen
*
2
))
{
ret
=
FALSE
;
SetLastError
(
CRYPT_E_BAD_ENCODE
);
}
halflen
=
decodedKey
->
prime1
.
cbData
;
if
(
halflen
<
decodedKey
->
prime2
.
cbData
)
halflen
=
decodedKey
->
prime2
.
cbData
;
if
(
halflen
<
decodedKey
->
exponent1
.
cbData
)
halflen
=
decodedKey
->
exponent1
.
cbData
;
if
(
halflen
<
decodedKey
->
exponent2
.
cbData
)
halflen
=
decodedKey
->
exponent2
.
cbData
;
if
(
halflen
<
decodedKey
->
coefficient
.
cbData
)
halflen
=
decodedKey
->
coefficient
.
cbData
;
if
(
halflen
*
2
<
decodedKey
->
modulus
.
cbData
)
halflen
=
decodedKey
->
modulus
.
cbData
/
2
+
decodedKey
->
modulus
.
cbData
%
2
;
if
(
halflen
*
2
<
decodedKey
->
privexp
.
cbData
)
halflen
=
decodedKey
->
privexp
.
cbData
/
2
+
decodedKey
->
privexp
.
cbData
%
2
;
if
(
ret
)
{
...
...
@@ -4048,20 +4049,21 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPrivKey(DWORD dwCertEncodingType,
rsaPubKey
->
bitlen
=
halflen
*
16
;
vardata
=
(
BYTE
*
)(
rsaPubKey
+
1
);
memset
(
vardata
,
0
,
halflen
*
9
);
memcpy
(
vardata
,
decodedKey
->
modulus
.
pbData
,
halflen
*
2
);
decodedKey
->
modulus
.
pbData
,
decodedKey
->
modulus
.
cbData
);
memcpy
(
vardata
+
halflen
*
2
,
decodedKey
->
prime1
.
pbData
,
halflen
);
decodedKey
->
prime1
.
pbData
,
decodedKey
->
prime1
.
cbData
);
memcpy
(
vardata
+
halflen
*
3
,
decodedKey
->
prime2
.
pbData
,
halflen
);
decodedKey
->
prime2
.
pbData
,
decodedKey
->
prime2
.
cbData
);
memcpy
(
vardata
+
halflen
*
4
,
decodedKey
->
exponent1
.
pbData
,
halflen
);
decodedKey
->
exponent1
.
pbData
,
decodedKey
->
exponent1
.
cbData
);
memcpy
(
vardata
+
halflen
*
5
,
decodedKey
->
exponent2
.
pbData
,
halflen
);
decodedKey
->
exponent2
.
pbData
,
decodedKey
->
exponent2
.
cbData
);
memcpy
(
vardata
+
halflen
*
6
,
decodedKey
->
coefficient
.
pbData
,
halflen
);
decodedKey
->
coefficient
.
pbData
,
decodedKey
->
coefficient
.
cbData
);
memcpy
(
vardata
+
halflen
*
7
,
decodedKey
->
privexp
.
pbData
,
halflen
*
2
);
decodedKey
->
privexp
.
pbData
,
decodedKey
->
privexp
.
cbData
);
}
}
...
...
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