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
85627097
Commit
85627097
authored
Mar 25, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Mar 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Keep track of state in each message type's update function rather than in CryptMsgUpdate.
parent
3617819b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
msg.c
dlls/crypt32/msg.c
+24
-16
No files found.
dlls/crypt32/msg.c
View file @
85627097
...
...
@@ -188,7 +188,9 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
CDataEncodeMsg
*
msg
=
(
CDataEncodeMsg
*
)
hCryptMsg
;
BOOL
ret
=
FALSE
;
if
(
msg
->
base
.
streamed
)
if
(
msg
->
base
.
state
==
MsgStateFinalized
)
SetLastError
(
CRYPT_E_MSG_ERROR
);
else
if
(
msg
->
base
.
streamed
)
{
__TRY
{
...
...
@@ -225,11 +227,15 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
}
}
if
(
!
fFinal
)
{
ret
=
msg
->
base
.
stream_info
.
pfnStreamOutput
(
msg
->
base
.
stream_info
.
pvArg
,
(
BYTE
*
)
pbData
,
cbData
,
FALSE
);
msg
->
base
.
state
=
MsgStateUpdated
;
}
else
{
msg
->
base
.
state
=
MsgStateFinalized
;
if
(
msg
->
base
.
stream_info
.
cbContent
==
0xffffffff
)
{
BYTE
indefinite_trailer
[
6
]
=
{
0
};
...
...
@@ -265,6 +271,7 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
}
else
{
msg
->
base
.
state
=
MsgStateFinalized
;
if
(
!
cbData
)
SetLastError
(
E_INVALIDARG
);
else
...
...
@@ -504,12 +511,15 @@ static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
TRACE
(
"(%p, %p, %d, %d)
\n
"
,
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
if
(
msg
->
base
.
streamed
||
(
msg
->
base
.
open_flags
&
CMSG_DETACHED_FLAG
))
if
(
msg
->
base
.
state
==
MsgStateFinalized
)
SetLastError
(
CRYPT_E_MSG_ERROR
);
else
if
(
msg
->
base
.
streamed
||
(
msg
->
base
.
open_flags
&
CMSG_DETACHED_FLAG
))
{
/* Doesn't do much, as stream output is never called, and you
* can't get the content.
*/
ret
=
CryptHashData
(
msg
->
hash
,
pbData
,
cbData
,
0
);
msg
->
base
.
state
=
fFinal
?
MsgStateFinalized
:
MsgStateUpdated
;
}
else
{
...
...
@@ -529,6 +539,7 @@ static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
else
ret
=
FALSE
;
}
msg
->
base
.
state
=
MsgStateFinalized
;
}
}
return
ret
;
...
...
@@ -1183,12 +1194,15 @@ static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
CSignedEncodeMsg
*
msg
=
(
CSignedEncodeMsg
*
)
hCryptMsg
;
BOOL
ret
=
FALSE
;
if
(
msg
->
base
.
streamed
||
(
msg
->
base
.
open_flags
&
CMSG_DETACHED_FLAG
))
if
(
msg
->
base
.
state
==
MsgStateFinalized
)
SetLastError
(
CRYPT_E_MSG_ERROR
);
else
if
(
msg
->
base
.
streamed
||
(
msg
->
base
.
open_flags
&
CMSG_DETACHED_FLAG
))
{
ret
=
CSignedMsgData_Update
(
&
msg
->
msg_data
,
pbData
,
cbData
,
fFinal
,
Sign
);
if
(
msg
->
base
.
streamed
)
FIXME
(
"streamed partial stub
\n
"
);
msg
->
base
.
state
=
fFinal
?
MsgStateFinalized
:
MsgStateUpdated
;
}
else
{
...
...
@@ -1211,6 +1225,7 @@ static BOOL CSignedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
if
(
ret
)
ret
=
CSignedMsgData_Update
(
&
msg
->
msg_data
,
pbData
,
cbData
,
fFinal
,
Sign
);
msg
->
base
.
state
=
MsgStateFinalized
;
}
}
return
ret
;
...
...
@@ -1644,11 +1659,14 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
TRACE
(
"(%p, %p, %d, %d)
\n
"
,
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
if
(
msg
->
base
.
streamed
)
if
(
msg
->
base
.
state
==
MsgStateFinalized
)
SetLastError
(
CRYPT_E_MSG_ERROR
);
else
if
(
msg
->
base
.
streamed
)
{
ret
=
CDecodeMsg_CopyData
(
msg
,
pbData
,
cbData
);
FIXME
(
"(%p, %p, %d, %d): streamed update stub
\n
"
,
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
msg
->
base
.
state
=
fFinal
?
MsgStateFinalized
:
MsgStateUpdated
;
}
else
{
...
...
@@ -1659,7 +1677,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
ret
=
CDecodeMsg_CopyData
(
msg
,
pbData
,
cbData
);
if
(
ret
)
ret
=
CDecodeMsg_DecodeContent
(
msg
,
&
msg
->
msg_data
,
msg
->
type
);
msg
->
base
.
state
=
MsgStateFinalized
;
}
}
return
ret
;
...
...
@@ -2360,20 +2378,10 @@ BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
DWORD
cbData
,
BOOL
fFinal
)
{
CryptMsgBase
*
msg
=
(
CryptMsgBase
*
)
hCryptMsg
;
BOOL
ret
=
FALSE
;
TRACE
(
"(%p, %p, %d, %d)
\n
"
,
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
if
(
msg
->
state
==
MsgStateFinalized
)
SetLastError
(
CRYPT_E_MSG_ERROR
);
else
{
ret
=
msg
->
update
(
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
msg
->
state
=
MsgStateUpdated
;
if
(
fFinal
)
msg
->
state
=
MsgStateFinalized
;
}
return
ret
;
return
msg
->
update
(
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
}
BOOL
WINAPI
CryptMsgGetParam
(
HCRYPTMSG
hCryptMsg
,
DWORD
dwParamType
,
...
...
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