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
8df323f8
Commit
8df323f8
authored
Jul 17, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jul 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Use property list for decoded message parameters.
parent
4e289449
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
msg.c
dlls/crypt32/msg.c
+26
-16
No files found.
dlls/crypt32/msg.c
View file @
8df323f8
...
...
@@ -591,11 +591,11 @@ HCRYPTMSG WINAPI CryptMsgOpenToEncode(DWORD dwMsgEncodingType, DWORD dwFlags,
typedef
struct
_CDecodeMsg
{
CryptMsgBase
base
;
DWORD
type
;
HCRYPTPROV
crypt_prov
;
CRYPT_DATA_BLOB
msg_data
;
PC
RYPT_DATA_BLOB
data
;
/* for type == CMSG_DATA */
CryptMsgBase
base
;
DWORD
type
;
HCRYPTPROV
crypt_prov
;
CRYPT_DATA_BLOB
msg_data
;
PC
ONTEXT_PROPERTY_LIST
properties
;
}
CDecodeMsg
;
static
void
CDecodeMsg_Close
(
HCRYPTMSG
hCryptMsg
)
...
...
@@ -605,7 +605,7 @@ static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg)
if
(
msg
->
base
.
open_flags
&
CMSG_CRYPT_RELEASE_CONTEXT_FLAG
)
CryptReleaseContext
(
msg
->
crypt_prov
,
0
);
CryptMemFree
(
msg
->
msg_data
.
pbData
);
LocalFree
(
msg
->
data
);
ContextPropertyList_Free
(
msg
->
properties
);
}
static
BOOL
CDecodeMsg_CopyData
(
CDecodeMsg
*
msg
,
const
BYTE
*
pbData
,
...
...
@@ -645,12 +645,21 @@ 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
)
&
msg
->
data
,
&
size
);
(
LPBYTE
)
&
data
,
&
size
);
if
(
ret
)
{
ret
=
ContextPropertyList_SetProperty
(
msg
->
properties
,
CMSG_CONTENT_PARAM
,
data
->
pbData
,
data
->
cbData
);
LocalFree
(
data
);
msg
->
type
=
CMSG_DATA
;
}
break
;
}
case
CMSG_HASHED
:
{
CRYPT_DIGESTED_DATA
*
digestedData
;
...
...
@@ -743,16 +752,17 @@ static BOOL CDecodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
(
const
BYTE
*
)
&
msg
->
type
,
sizeof
(
msg
->
type
));
break
;
case
CMSG_CONTENT_PARAM
:
if
(
msg
->
data
)
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
msg
->
data
->
pbData
,
msg
->
data
->
cbData
);
default:
{
CRYPT_DATA_BLOB
blob
;
ret
=
ContextPropertyList_FindProperty
(
msg
->
properties
,
dwParamType
,
&
blob
);
if
(
ret
)
ret
=
CRYPT_CopyParam
(
pvData
,
pcbData
,
blob
.
pbData
,
blob
.
cbData
);
else
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
break
;
default:
FIXME
(
"unimplemented for parameter %d
\n
"
,
dwParamType
);
SetLastError
(
CRYPT_E_INVALID_MSG_TYPE
);
}
}
return
ret
;
}
...
...
@@ -786,7 +796,7 @@ HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags,
}
msg
->
msg_data
.
cbData
=
0
;
msg
->
msg_data
.
pbData
=
NULL
;
msg
->
data
=
NULL
;
msg
->
properties
=
ContextPropertyList_Create
()
;
}
return
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