Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
263f6ef2
Commit
263f6ef2
authored
Nov 14, 2018
by
Alexander Morozov
Committed by
Alexandre Julliard
Nov 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Use correct private key for signing.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dffb4705
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
crypt32_private.h
dlls/crypt32/crypt32_private.h
+1
-0
msg.c
dlls/crypt32/msg.c
+11
-2
No files found.
dlls/crypt32/crypt32_private.h
View file @
263f6ef2
...
...
@@ -116,6 +116,7 @@ typedef struct _CRYPT_SIGNED_INFO
CRYPT_CONTENT_INFO
content
;
DWORD
cSignerInfo
;
PCMSG_CMS_SIGNER_INFO
rgSignerInfo
;
PDWORD
signerKeySpec
;
}
CRYPT_SIGNED_INFO
;
BOOL
CRYPT_AsnEncodeCMSSignedInfo
(
CRYPT_SIGNED_INFO
*
,
void
*
pvData
,
...
...
dlls/crypt32/msg.c
View file @
263f6ef2
...
...
@@ -1130,12 +1130,15 @@ static BOOL CSignedMsgData_Sign(CSignedMsgData *msg_data)
for
(
i
=
0
;
ret
&&
i
<
msg_data
->
info
->
cSignerInfo
;
i
++
)
{
HCRYPTHASH
hash
;
DWORD
keySpec
=
msg_data
->
info
->
signerKeySpec
[
i
];
if
(
!
keySpec
)
keySpec
=
AT_SIGNATURE
;
if
(
msg_data
->
info
->
rgSignerInfo
[
i
].
AuthAttrs
.
cAttr
)
hash
=
msg_data
->
signerHandles
[
i
].
authAttrHash
;
else
hash
=
msg_data
->
signerHandles
[
i
].
contentHash
;
ret
=
CryptSignHashW
(
hash
,
AT_SIGNATURE
,
NULL
,
0
,
NULL
,
ret
=
CryptSignHashW
(
hash
,
keySpec
,
NULL
,
0
,
NULL
,
&
msg_data
->
info
->
rgSignerInfo
[
i
].
EncryptedHash
.
cbData
);
if
(
ret
)
{
...
...
@@ -1144,7 +1147,7 @@ static BOOL CSignedMsgData_Sign(CSignedMsgData *msg_data)
msg_data
->
info
->
rgSignerInfo
[
i
].
EncryptedHash
.
cbData
);
if
(
msg_data
->
info
->
rgSignerInfo
[
i
].
EncryptedHash
.
pbData
)
{
ret
=
CryptSignHashW
(
hash
,
AT_SIGNATURE
,
NULL
,
0
,
ret
=
CryptSignHashW
(
hash
,
keySpec
,
NULL
,
0
,
msg_data
->
info
->
rgSignerInfo
[
i
].
EncryptedHash
.
pbData
,
&
msg_data
->
info
->
rgSignerInfo
[
i
].
EncryptedHash
.
cbData
);
if
(
ret
)
...
...
@@ -1194,6 +1197,7 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg)
for
(
i
=
0
;
i
<
msg
->
msg_data
.
info
->
cSignerInfo
;
i
++
)
CSignerInfo_Free
(
&
msg
->
msg_data
.
info
->
rgSignerInfo
[
i
]);
CSignedMsgData_CloseHandles
(
&
msg
->
msg_data
);
CryptMemFree
(
msg
->
msg_data
.
info
->
signerKeySpec
);
CryptMemFree
(
msg
->
msg_data
.
info
->
rgSignerInfo
);
CryptMemFree
(
msg
->
msg_data
.
info
);
}
...
...
@@ -1416,6 +1420,9 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
msg
->
msg_data
.
info
->
cSignerInfo
*
sizeof
(
CMSG_CMS_SIGNER_INFO
));
ret
=
CSignedMsgData_AllocateHandles
(
&
msg
->
msg_data
);
msg
->
msg_data
.
info
->
signerKeySpec
=
CryptMemAlloc
(
info
->
cSigners
*
sizeof
(
DWORD
));
if
(
!
msg
->
msg_data
.
info
->
signerKeySpec
)
ret
=
FALSE
;
for
(
i
=
0
;
ret
&&
i
<
msg
->
msg_data
.
info
->
cSignerInfo
;
i
++
)
{
if
(
info
->
rgSigners
[
i
].
SignerId
.
dwIdChoice
==
...
...
@@ -1432,6 +1439,8 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
CryptReleaseContext
(
info
->
rgSigners
[
i
].
hCryptProv
,
0
);
}
msg
->
msg_data
.
info
->
signerKeySpec
[
i
]
=
info
->
rgSigners
[
i
].
dwKeySpec
;
}
}
else
...
...
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