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
263f424c
Commit
263f424c
authored
Jun 28, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jun 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement getting bare content for data messages opened to encode.
parent
d1f37934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
msg.c
dlls/crypt32/msg.c
+19
-1
msg.c
dlls/crypt32/tests/msg.c
+5
-10
No files found.
dlls/crypt32/msg.c
View file @
263f424c
...
...
@@ -112,14 +112,32 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
static
BOOL
CDataEncodeMsg_GetParam
(
HCRYPTMSG
hCryptMsg
,
DWORD
dwParamType
,
DWORD
dwIndex
,
void
*
pvData
,
DWORD
*
pcbData
)
{
CDataEncodeMsg
*
msg
=
(
CDataEncodeMsg
*
)
hCryptMsg
;
BOOL
ret
=
FALSE
;
switch
(
dwParamType
)
{
case
CMSG_CONTENT_PARAM
:
case
CMSG_BARE_CONTENT_PARAM
:
FIXME
(
"stub
\n
"
);
break
;
case
CMSG_BARE_CONTENT_PARAM
:
if
(
!
pvData
)
{
*
pcbData
=
msg
->
bare_content_len
;
ret
=
TRUE
;
}
else
if
(
*
pcbData
<
msg
->
bare_content_len
)
{
*
pcbData
=
msg
->
bare_content_len
;
SetLastError
(
ERROR_MORE_DATA
);
}
else
{
*
pcbData
=
msg
->
bare_content_len
;
memcpy
(
pvData
,
msg
->
bare_content
,
msg
->
bare_content_len
);
ret
=
TRUE
;
}
break
;
default:
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
}
...
...
dlls/crypt32/tests/msg.c
View file @
263f424c
...
...
@@ -384,12 +384,11 @@ static void test_data_msg_get_param(void)
/* Content and bare content are always gettable */
size
=
0
;
ret
=
CryptMsgGetParam
(
msg
,
CMSG_CONTENT_PARAM
,
0
,
NULL
,
&
size
);
todo_wine
{
todo_wine
ok
(
ret
,
"CryptMsgGetParam failed: %08x
\n
"
,
GetLastError
());
size
=
0
;
ret
=
CryptMsgGetParam
(
msg
,
CMSG_BARE_CONTENT_PARAM
,
0
,
NULL
,
&
size
);
ok
(
ret
,
"CryptMsgGetParam failed: %08x
\n
"
,
GetLastError
());
}
/* But for this type of message, the signer and hash aren't applicable,
* and the type isn't available.
*/
...
...
@@ -425,38 +424,34 @@ static void test_data_msg_encoding(void)
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_DATA
,
NULL
,
NULL
,
NULL
);
todo_wine
{
check_param
(
"data empty bare content"
,
msg
,
CMSG_BARE_CONTENT_PARAM
,
dataEmptyBareContent
,
sizeof
(
dataEmptyBareContent
));
todo_wine
check_param
(
"data empty content"
,
msg
,
CMSG_CONTENT_PARAM
,
dataEmptyContent
,
sizeof
(
dataEmptyContent
));
}
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %x
\n
"
,
GetLastError
());
todo_wine
{
check_param
(
"data bare content"
,
msg
,
CMSG_BARE_CONTENT_PARAM
,
dataBareContent
,
sizeof
(
dataBareContent
));
todo_wine
check_param
(
"data content"
,
msg
,
CMSG_CONTENT_PARAM
,
dataContent
,
sizeof
(
dataContent
));
}
CryptMsgClose
(
msg
);
/* Same test, but with CMSG_BARE_CONTENT_FLAG set */
msg
=
CryptMsgOpenToEncode
(
PKCS_7_ASN_ENCODING
,
CMSG_BARE_CONTENT_FLAG
,
CMSG_DATA
,
NULL
,
NULL
,
NULL
);
todo_wine
{
check_param
(
"data empty bare content"
,
msg
,
CMSG_BARE_CONTENT_PARAM
,
dataEmptyBareContent
,
sizeof
(
dataEmptyBareContent
));
todo_wine
check_param
(
"data empty content"
,
msg
,
CMSG_CONTENT_PARAM
,
dataEmptyContent
,
sizeof
(
dataEmptyContent
));
}
ret
=
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
ok
(
ret
,
"CryptMsgUpdate failed: %x
\n
"
,
GetLastError
());
todo_wine
{
check_param
(
"data bare content"
,
msg
,
CMSG_BARE_CONTENT_PARAM
,
dataBareContent
,
sizeof
(
dataBareContent
));
todo_wine
check_param
(
"data content"
,
msg
,
CMSG_CONTENT_PARAM
,
dataContent
,
sizeof
(
dataContent
));
}
CryptMsgClose
(
msg
);
}
...
...
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