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
71b5ba03
Commit
71b5ba03
authored
Sep 18, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement streamed encoding of an indefinite-length data message.
parent
19956d6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
msg.c
dlls/crypt32/msg.c
+31
-4
msg.c
dlls/crypt32/tests/msg.c
+0
-1
No files found.
dlls/crypt32/msg.c
View file @
71b5ba03
...
...
@@ -146,10 +146,18 @@ static BOOL CRYPT_EncodeDataContentInfoHeader(CDataEncodeMsg *msg,
if
(
msg
->
base
.
streamed
&&
msg
->
base
.
stream_info
.
cbContent
==
0xffffffff
)
{
FIXME
(
"unimplemented for indefinite-length encoding
\n
"
);
header
->
cbData
=
0
;
header
->
pbData
=
NULL
;
ret
=
TRUE
;
static
const
BYTE
headerValue
[]
=
{
0x30
,
0x80
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x07
,
0x01
,
0xa0
,
0x80
,
0x24
,
0x80
};
header
->
pbData
=
LocalAlloc
(
0
,
sizeof
(
headerValue
));
if
(
header
->
pbData
)
{
header
->
cbData
=
sizeof
(
headerValue
);
memcpy
(
header
->
pbData
,
headerValue
,
sizeof
(
headerValue
));
ret
=
TRUE
;
}
else
ret
=
FALSE
;
}
else
{
...
...
@@ -197,6 +205,25 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
LocalFree
(
header
.
pbData
);
}
}
/* Curiously, every indefinite-length streamed update appears to
* get its own tag and length, regardless of fFinal.
*/
if
(
msg
->
base
.
stream_info
.
cbContent
==
0xffffffff
)
{
BYTE
*
header
;
DWORD
headerLen
;
ret
=
CRYPT_EncodeContentLength
(
X509_ASN_ENCODING
,
NULL
,
&
cbData
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
header
,
&
headerLen
);
if
(
ret
)
{
ret
=
msg
->
base
.
stream_info
.
pfnStreamOutput
(
msg
->
base
.
stream_info
.
pvArg
,
header
,
headerLen
,
FALSE
);
LocalFree
(
header
);
}
}
if
(
!
fFinal
)
ret
=
msg
->
base
.
stream_info
.
pfnStreamOutput
(
msg
->
base
.
stream_info
.
pvArg
,
(
BYTE
*
)
pbData
,
cbData
,
...
...
dlls/crypt32/tests/msg.c
View file @
71b5ba03
...
...
@@ -659,7 +659,6 @@ static void test_data_msg_encoding(void)
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
FALSE
);
CryptMsgUpdate
(
msg
,
msgData
,
sizeof
(
msgData
),
TRUE
);
CryptMsgClose
(
msg
);
todo_wine
check_updates
(
"data message with indefinite length"
,
&
a3
,
&
accum
);
free_updates
(
&
accum
);
}
...
...
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