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
6ef1c3e0
Commit
6ef1c3e0
authored
Oct 14, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Let decoder helpers do more sanity checking.
parent
9afaafc0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
decode.c
dlls/crypt32/decode.c
+15
-11
No files found.
dlls/crypt32/decode.c
View file @
6ef1c3e0
...
...
@@ -604,7 +604,12 @@ static BOOL CRYPT_AsnDecodeArray(const struct AsnArrayDescriptor *arrayDesc,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
*
pcbStructInfo
,
startingPointer
);
if
(
!
arrayDesc
->
tag
||
pbEncoded
[
0
]
==
arrayDesc
->
tag
)
if
(
!
cbEncoded
)
{
SetLastError
(
CRYPT_E_ASN1_EOD
);
ret
=
FALSE
;
}
else
if
(
!
arrayDesc
->
tag
||
pbEncoded
[
0
]
==
arrayDesc
->
tag
)
{
DWORD
dataLen
;
...
...
@@ -765,7 +770,12 @@ static BOOL CRYPT_AsnDecodeArrayNoAlloc(const struct AsnArrayDescriptor *arrayDe
TRACE
(
"%p, %p, %d, %p, %p, %d
\n
"
,
arrayDesc
,
pbEncoded
,
cbEncoded
,
pcItems
,
rgItems
,
pcItems
?
*
pcbItems
:
0
);
if
(
!
arrayDesc
->
tag
||
pbEncoded
[
0
]
==
arrayDesc
->
tag
)
if
(
!
cbEncoded
)
{
SetLastError
(
CRYPT_E_ASN1_EOD
);
ret
=
FALSE
;
}
else
if
(
!
arrayDesc
->
tag
||
pbEncoded
[
0
]
==
arrayDesc
->
tag
)
{
DWORD
dataLen
;
...
...
@@ -2494,7 +2504,7 @@ static BOOL CRYPT_AsnDecodeSMIMECapabilitiesInternal(const BYTE *pbEncoded,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
,
DWORD
*
pcbDecoded
)
{
struct
AsnArrayDescriptor
arrayDesc
=
{
0
,
struct
AsnArrayDescriptor
arrayDesc
=
{
ASN_SEQUENCEOF
,
CRYPT_AsnDecodeSMIMECapability
,
sizeof
(
CRYPT_SMIME_CAPABILITY
),
TRUE
,
offsetof
(
CRYPT_SMIME_CAPABILITY
,
pszObjId
)
};
PCRYPT_SMIME_CAPABILITIES
capabilities
=
pvStructInfo
;
...
...
@@ -2519,11 +2529,7 @@ static BOOL WINAPI CRYPT_AsnDecodeSMIMECapabilities(DWORD dwCertEncodingType,
{
DWORD
bytesNeeded
;
if
(
!
cbEncoded
)
SetLastError
(
CRYPT_E_ASN1_EOD
);
else
if
(
pbEncoded
[
0
]
!=
ASN_SEQUENCEOF
)
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
else
if
((
ret
=
CRYPT_AsnDecodeSMIMECapabilitiesInternal
(
pbEncoded
,
if
((
ret
=
CRYPT_AsnDecodeSMIMECapabilitiesInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
bytesNeeded
,
NULL
)))
{
...
...
@@ -2989,9 +2995,7 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSAttributes(DWORD dwCertEncodingType,
{
DWORD
bytesNeeded
;
if
(
!
cbEncoded
)
SetLastError
(
CRYPT_E_ASN1_EOD
);
else
if
(
pbEncoded
[
0
]
!=
(
ASN_CONSTRUCTOR
|
ASN_SETOF
))
if
(
pbEncoded
[
0
]
!=
(
ASN_CONSTRUCTOR
|
ASN_SETOF
))
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
else
if
((
ret
=
CRYPT_AsnDecodePKCSAttributesInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
bytesNeeded
,
...
...
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