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
8ca75591
Commit
8ca75591
authored
Jul 09, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jul 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement getting the type of a decode message.
parent
656d960d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
msg.c
dlls/crypt32/msg.c
+28
-3
msg.c
dlls/crypt32/tests/msg.c
+0
-14
No files found.
dlls/crypt32/msg.c
View file @
8ca75591
...
...
@@ -269,9 +269,34 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
static
BOOL
CDecodeMsg_GetParam
(
HCRYPTMSG
hCryptMsg
,
DWORD
dwParamType
,
DWORD
dwIndex
,
void
*
pvData
,
DWORD
*
pcbData
)
{
FIXME
(
"(%p, %d, %d, %p, %p): stub
\n
"
,
hCryptMsg
,
dwParamType
,
dwIndex
,
pvData
,
pcbData
);
return
FALSE
;
CDecodeMsg
*
msg
=
(
CDecodeMsg
*
)
hCryptMsg
;
BOOL
ret
=
FALSE
;
switch
(
dwParamType
)
{
case
CMSG_TYPE_PARAM
:
if
(
!
pvData
)
{
*
pcbData
=
sizeof
(
DWORD
);
ret
=
TRUE
;
}
else
if
(
*
pcbData
<
sizeof
(
DWORD
))
{
*
pcbData
=
sizeof
(
DWORD
);
SetLastError
(
ERROR_MORE_DATA
);
}
else
{
*
pcbData
=
sizeof
(
DWORD
);
*
(
DWORD
*
)
pvData
=
msg
->
type
;
ret
=
TRUE
;
}
break
;
default:
FIXME
(
"unimplemented for parameter %d
\n
"
,
dwParamType
);
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
}
return
ret
;
}
HCRYPTMSG
WINAPI
CryptMsgOpenToDecode
(
DWORD
dwMsgEncodingType
,
DWORD
dwFlags
,
...
...
dlls/crypt32/tests/msg.c
View file @
8ca75591
...
...
@@ -155,14 +155,12 @@ static void test_msg_get_param(void)
/* For decoded messages, the type is always available */
size
=
0
;
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
NULL
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
/* For this (empty) message, the type isn't set */
ok
(
value
==
0
,
"Expected type 0, got %d
\n
"
,
value
);
}
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
CMSG_DATA
,
0
,
NULL
,
...
...
@@ -171,10 +169,8 @@ static void test_msg_get_param(void)
/* For explicitly typed messages, the type is known. */
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
ok
(
value
==
CMSG_DATA
,
"Expected CMSG_DATA, got %d
\n
"
,
value
);
}
for
(
i
=
CMSG_CONTENT_PARAM
;
i
<=
CMSG_CMS_SIGNER_INFO_PARAM
;
i
++
)
{
size
=
0
;
...
...
@@ -188,10 +184,8 @@ static void test_msg_get_param(void)
ok
(
msg
!=
NULL
,
"CryptMsgOpenToDecode failed: %x
\n
"
,
GetLastError
());
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
ok
(
value
==
CMSG_ENVELOPED
,
"Expected CMSG_ENVELOPED, got %d
\n
"
,
value
);
}
for
(
i
=
CMSG_CONTENT_PARAM
;
i
<=
CMSG_CMS_SIGNER_INFO_PARAM
;
i
++
)
{
size
=
0
;
...
...
@@ -205,10 +199,8 @@ static void test_msg_get_param(void)
ok
(
msg
!=
NULL
,
"CryptMsgOpenToDecode failed: %x
\n
"
,
GetLastError
());
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
ok
(
value
==
CMSG_HASHED
,
"Expected CMSG_HASHED, got %d
\n
"
,
value
);
}
for
(
i
=
CMSG_CONTENT_PARAM
;
i
<=
CMSG_CMS_SIGNER_INFO_PARAM
;
i
++
)
{
size
=
0
;
...
...
@@ -222,10 +214,8 @@ static void test_msg_get_param(void)
ok
(
msg
!=
NULL
,
"CryptMsgOpenToDecode failed: %x
\n
"
,
GetLastError
());
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
ok
(
value
==
CMSG_SIGNED
,
"Expected CMSG_SIGNED, got %d
\n
"
,
value
);
}
for
(
i
=
CMSG_CONTENT_PARAM
;
i
<=
CMSG_CMS_SIGNER_INFO_PARAM
;
i
++
)
{
size
=
0
;
...
...
@@ -240,20 +230,16 @@ static void test_msg_get_param(void)
ok
(
msg
!=
NULL
,
"CryptMsgOpenToDecode failed: %x
\n
"
,
GetLastError
());
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
ok
(
value
==
CMSG_ENCRYPTED
,
"Expected CMSG_ENCRYPTED, got %d
\n
"
,
value
);
}
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
1000
,
0
,
NULL
,
NULL
);
ok
(
msg
!=
NULL
,
"CryptMsgOpenToDecode failed: %x
\n
"
,
GetLastError
());
size
=
sizeof
(
value
);
ret
=
CryptMsgGetParam
(
msg
,
CMSG_TYPE_PARAM
,
0
,
(
LPBYTE
)
&
value
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptMsgGetParam failed: %x
\n
"
,
GetLastError
());
ok
(
value
==
1000
,
"Expected 1000, got %d
\n
"
,
value
);
}
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