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
07297ea9
Commit
07297ea9
authored
Feb 10, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Feb 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: In more recent Windows versions, updating a data message with no content succeeds.
parent
14626a78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
13 deletions
+30
-13
msg.c
dlls/crypt32/tests/msg.c
+30
-13
No files found.
dlls/crypt32/tests/msg.c
View file @
07297ea9
...
...
@@ -365,6 +365,8 @@ static BOOL WINAPI nop_stream_output(const void *pvArg, BYTE *pb, DWORD cb,
return
TRUE
;
}
static
const
BYTE
dataEmptyBareContent
[]
=
{
0x04
,
0x00
};
static
void
test_data_msg_update
(
void
)
{
HCRYPTMSG
msg
;
...
...
@@ -390,20 +392,36 @@ static void test_data_msg_update(void)
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_DATA
,
NULL
,
NULL
,
NULL
);
/* Can't update a message with no data */
SetLastError
(
0xdeadbeef
);
/* Starting with Vista, can update a message with no data. */
ret
=
CryptMsgUpdate
(
msg
,
NULL
,
0
,
TRUE
);
/* This test returns FALSE on XP and earlier but TRUE on Vista, so can't be tested.
* GetLastError is either E_INVALIDARG (NT) or unset (9x/Vista), so it doesn't
* make sense to test this.
*/
todo_wine
ok
(
ret
||
broken
(
!
ret
),
"CryptMsgUpdate failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
DWORD
size
;
/* Curiously, a valid update will now fail as well, presumably because of
* the last (invalid, but final) update.
*/
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_MSG_ERROR
,
"Expected CRYPT_E_MSG_ERROR, got %x
\n
"
,
GetLastError
());
ret
=
CryptMsgGetParam
(
msg
,
CMSG_BARE_CONTENT_PARAM
,
0
,
NULL
,
&
size
);
ok
(
ret
,
"CryptMsgGetParam failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
LPBYTE
buf
=
CryptMemAlloc
(
size
);
if
(
buf
)
{
ret
=
CryptMsgGetParam
(
msg
,
CMSG_BARE_CONTENT_PARAM
,
0
,
buf
,
&
size
);
ok
(
ret
,
"CryptMsgGetParam failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
size
==
sizeof
(
dataEmptyBareContent
),
"unexpected size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
dataEmptyBareContent
,
size
),
"unexpected value
\n
"
);
}
CryptMemFree
(
buf
);
}
}
}
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
CMSG_DETACHED_FLAG
,
...
...
@@ -510,7 +528,6 @@ static void test_data_msg_get_param(void)
CryptMsgClose
(
msg
);
}
static
const
BYTE
dataEmptyBareContent
[]
=
{
0x04
,
0x00
};
static
const
BYTE
dataEmptyContent
[]
=
{
0x30
,
0x0f
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x07
,
0x01
,
0xa0
,
0x02
,
0x04
,
0x00
};
...
...
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