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
52be131a
Commit
52be131a
authored
Sep 17, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Allow items in an array to be indefinite-length encoded.
parent
5d168bd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
decode.c
dlls/crypt32/decode.c
+13
-15
No files found.
dlls/crypt32/decode.c
View file @
52be131a
...
...
@@ -574,23 +574,25 @@ static BOOL CRYPT_AsnDecodeArray(const struct AsnArrayDescriptor *arrayDesc,
doneDecoding
=
TRUE
;
if
(
!
doneDecoding
)
{
DWORD
itemDataLen
,
itemDecoded
,
size
=
0
;
DWORD
item
Encoded
,
item
DataLen
,
itemDecoded
,
size
=
0
;
/* Each item decoded may not tolerate extraneous bytes,
* so get the length of the next element and pass it
* directly.
* so get the length of the next element if known.
*/
ret
=
CRYPT_GetLen
(
ptr
,
cbEncoded
-
(
ptr
-
pbEncoded
),
&
itemDataLen
);
if
((
ret
=
CRYPT_GetLengthIndefinite
(
ptr
,
cbEncoded
-
(
ptr
-
pbEncoded
),
&
itemDataLen
)))
{
if
(
itemDataLen
==
CMSG_INDEFINITE_LENGTH
)
itemEncoded
=
cbEncoded
-
(
ptr
-
pbEncoded
);
else
itemEncoded
=
1
+
itemLenBytes
+
itemDataLen
;
}
if
(
ret
)
ret
=
arrayDesc
->
decodeFunc
(
ptr
,
1
+
itemLenBytes
+
itemDataLen
,
ret
=
arrayDesc
->
decodeFunc
(
ptr
,
itemEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
size
,
&
itemDecoded
);
if
(
ret
)
{
DWORD
nextLen
;
cItems
++
;
if
(
itemSizes
!=
&
itemSize
)
itemSizes
=
CryptMemRealloc
(
itemSizes
,
...
...
@@ -607,14 +609,10 @@ static BOOL CRYPT_AsnDecodeArray(const struct AsnArrayDescriptor *arrayDesc,
if
(
itemSizes
)
{
decoded
+=
itemDecoded
;
itemSizes
[
cItems
-
1
].
encodedLen
=
1
+
itemLenBytes
+
itemDataLen
;
itemSizes
[
cItems
-
1
].
encodedLen
=
itemEncoded
;
itemSizes
[
cItems
-
1
].
size
=
size
;
bytesNeeded
+=
size
;
ret
=
CRYPT_GetLen
(
ptr
,
cbEncoded
-
(
ptr
-
pbEncoded
),
&
nextLen
);
if
(
ret
)
ptr
+=
nextLen
+
1
+
GET_LEN_BYTES
(
ptr
[
1
]);
ptr
+=
itemEncoded
;
}
else
ret
=
FALSE
;
...
...
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