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
5e9299d9
Commit
5e9299d9
authored
Aug 20, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Aug 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Use signed message data type for decoded signed messages.
parent
77489057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
35 deletions
+37
-35
msg.c
dlls/crypt32/msg.c
+37
-35
No files found.
dlls/crypt32/msg.c
View file @
5e9299d9
...
...
@@ -1278,8 +1278,8 @@ typedef struct _CDecodeMsg
DWORD
type
;
HCRYPTPROV
crypt_prov
;
union
{
HCRYPTHASH
hash
;
C
RYPT_SIGNED_INFO
*
signedInfo
;
HCRYPTHASH
hash
;
C
SignedMsgData
signed_data
;
}
u
;
CRYPT_DATA_BLOB
msg_data
;
PCONTEXT_PROPERTY_LIST
properties
;
...
...
@@ -1298,7 +1298,8 @@ static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg)
CryptDestroyHash
(
msg
->
u
.
hash
);
break
;
case
CMSG_SIGNED
:
LocalFree
(
msg
->
u
.
signedInfo
);
if
(
msg
->
u
.
signed_data
.
info
)
LocalFree
(
msg
->
u
.
signed_data
.
info
);
break
;
}
CryptMemFree
(
msg
->
msg_data
.
pbData
);
...
...
@@ -1433,7 +1434,7 @@ static BOOL CDecodeMsg_DecodeSignedContent(CDecodeMsg *msg,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
CRYPT_SIGNED_INFO
*
)
&
signedInfo
,
&
size
);
if
(
ret
)
msg
->
u
.
signed
I
nfo
=
signedInfo
;
msg
->
u
.
signed
_data
.
i
nfo
=
signedInfo
;
return
ret
;
}
/* Decodes the content in blob as the type given, and updates the value
...
...
@@ -1778,16 +1779,17 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
&
msg
->
type
,
sizeof
(
msg
->
type
));
break
;
case
CMSG_CONTENT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
{
if
(
!
strcmp
(
msg
->
u
.
signedInfo
->
content
.
pszObjId
,
szOID_RSA_data
))
if
(
!
strcmp
(
msg
->
u
.
signed_data
.
info
->
content
.
pszObjId
,
szOID_RSA_data
))
{
CRYPT_DATA_BLOB
*
blob
;
DWORD
size
;
ret
=
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_OCTET_STRING
,
msg
->
u
.
signed
I
nfo
->
content
.
Content
.
pbData
,
msg
->
u
.
signed
I
nfo
->
content
.
Content
.
cbData
,
msg
->
u
.
signed
_data
.
i
nfo
->
content
.
Content
.
pbData
,
msg
->
u
.
signed
_data
.
i
nfo
->
content
.
Content
.
cbData
,
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
LPBYTE
)
&
blob
,
&
size
);
if
(
ret
)
{
...
...
@@ -1798,93 +1800,93 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
}
else
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
msg
->
u
.
signed
I
nfo
->
content
.
Content
.
pbData
,
msg
->
u
.
signed
I
nfo
->
content
.
Content
.
cbData
);
msg
->
u
.
signed
_data
.
i
nfo
->
content
.
Content
.
pbData
,
msg
->
u
.
signed
_data
.
i
nfo
->
content
.
Content
.
cbData
);
}
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_INNER_CONTENT_TYPE_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
msg
->
u
.
signed
I
nfo
->
content
.
pszObjId
,
strlen
(
msg
->
u
.
signed
I
nfo
->
content
.
pszObjId
)
+
1
);
msg
->
u
.
signed
_data
.
i
nfo
->
content
.
pszObjId
,
strlen
(
msg
->
u
.
signed
_data
.
i
nfo
->
content
.
pszObjId
)
+
1
);
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_SIGNER_COUNT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
&
msg
->
u
.
signed
I
nfo
->
cSignerInfo
,
sizeof
(
DWORD
));
&
msg
->
u
.
signed
_data
.
i
nfo
->
cSignerInfo
,
sizeof
(
DWORD
));
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_SIGNER_INFO_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
{
if
(
dwIndex
>=
msg
->
u
.
signed
I
nfo
->
cSignerInfo
)
if
(
dwIndex
>=
msg
->
u
.
signed
_data
.
i
nfo
->
cSignerInfo
)
SetLastError
(
CRYPT_E_INVALID_INDEX
);
else
ret
=
CRYPT_CopySignerInfo
(
pvData
,
pcbData
,
&
msg
->
u
.
signed
I
nfo
->
rgSignerInfo
[
dwIndex
]);
&
msg
->
u
.
signed
_data
.
i
nfo
->
rgSignerInfo
[
dwIndex
]);
}
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_SIGNER_CERT_INFO_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
{
if
(
dwIndex
>=
msg
->
u
.
signed
I
nfo
->
cSignerInfo
)
if
(
dwIndex
>=
msg
->
u
.
signed
_data
.
i
nfo
->
cSignerInfo
)
SetLastError
(
CRYPT_E_INVALID_INDEX
);
else
ret
=
CRYPT_CopySignerCertInfo
(
pvData
,
pcbData
,
&
msg
->
u
.
signed
I
nfo
->
rgSignerInfo
[
dwIndex
]);
&
msg
->
u
.
signed
_data
.
i
nfo
->
rgSignerInfo
[
dwIndex
]);
}
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_CERT_COUNT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
&
msg
->
u
.
signed
I
nfo
->
cCertEncoded
,
sizeof
(
DWORD
));
&
msg
->
u
.
signed
_data
.
i
nfo
->
cCertEncoded
,
sizeof
(
DWORD
));
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_CERT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
{
if
(
dwIndex
>=
msg
->
u
.
signed
I
nfo
->
cCertEncoded
)
if
(
dwIndex
>=
msg
->
u
.
signed
_data
.
i
nfo
->
cCertEncoded
)
SetLastError
(
CRYPT_E_INVALID_INDEX
);
else
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
msg
->
u
.
signed
I
nfo
->
rgCertEncoded
[
dwIndex
].
pbData
,
msg
->
u
.
signed
I
nfo
->
rgCertEncoded
[
dwIndex
].
cbData
);
msg
->
u
.
signed
_data
.
i
nfo
->
rgCertEncoded
[
dwIndex
].
pbData
,
msg
->
u
.
signed
_data
.
i
nfo
->
rgCertEncoded
[
dwIndex
].
cbData
);
}
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_CRL_COUNT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
&
msg
->
u
.
signed
I
nfo
->
cCrlEncoded
,
sizeof
(
DWORD
));
&
msg
->
u
.
signed
_data
.
i
nfo
->
cCrlEncoded
,
sizeof
(
DWORD
));
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_CRL_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
{
if
(
dwIndex
>=
msg
->
u
.
signed
I
nfo
->
cCrlEncoded
)
if
(
dwIndex
>=
msg
->
u
.
signed
_data
.
i
nfo
->
cCrlEncoded
)
SetLastError
(
CRYPT_E_INVALID_INDEX
);
else
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
msg
->
u
.
signed
I
nfo
->
rgCrlEncoded
[
dwIndex
].
pbData
,
msg
->
u
.
signed
I
nfo
->
rgCrlEncoded
[
dwIndex
].
cbData
);
msg
->
u
.
signed
_data
.
i
nfo
->
rgCrlEncoded
[
dwIndex
].
pbData
,
msg
->
u
.
signed
_data
.
i
nfo
->
rgCrlEncoded
[
dwIndex
].
cbData
);
}
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_ATTR_CERT_COUNT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
{
DWORD
attrCertCount
=
0
;
...
...
@@ -1895,7 +1897,7 @@ static BOOL CDecodeSignedMsg_GetParam(CDecodeMsg *msg, DWORD dwParamType,
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
case
CMSG_ATTR_CERT_PARAM
:
if
(
msg
->
u
.
signed
I
nfo
)
if
(
msg
->
u
.
signed
_data
.
i
nfo
)
SetLastError
(
CRYPT_E_INVALID_INDEX
);
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
...
...
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