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
595bae3e
Commit
595bae3e
authored
Aug 20, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Test and correct encoding of signed CMS messages.
parent
282eb73b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
msg.c
dlls/crypt32/msg.c
+3
-0
msg.c
dlls/crypt32/tests/msg.c
+23
-0
No files found.
dlls/crypt32/msg.c
View file @
595bae3e
...
...
@@ -1381,6 +1381,9 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
ret
=
CSignedMsgData_AllocateHandles
(
&
msg
->
msg_data
);
for
(
i
=
0
;
ret
&&
i
<
msg
->
msg_data
.
info
->
cSignerInfo
;
i
++
)
{
if
(
info
->
rgSigners
[
i
].
SignerId
.
dwIdChoice
==
CERT_ID_KEY_IDENTIFIER
)
msg
->
msg_data
.
info
->
version
=
CMSG_SIGNED_DATA_V3
;
ret
=
CSignerInfo_Construct
(
&
msg
->
msg_data
.
info
->
rgSignerInfo
[
i
],
&
info
->
rgSigners
[
i
]);
...
...
dlls/crypt32/tests/msg.c
View file @
595bae3e
...
...
@@ -1341,6 +1341,12 @@ static const BYTE signedContent[] = {
static
const
BYTE
signedHash
[]
=
{
0x08
,
0xd6
,
0xc0
,
0x5a
,
0x21
,
0x51
,
0x2a
,
0x79
,
0xa1
,
0xdf
,
0xeb
,
0x9d
,
0x2a
,
0x8f
,
0x26
,
0x2f
};
static
const
BYTE
signedKeyIdEmptyContent
[]
=
{
0x30
,
0x46
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x07
,
0x02
,
0xa0
,
0x39
,
0x30
,
0x37
,
0x02
,
0x01
,
0x03
,
0x31
,
0x0e
,
0x30
,
0x0c
,
0x06
,
0x08
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x02
,
0x05
,
0x05
,
0x00
,
0x30
,
0x02
,
0x06
,
0x00
,
0x31
,
0x1e
,
0x30
,
0x1c
,
0x02
,
0x01
,
0x03
,
0x80
,
0x01
,
0x01
,
0x30
,
0x0c
,
0x06
,
0x08
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x02
,
0x05
,
0x05
,
0x00
,
0x30
,
0x04
,
0x06
,
0x00
,
0x05
,
0x00
,
0x04
,
0x00
};
static
const
BYTE
signedEncodedSigner
[]
=
{
0x30
,
0x75
,
0x02
,
0x01
,
0x01
,
0x30
,
0x1a
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
0x61
,
0x6e
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
...
...
@@ -1652,6 +1658,23 @@ static void test_signed_msg_encoding(void)
CryptMsgClose
(
msg
);
certInfo
.
SerialNumber
.
cbData
=
0
;
certInfo
.
Issuer
.
cbData
=
0
;
signer
.
SignerId
.
dwIdChoice
=
CERT_ID_KEY_IDENTIFIER
;
signer
.
SignerId
.
KeyId
.
cbData
=
sizeof
(
serialNum
);
signer
.
SignerId
.
KeyId
.
pbData
=
(
BYTE
*
)
serialNum
;
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
check_param
(
"signed key id empty content"
,
msg
,
CMSG_CONTENT_PARAM
,
signedKeyIdEmptyContent
,
sizeof
(
signedKeyIdEmptyContent
));
CryptMsgClose
(
msg
);
certInfo
.
SerialNumber
.
cbData
=
sizeof
(
serialNum
);
certInfo
.
SerialNumber
.
pbData
=
serialNum
;
certInfo
.
Issuer
.
cbData
=
sizeof
(
encodedCommonName
);
certInfo
.
Issuer
.
pbData
=
encodedCommonName
;
signer
.
SignerId
.
dwIdChoice
=
0
;
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
...
...
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