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
f2df415a
Commit
f2df415a
authored
Jan 05, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jan 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Use specified inner content type for signed messages when it's given.
parent
3eb3033d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
15 deletions
+44
-15
msg.c
dlls/crypt32/msg.c
+44
-15
No files found.
dlls/crypt32/msg.c
View file @
f2df415a
...
...
@@ -1169,6 +1169,7 @@ static BOOL CSignedMsgData_Update(CSignedMsgData *msg_data,
typedef
struct
_CSignedEncodeMsg
{
CryptMsgBase
base
;
LPSTR
innerOID
;
CRYPT_DATA_BLOB
data
;
CSignedMsgData
msg_data
;
}
CSignedEncodeMsg
;
...
...
@@ -1178,6 +1179,7 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg)
CSignedEncodeMsg
*
msg
=
(
CSignedEncodeMsg
*
)
hCryptMsg
;
DWORD
i
;
CryptMemFree
(
msg
->
innerOID
);
CryptMemFree
(
msg
->
data
.
pbData
);
CRYPT_FreeBlobArray
((
BlobArray
*
)
&
msg
->
msg_data
.
info
->
cCertEncoded
);
CRYPT_FreeBlobArray
((
BlobArray
*
)
&
msg
->
msg_data
.
info
->
cCrlEncoded
);
...
...
@@ -1227,32 +1229,46 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
case
CMSG_BARE_CONTENT_PARAM
:
{
CRYPT_SIGNED_INFO
info
;
char
oid_rsa_data
[]
=
szOID_RSA_data
;
BOOL
freeContent
=
FALSE
;
info
=
*
msg
->
msg_data
.
info
;
/* Quirk: OID is only encoded messages if an update has happened */
if
(
msg
->
base
.
state
!=
MsgStateInit
)
info
.
content
.
pszObjId
=
oid_rsa_data
;
else
info
.
content
.
pszObjId
=
NULL
;
if
(
msg
->
data
.
cbData
)
if
(
!
msg
->
innerOID
||
!
strcmp
(
msg
->
innerOID
,
szOID_RSA_data
))
{
CRYPT_DATA_BLOB
blob
=
{
msg
->
data
.
cbData
,
msg
->
data
.
pbData
};
char
oid_rsa_data
[]
=
szOID_RSA_data
;
/* Quirk: OID is only encoded messages if an update has happened */
if
(
msg
->
base
.
state
!=
MsgStateInit
)
info
.
content
.
pszObjId
=
oid_rsa_data
;
else
info
.
content
.
pszObjId
=
NULL
;
if
(
msg
->
data
.
cbData
)
{
CRYPT_DATA_BLOB
blob
=
{
msg
->
data
.
cbData
,
msg
->
data
.
pbData
};
ret
=
CryptEncodeObjectEx
(
X509_ASN_ENCODING
,
X509_OCTET_STRING
,
&
blob
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
info
.
content
.
Content
.
pbData
,
&
info
.
content
.
Content
.
cbData
);
ret
=
CryptEncodeObjectEx
(
X509_ASN_ENCODING
,
X509_OCTET_STRING
,
&
blob
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
info
.
content
.
Content
.
pbData
,
&
info
.
content
.
Content
.
cbData
);
freeContent
=
TRUE
;
}
else
{
info
.
content
.
Content
.
cbData
=
0
;
info
.
content
.
Content
.
pbData
=
NULL
;
ret
=
TRUE
;
}
}
else
{
info
.
content
.
Content
.
cbData
=
0
;
info
.
content
.
Content
.
pbData
=
NULL
;
info
.
content
.
pszObjId
=
msg
->
innerOID
;
info
.
content
.
Content
.
cbData
=
msg
->
data
.
cbData
;
info
.
content
.
Content
.
pbData
=
msg
->
data
.
pbData
;
ret
=
TRUE
;
}
if
(
ret
)
{
ret
=
CRYPT_AsnEncodeCMSSignedInfo
(
&
info
,
pvData
,
pcbData
);
LocalFree
(
info
.
content
.
Content
.
pbData
);
if
(
freeContent
)
LocalFree
(
info
.
content
.
Content
.
pbData
);
}
break
;
}
...
...
@@ -1357,9 +1373,22 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
CryptMsgBase_Init
((
CryptMsgBase
*
)
msg
,
dwFlags
,
pStreamInfo
,
CSignedEncodeMsg_Close
,
CSignedEncodeMsg_GetParam
,
CSignedEncodeMsg_Update
,
CRYPT_DefaultMsgControl
);
if
(
pszInnerContentObjID
)
{
msg
->
innerOID
=
CryptMemAlloc
(
strlen
(
pszInnerContentObjID
)
+
1
);
if
(
msg
->
innerOID
)
strcpy
(
msg
->
innerOID
,
pszInnerContentObjID
);
else
ret
=
FALSE
;
}
else
msg
->
innerOID
=
NULL
;
msg
->
data
.
cbData
=
0
;
msg
->
data
.
pbData
=
NULL
;
msg
->
msg_data
.
info
=
CryptMemAlloc
(
sizeof
(
CRYPT_SIGNED_INFO
));
if
(
ret
)
msg
->
msg_data
.
info
=
CryptMemAlloc
(
sizeof
(
CRYPT_SIGNED_INFO
));
else
msg
->
msg_data
.
info
=
NULL
;
if
(
msg
->
msg_data
.
info
)
{
memset
(
msg
->
msg_data
.
info
,
0
,
sizeof
(
CRYPT_SIGNED_INFO
));
...
...
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