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
0e90cb96
Commit
0e90cb96
authored
Jul 19, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jul 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Store (most) parameters of a decoded hash message.
parent
46a48c40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
20 deletions
+37
-20
msg.c
dlls/crypt32/msg.c
+37
-14
msg.c
dlls/crypt32/tests/msg.c
+0
-6
No files found.
dlls/crypt32/msg.c
View file @
0e90cb96
...
...
@@ -631,6 +631,24 @@ static BOOL CDecodeMsg_CopyData(CDecodeMsg *msg, const BYTE *pbData,
return
ret
;
}
static
BOOL
CDecodeMsg_DecodeDataContent
(
CDecodeMsg
*
msg
,
CRYPT_DER_BLOB
*
blob
)
{
BOOL
ret
;
CRYPT_DATA_BLOB
*
data
;
DWORD
size
;
ret
=
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_OCTET_STRING
,
blob
->
pbData
,
blob
->
cbData
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
LPBYTE
)
&
data
,
&
size
);
if
(
ret
)
{
ret
=
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_CONTENT_PARAM
,
data
->
pbData
,
data
->
cbData
);
LocalFree
(
data
);
}
return
ret
;
}
/* Decodes the content in blob as the type given, and updates the value
* (type, parameters, etc.) of msg based on what blob contains.
* It doesn't just use msg's type, to allow a recursive call from an implicitly
...
...
@@ -645,21 +663,9 @@ static BOOL CDecodeMsg_DecodeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob,
switch
(
type
)
{
case
CMSG_DATA
:
{
CRYPT_DATA_BLOB
*
data
;
ret
=
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_OCTET_STRING
,
blob
->
pbData
,
blob
->
cbData
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
LPBYTE
)
&
data
,
&
size
);
if
(
ret
)
{
ret
=
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_CONTENT_PARAM
,
data
->
pbData
,
data
->
cbData
);
LocalFree
(
data
);
if
((
ret
=
CDecodeMsg_DecodeDataContent
(
msg
,
blob
)))
msg
->
type
=
CMSG_DATA
;
}
break
;
}
case
CMSG_HASHED
:
{
CRYPT_DIGESTED_DATA
*
digestedData
;
...
...
@@ -669,7 +675,24 @@ static BOOL CDecodeMsg_DecodeContent(CDecodeMsg *msg, CRYPT_DER_BLOB *blob,
&
size
);
if
(
ret
)
{
FIXME
(
"need to store data for CMSG_HASHED
\n
"
);
msg
->
type
=
CMSG_HASHED
;
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_VERSION_PARAM
,
(
const
BYTE
*
)
&
digestedData
->
version
,
sizeof
(
digestedData
->
version
));
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_INNER_CONTENT_TYPE_PARAM
,
(
const
BYTE
*
)
digestedData
->
ContentInfo
.
pszObjId
,
digestedData
->
ContentInfo
.
pszObjId
?
strlen
(
digestedData
->
ContentInfo
.
pszObjId
)
+
1
:
0
);
if
(
digestedData
->
ContentInfo
.
Content
.
cbData
)
CDecodeMsg_DecodeDataContent
(
msg
,
&
digestedData
->
ContentInfo
.
Content
);
else
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_CONTENT_PARAM
,
NULL
,
0
);
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_HASH_DATA_PARAM
,
digestedData
->
hash
.
pbData
,
digestedData
->
hash
.
cbData
);
LocalFree
(
digestedData
);
}
break
;
...
...
dlls/crypt32/tests/msg.c
View file @
0e90cb96
...
...
@@ -1222,9 +1222,7 @@ static void test_decode_msg_get_param(void)
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
0
,
0
,
NULL
,
NULL
);
ret
=
CryptMsgUpdate
(
msg
,
hashEmptyContent
,
sizeof
(
hashEmptyContent
),
TRUE
);
todo_wine
check_param
(
"empty hash content"
,
msg
,
CMSG_CONTENT_PARAM
,
NULL
,
0
);
todo_wine
check_param
(
"empty hash hash data"
,
msg
,
CMSG_HASH_DATA_PARAM
,
NULL
,
0
);
todo_wine
check_param
(
"empty hash computed hash"
,
msg
,
CMSG_COMPUTED_HASH_PARAM
,
...
...
@@ -1232,21 +1230,17 @@ static void test_decode_msg_get_param(void)
CryptMsgClose
(
msg
);
msg
=
CryptMsgOpenToDecode
(
PKCS_7_ASN_ENCODING
,
0
,
0
,
0
,
NULL
,
NULL
);
ret
=
CryptMsgUpdate
(
msg
,
hashContent
,
sizeof
(
hashContent
),
TRUE
);
todo_wine
check_param
(
"hash content"
,
msg
,
CMSG_CONTENT_PARAM
,
msgData
,
sizeof
(
msgData
));
todo_wine
check_param
(
"hash hash data"
,
msg
,
CMSG_HASH_DATA_PARAM
,
hashParam
,
sizeof
(
hashParam
));
todo_wine
check_param
(
"hash computed hash"
,
msg
,
CMSG_COMPUTED_HASH_PARAM
,
hashParam
,
sizeof
(
hashParam
));
size
=
strlen
(
szOID_RSA_data
)
+
1
;
todo_wine
check_param
(
"hash inner OID"
,
msg
,
CMSG_INNER_CONTENT_TYPE_PARAM
,
(
const
BYTE
*
)
szOID_RSA_data
,
strlen
(
szOID_RSA_data
)
+
1
);
version
=
CMSG_HASHED_DATA_V0
;
todo_wine
check_param
(
"hash version"
,
msg
,
CMSG_VERSION_PARAM
,
(
const
BYTE
*
)
&
version
,
sizeof
(
version
));
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