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
6bd4bf66
Commit
6bd4bf66
authored
Sep 01, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix compilation on systems that don't support nameless unions.
parent
360c164e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
74 deletions
+75
-74
msg.c
dlls/crypt32/msg.c
+39
-38
encode.c
dlls/crypt32/tests/encode.c
+0
-0
msg.c
dlls/crypt32/tests/msg.c
+36
-36
No files found.
dlls/crypt32/msg.c
View file @
6bd4bf66
This diff is collapsed.
Click to expand it.
dlls/crypt32/tests/encode.c
View file @
6bd4bf66
This diff is collapsed.
Click to expand it.
dlls/crypt32/tests/msg.c
View file @
6bd4bf66
...
...
@@ -1112,13 +1112,13 @@ static void test_signed_msg_open(void)
certInfo
.
Issuer
.
cbData
=
0
;
certInfo
.
SerialNumber
.
cbData
=
0
;
signer
.
SignerId
.
dwIdChoice
=
CERT_ID_ISSUER_SERIAL_NUMBER
;
signer
.
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
=
sizeof
(
encodedCommonName
);
signer
.
SignerId
.
IssuerSerialNumber
.
Issuer
.
pbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
pbData
=
(
BYTE
*
)
encodedCommonName
;
signer
.
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
=
sizeof
(
serialNum
);
signer
.
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
pbData
=
(
BYTE
*
)
serialNum
;
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
pbData
=
(
BYTE
*
)
serialNum
;
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_SIGNED
,
&
signInfo
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToEncode failed: %x
\n
"
,
GetLastError
());
...
...
@@ -1661,8 +1661,8 @@ static void test_signed_msg_encoding(void)
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
;
U
(
signer
.
SignerId
)
.
KeyId
.
cbData
=
sizeof
(
serialNum
);
U
(
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
());
...
...
@@ -1888,13 +1888,13 @@ static void test_signed_msg_get_param(void)
certInfo
.
SerialNumber
.
cbData
=
0
;
certInfo
.
Issuer
.
cbData
=
0
;
signer
.
SignerId
.
dwIdChoice
=
CERT_ID_ISSUER_SERIAL_NUMBER
;
signer
.
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
=
sizeof
(
encodedCommonName
);
signer
.
SignerId
.
IssuerSerialNumber
.
Issuer
.
pbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
pbData
=
(
BYTE
*
)
encodedCommonName
;
signer
.
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
=
sizeof
(
serialNum
);
signer
.
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
pbData
=
(
BYTE
*
)
serialNum
;
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
pbData
=
(
BYTE
*
)
serialNum
;
ret
=
pCryptAcquireContextA
(
&
signer
.
hCryptProv
,
cspNameA
,
NULL
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
if
(
!
ret
&&
GetLastError
()
==
NTE_EXISTS
)
...
...
@@ -1933,8 +1933,8 @@ static void test_signed_msg_get_param(void)
* the CMS version.
*/
signer
.
SignerId
.
dwIdChoice
=
CERT_ID_KEY_IDENTIFIER
;
signer
.
SignerId
.
KeyId
.
cbData
=
sizeof
(
serialNum
);
signer
.
SignerId
.
KeyId
.
pbData
=
(
BYTE
*
)
serialNum
;
U
(
signer
.
SignerId
)
.
KeyId
.
cbData
=
sizeof
(
serialNum
);
U
(
signer
.
SignerId
)
.
KeyId
.
pbData
=
(
BYTE
*
)
serialNum
;
ret
=
pCryptAcquireContextA
(
&
signer
.
hCryptProv
,
cspNameA
,
NULL
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
if
(
!
ret
&&
GetLastError
()
==
NTE_EXISTS
)
...
...
@@ -2291,32 +2291,32 @@ static void compare_cms_signer_info(const CMSG_CMS_SIGNER_INFO *got,
{
if
(
got
->
SignerId
.
dwIdChoice
==
CERT_ID_ISSUER_SERIAL_NUMBER
)
{
ok
(
got
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
==
expected
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
,
ok
(
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
==
U
(
expected
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
,
"Expected issuer size %d, got %d
\n
"
,
expected
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
,
got
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
);
ok
(
!
memcmp
(
got
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
pbData
,
expected
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
pbData
,
got
->
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
),
U
(
expected
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
,
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
);
ok
(
!
memcmp
(
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
pbData
,
U
(
expected
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
pbData
,
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
),
"Unexpected issuer
\n
"
);
ok
(
got
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
==
expected
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
,
ok
(
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
==
U
(
expected
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
,
"Expected serial number size %d, got %d
\n
"
,
expected
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
,
got
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
);
ok
(
!
memcmp
(
got
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
pbData
,
expected
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
pbData
,
got
->
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
),
U
(
expected
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
,
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
);
ok
(
!
memcmp
(
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
pbData
,
U
(
expected
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
pbData
,
U
(
got
->
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
),
"Unexpected serial number
\n
"
);
}
else
{
ok
(
got
->
SignerId
.
KeyId
.
cbData
==
expected
->
SignerId
.
KeyId
.
cbData
,
ok
(
U
(
got
->
SignerId
).
KeyId
.
cbData
==
U
(
expected
->
SignerId
)
.
KeyId
.
cbData
,
"expected key id size %d, got %d
\n
"
,
expected
->
SignerId
.
KeyId
.
cbData
,
got
->
SignerId
.
KeyId
.
cbData
);
ok
(
!
memcmp
(
expected
->
SignerId
.
KeyId
.
pbData
,
got
->
SignerId
.
KeyId
.
pbData
,
got
->
SignerId
.
KeyId
.
cbData
),
U
(
expected
->
SignerId
).
KeyId
.
cbData
,
U
(
got
->
SignerId
)
.
KeyId
.
cbData
);
ok
(
!
memcmp
(
U
(
expected
->
SignerId
)
.
KeyId
.
pbData
,
U
(
got
->
SignerId
).
KeyId
.
pbData
,
U
(
got
->
SignerId
)
.
KeyId
.
cbData
),
"unexpected key id
\n
"
);
}
}
...
...
@@ -2429,12 +2429,12 @@ static void test_decode_msg_get_param(void)
signer
.
dwVersion
=
1
;
signer
.
SignerId
.
dwIdChoice
=
CERT_ID_ISSUER_SERIAL_NUMBER
;
signer
.
SignerId
.
IssuerSerialNumber
.
Issuer
.
cbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
cbData
=
sizeof
(
encodedCommonName
);
signer
.
SignerId
.
IssuerSerialNumber
.
Issuer
.
pbData
=
encodedCommonName
;
signer
.
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
cbData
=
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
Issuer
.
pbData
=
encodedCommonName
;
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
cbData
=
sizeof
(
serialNum
);
signer
.
SignerId
.
IssuerSerialNumber
.
SerialNumber
.
pbData
=
serialNum
;
U
(
signer
.
SignerId
)
.
IssuerSerialNumber
.
SerialNumber
.
pbData
=
serialNum
;
signer
.
HashAlgorithm
.
pszObjId
=
oid_rsa_md5
;
CryptMsgGetParam
(
msg
,
CMSG_CMS_SIGNER_INFO_PARAM
,
0
,
buf
,
&
size
);
compare_cms_signer_info
((
CMSG_CMS_SIGNER_INFO
*
)
buf
,
&
signer
);
...
...
@@ -2521,8 +2521,8 @@ static void test_decode_msg_get_param(void)
signer
.
dwVersion
=
CMSG_SIGNED_DATA_V3
;
signer
.
SignerId
.
dwIdChoice
=
CERT_ID_KEY_IDENTIFIER
;
signer
.
SignerId
.
KeyId
.
cbData
=
sizeof
(
serialNum
);
signer
.
SignerId
.
KeyId
.
pbData
=
(
BYTE
*
)
serialNum
;
U
(
signer
.
SignerId
)
.
KeyId
.
cbData
=
sizeof
(
serialNum
);
U
(
signer
.
SignerId
)
.
KeyId
.
pbData
=
(
BYTE
*
)
serialNum
;
signer
.
HashAlgorithm
.
pszObjId
=
oid_rsa_md5
;
CryptMsgGetParam
(
msg
,
CMSG_CMS_SIGNER_INFO_PARAM
,
0
,
buf
,
&
size
);
compare_cms_signer_info
((
CMSG_CMS_SIGNER_INFO
*
)
buf
,
&
signer
);
...
...
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