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
e52c80e5
Commit
e52c80e5
authored
Aug 21, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Aug 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Test and implement CryptGetMessageSignerCount.
parent
b9038be1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletion
+63
-1
crypt32.spec
dlls/crypt32/crypt32.spec
+1
-1
msg.c
dlls/crypt32/msg.c
+22
-0
msg.c
dlls/crypt32/tests/msg.c
+40
-0
No files found.
dlls/crypt32/crypt32.spec
View file @
e52c80e5
...
...
@@ -123,7 +123,7 @@
@ stdcall CryptGetDefaultOIDDllList(long long ptr ptr)
@ stdcall CryptGetDefaultOIDFunctionAddress(long long wstr long ptr ptr)
@ stdcall CryptGetMessageCertificates(long ptr long ptr long)
@ st
ub CryptGetMessageSignerCount
@ st
dcall CryptGetMessageSignerCount(long ptr long)
@ stdcall CryptGetOIDFunctionAddress(long long str long ptr ptr)
@ stdcall CryptGetOIDFunctionValue(long str str wstr ptr ptr ptr)
@ stdcall CryptHashCertificate(long long long ptr long ptr ptr)
...
...
dlls/crypt32/msg.c
View file @
e52c80e5
...
...
@@ -2286,3 +2286,25 @@ HCERTSTORE WINAPI CryptGetMessageCertificates(DWORD dwMsgAndCertEncodingType,
return
CertOpenStore
(
CERT_STORE_PROV_PKCS7
,
dwMsgAndCertEncodingType
,
hCryptProv
,
dwFlags
,
&
blob
);
}
LONG
WINAPI
CryptGetMessageSignerCount
(
DWORD
dwMsgEncodingType
,
const
BYTE
*
pbSignedBlob
,
DWORD
cbSignedBlob
)
{
HCRYPTMSG
msg
;
LONG
count
=
-
1
;
TRACE
(
"(%08x, %p, %d)
\n
"
,
dwMsgEncodingType
,
pbSignedBlob
,
cbSignedBlob
);
msg
=
CryptMsgOpenToDecode
(
dwMsgEncodingType
,
0
,
0
,
0
,
NULL
,
NULL
);
if
(
msg
)
{
if
(
CryptMsgUpdate
(
msg
,
pbSignedBlob
,
cbSignedBlob
,
TRUE
))
{
DWORD
size
=
sizeof
(
count
);
CryptMsgGetParam
(
msg
,
CMSG_SIGNER_COUNT_PARAM
,
0
,
&
count
,
&
size
);
}
CryptMsgClose
(
msg
);
}
return
count
;
}
dlls/crypt32/tests/msg.c
View file @
e52c80e5
...
...
@@ -2347,6 +2347,43 @@ static void test_msg_control(void)
/* FIXME: need to test with a message with a valid signature and signer */
}
static
void
test_msg_get_signer_count
(
void
)
{
LONG
count
;
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
0
,
NULL
,
0
);
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
NULL
,
0
);
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
"Expected CRYPT_E_ASN1_EOD, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
dataEmptyBareContent
,
sizeof
(
dataEmptyBareContent
));
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
,
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
dataEmptyContent
,
sizeof
(
dataEmptyContent
));
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_INVALID_MSG_TYPE
,
"Expected CRYPT_E_INVALID_MSG_TYPE, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
signedEmptyBareContent
,
sizeof
(
signedEmptyBareContent
));
ok
(
count
==
-
1
,
"Expected -1, got %d
\n
"
,
count
);
ok
(
GetLastError
()
==
CRYPT_E_ASN1_BADTAG
,
"Expected CRYPT_E_ASN1_BADTAG, got %08x
\n
"
,
GetLastError
());
count
=
CryptGetMessageSignerCount
(
PKCS_7_ASN_ENCODING
,
signedEmptyContent
,
sizeof
(
signedEmptyContent
));
ok
(
count
==
1
,
"Expected 1, got %d
\n
"
,
count
);
}
START_TEST
(
msg
)
{
init_function_pointers
();
...
...
@@ -2363,4 +2400,7 @@ START_TEST(msg)
test_hash_msg
();
test_signed_msg
();
test_decode_msg
();
/* simplified message functions */
test_msg_get_signer_count
();
}
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