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
f534a67b
Commit
f534a67b
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: Simplify AsnDecodeSequenceItems a tiny bit.
parent
34aaabca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
decode.c
dlls/crypt32/decode.c
+21
-21
No files found.
dlls/crypt32/decode.c
View file @
f534a67b
...
...
@@ -308,15 +308,21 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
{
if
(
cbEncoded
-
(
ptr
-
pbEncoded
)
!=
0
)
{
DWORD
nextI
temLen
;
DWORD
i
temLen
;
if
((
ret
=
CRYPT_GetLengthIndefinite
(
ptr
,
cbEncoded
-
(
ptr
-
pbEncoded
),
&
nextI
temLen
)))
cbEncoded
-
(
ptr
-
pbEncoded
),
&
i
temLen
)))
{
BYTE
nextI
temLenBytes
=
GET_LEN_BYTES
(
ptr
[
1
]);
BYTE
i
temLenBytes
=
GET_LEN_BYTES
(
ptr
[
1
]);
if
(
ptr
[
0
]
==
items
[
i
].
tag
||
!
items
[
i
].
tag
)
{
DWORD
itemEncodedLen
;
if
(
itemLen
==
CMSG_INDEFINITE_LENGTH
)
itemEncodedLen
=
cbEncoded
-
(
ptr
-
pbEncoded
);
else
itemEncodedLen
=
1
+
itemLenBytes
+
itemLen
;
if
(
nextData
&&
pvStructInfo
&&
items
[
i
].
hasPointer
)
{
TRACE
(
"Setting next pointer to %p
\n
"
,
...
...
@@ -326,21 +332,16 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
}
if
(
items
[
i
].
decodeFunc
)
{
DWORD
nextItemEncodedLen
,
nextI
temDecoded
;
DWORD
i
temDecoded
;
if
(
nextItemLen
==
CMSG_INDEFINITE_LENGTH
)
nextItemEncodedLen
=
cbEncoded
-
(
ptr
-
pbEncoded
);
else
nextItemEncodedLen
=
1
+
nextItemLenBytes
+
nextItemLen
;
if
(
pvStructInfo
)
TRACE
(
"decoding item %d
\n
"
,
i
);
else
TRACE
(
"sizing item %d
\n
"
,
i
);
ret
=
items
[
i
].
decodeFunc
(
ptr
,
nextI
temEncodedLen
,
ret
=
items
[
i
].
decodeFunc
(
ptr
,
i
temEncodedLen
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
pvStructInfo
?
(
BYTE
*
)
pvStructInfo
+
items
[
i
].
offset
:
NULL
,
&
items
[
i
].
size
,
&
nextI
temDecoded
);
:
NULL
,
&
items
[
i
].
size
,
&
i
temDecoded
);
if
(
ret
)
{
/* Account for alignment padding */
...
...
@@ -351,19 +352,19 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
if
(
nextData
&&
items
[
i
].
hasPointer
&&
items
[
i
].
size
>
items
[
i
].
minSize
)
nextData
+=
items
[
i
].
size
-
items
[
i
].
minSize
;
if
(
nextItemDecoded
>
nextI
temEncodedLen
)
if
(
itemDecoded
>
i
temEncodedLen
)
{
WARN
(
"decoded length %d exceeds encoded %d
\n
"
,
nextItemDecoded
,
nextI
temEncodedLen
);
itemDecoded
,
i
temEncodedLen
);
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
ret
=
FALSE
;
}
else
{
ptr
+=
nextI
temDecoded
;
decoded
+=
nextI
temDecoded
;
ptr
+=
i
temDecoded
;
decoded
+=
i
temDecoded
;
TRACE
(
"item %d: decoded %d bytes
\n
"
,
i
,
nextI
temDecoded
);
i
temDecoded
);
}
}
else
if
(
items
[
i
].
optional
&&
...
...
@@ -378,7 +379,7 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
TRACE
(
"item %d failed: %08x
\n
"
,
i
,
GetLastError
());
}
else
if
(
nextI
temLen
==
CMSG_INDEFINITE_LENGTH
)
else
if
(
i
temLen
==
CMSG_INDEFINITE_LENGTH
)
{
ERR
(
"can't use indefinite length encoding without a decoder
\n
"
);
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
...
...
@@ -386,10 +387,9 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
}
else
{
TRACE
(
"item %d: decoded %d bytes
\n
"
,
i
,
1
+
nextItemLenBytes
+
nextItemLen
);
ptr
+=
1
+
nextItemLenBytes
+
nextItemLen
;
decoded
+=
1
+
nextItemLenBytes
+
nextItemLen
;
TRACE
(
"item %d: decoded %d bytes
\n
"
,
i
,
itemEncodedLen
);
ptr
+=
itemEncodedLen
;
decoded
+=
itemEncodedLen
;
items
[
i
].
size
=
items
[
i
].
minSize
;
}
}
...
...
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