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
a8e135f4
Commit
a8e135f4
authored
Jul 12, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jul 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Introduce an updated state, and use it to remove boolean "begun".
parent
09c4faf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
msg.c
dlls/crypt32/msg.c
+4
-8
No files found.
dlls/crypt32/msg.c
View file @
a8e135f4
...
...
@@ -40,6 +40,7 @@ typedef BOOL (*CryptMsgUpdateFunc)(HCRYPTMSG hCryptMsg, const BYTE *pbData,
typedef
enum
_CryptMsgState
{
MsgStateInit
,
MsgStateUpdated
,
MsgStateFinalized
}
CryptMsgState
;
...
...
@@ -82,7 +83,6 @@ typedef struct _CDataEncodeMsg
CryptMsgBase
base
;
DWORD
bare_content_len
;
LPBYTE
bare_content
;
BOOL
begun
;
}
CDataEncodeMsg
;
static
const
BYTE
empty_data_content
[]
=
{
0x04
,
0x00
};
...
...
@@ -170,11 +170,10 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
{
__TRY
{
if
(
!
msg
->
begun
)
if
(
msg
->
base
.
state
!=
MsgStateUpdated
)
{
CRYPT_DATA_BLOB
header
;
msg
->
begun
=
TRUE
;
ret
=
CRYPT_EncodeDataContentInfoHeader
(
msg
,
&
header
);
if
(
ret
)
{
...
...
@@ -316,7 +315,6 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
CDataEncodeMsg_Close
,
CDataEncodeMsg_GetParam
,
CDataEncodeMsg_Update
);
msg
->
bare_content_len
=
sizeof
(
empty_data_content
);
msg
->
bare_content
=
(
LPBYTE
)
empty_data_content
;
msg
->
begun
=
FALSE
;
}
return
(
HCRYPTMSG
)
msg
;
}
...
...
@@ -327,7 +325,6 @@ typedef struct _CHashEncodeMsg
HCRYPTPROV
prov
;
HCRYPTHASH
hash
;
CRYPT_DATA_BLOB
data
;
BOOL
begun
;
}
CHashEncodeMsg
;
static
void
CHashEncodeMsg_Close
(
HCRYPTMSG
hCryptMsg
)
...
...
@@ -367,7 +364,7 @@ static BOOL CRYPT_EncodePKCSDigestedData(CHashEncodeMsg *msg, void *pvData,
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncodeAlgorithmIdWithNullParams
;
cItem
++
;
/* Quirk: OID is only encoded messages if an update has happened */
if
(
msg
->
b
egun
)
if
(
msg
->
b
ase
.
state
!=
MsgStateInit
)
contentInfo
.
pszObjId
=
oid_rsa_data
;
if
(
!
(
msg
->
base
.
open_flags
&
CMSG_DETACHED_FLAG
)
&&
msg
->
data
.
cbData
)
{
...
...
@@ -479,7 +476,6 @@ static BOOL CHashEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
TRACE
(
"(%p, %p, %d, %d)
\n
"
,
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
msg
->
begun
=
TRUE
;
if
(
msg
->
base
.
streamed
||
(
msg
->
base
.
open_flags
&
CMSG_DETACHED_FLAG
))
{
/* Doesn't do much, as stream output is never called, and you
...
...
@@ -544,7 +540,6 @@ static HCRYPTMSG CHashEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
msg
->
prov
=
prov
;
msg
->
data
.
cbData
=
0
;
msg
->
data
.
pbData
=
NULL
;
msg
->
begun
=
FALSE
;
if
(
!
CryptCreateHash
(
prov
,
algID
,
0
,
0
,
&
msg
->
hash
))
{
CryptMsgClose
(
msg
);
...
...
@@ -718,6 +713,7 @@ BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
else
{
ret
=
msg
->
update
(
hCryptMsg
,
pbData
,
cbData
,
fFinal
);
msg
->
state
=
MsgStateUpdated
;
if
(
fFinal
)
msg
->
state
=
MsgStateFinalized
;
}
...
...
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