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
2d02ec74
Commit
2d02ec74
authored
Aug 27, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Aug 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Don't ignore errors when encoding items in an array.
parent
e594d240
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
54 deletions
+64
-54
encode.c
dlls/crypt32/encode.c
+64
-54
No files found.
dlls/crypt32/encode.c
View file @
2d02ec74
...
@@ -578,27 +578,31 @@ static BOOL WINAPI CRYPT_AsnEncodeCRLEntries(DWORD dwCertEncodingType,
...
@@ -578,27 +578,31 @@ static BOOL WINAPI CRYPT_AsnEncodeCRLEntries(DWORD dwCertEncodingType,
if
(
ret
)
if
(
ret
)
dataLen
+=
size
;
dataLen
+=
size
;
}
}
CRYPT_EncodeLen
(
dataLen
,
NULL
,
&
lenBytes
);
if
(
ret
)
bytesNeeded
=
1
+
lenBytes
+
dataLen
;
if
(
!
pbEncoded
)
*
pcbEncoded
=
bytesNeeded
;
else
{
{
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
,
CRYPT_EncodeLen
(
dataLen
,
NULL
,
&
lenBytes
);
pcbEncoded
,
bytesNeeded
)))
bytesNeeded
=
1
+
lenBytes
+
dataLen
;
if
(
!
pbEncoded
)
*
pcbEncoded
=
bytesNeeded
;
else
{
{
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
,
pbEncoded
=
*
(
BYTE
**
)
pbEncoded
;
pcbEncoded
,
bytesNeeded
)))
*
pbEncoded
++
=
ASN_SEQUENCEOF
;
CRYPT_EncodeLen
(
dataLen
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
i
<
cCRLEntry
;
i
++
)
{
{
DWORD
size
=
dataLen
;
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
pbEncoded
=
*
(
BYTE
**
)
pbEncoded
;
*
pbEncoded
++
=
ASN_SEQUENCEOF
;
CRYPT_EncodeLen
(
dataLen
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
i
<
cCRLEntry
;
i
++
)
{
DWORD
size
=
dataLen
;
ret
=
CRYPT_AsnEncodeCRLEntry
(
&
rgCRLEntry
[
i
],
pbEncoded
,
&
size
);
ret
=
CRYPT_AsnEncodeCRLEntry
(
&
rgCRLEntry
[
i
],
pbEncoded
,
pbEncoded
+=
size
;
&
size
);
dataLen
-=
size
;
pbEncoded
+=
size
;
dataLen
-=
size
;
}
}
}
}
}
}
}
...
@@ -731,28 +735,31 @@ static BOOL WINAPI CRYPT_AsnEncodeExtensions(DWORD dwCertEncodingType,
...
@@ -731,28 +735,31 @@ static BOOL WINAPI CRYPT_AsnEncodeExtensions(DWORD dwCertEncodingType,
if
(
ret
)
if
(
ret
)
dataLen
+=
size
;
dataLen
+=
size
;
}
}
CRYPT_EncodeLen
(
dataLen
,
NULL
,
&
lenBytes
);
if
(
ret
)
bytesNeeded
=
1
+
lenBytes
+
dataLen
;
if
(
!
pbEncoded
)
*
pcbEncoded
=
bytesNeeded
;
else
{
{
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
,
CRYPT_EncodeLen
(
dataLen
,
NULL
,
&
lenBytes
);
pcbEncoded
,
bytesNeeded
)))
bytesNeeded
=
1
+
lenBytes
+
dataLen
;
if
(
!
pbEncoded
)
*
pcbEncoded
=
bytesNeeded
;
else
{
{
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
=
*
(
BYTE
**
)
pbEncoded
;
pbEncoded
,
pcbEncoded
,
bytesNeeded
)))
*
pbEncoded
++
=
ASN_SEQUENCEOF
;
CRYPT_EncodeLen
(
dataLen
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
i
<
exts
->
cExtension
;
i
++
)
{
{
DWORD
size
=
dataLen
;
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
pbEncoded
=
*
(
BYTE
**
)
pbEncoded
;
*
pbEncoded
++
=
ASN_SEQUENCEOF
;
CRYPT_EncodeLen
(
dataLen
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
i
<
exts
->
cExtension
;
i
++
)
{
DWORD
size
=
dataLen
;
ret
=
CRYPT_AsnEncodeExtension
(
&
exts
->
rgExtension
[
i
],
ret
=
CRYPT_AsnEncodeExtension
(
&
exts
->
rgExtension
[
i
],
pbEncoded
,
&
size
);
pbEncoded
,
&
size
);
pbEncoded
+=
size
;
pbEncoded
+=
size
;
dataLen
-=
size
;
dataLen
-=
size
;
}
}
}
}
}
}
}
...
@@ -1459,29 +1466,32 @@ static BOOL WINAPI CRYPT_AsnEncodeSMIMECapabilities(DWORD dwCertEncodingType,
...
@@ -1459,29 +1466,32 @@ static BOOL WINAPI CRYPT_AsnEncodeSMIMECapabilities(DWORD dwCertEncodingType,
if
(
ret
)
if
(
ret
)
dataLen
+=
size
;
dataLen
+=
size
;
}
}
CRYPT_EncodeLen
(
dataLen
,
NULL
,
&
lenBytes
);
if
(
ret
)
bytesNeeded
=
1
+
lenBytes
+
dataLen
;
if
(
!
pbEncoded
)
*
pcbEncoded
=
bytesNeeded
;
else
{
{
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
,
CRYPT_EncodeLen
(
dataLen
,
NULL
,
&
lenBytes
);
pcbEncoded
,
bytesNeeded
)))
bytesNeeded
=
1
+
lenBytes
+
dataLen
;
if
(
!
pbEncoded
)
*
pcbEncoded
=
bytesNeeded
;
else
{
{
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
=
*
(
BYTE
**
)
pbEncoded
;
pbEncoded
,
pcbEncoded
,
bytesNeeded
)))
*
pbEncoded
++
=
ASN_SEQUENCEOF
;
CRYPT_EncodeLen
(
dataLen
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
i
<
capabilities
->
cCapability
;
i
++
)
{
{
DWORD
size
=
dataLen
;
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
pbEncoded
=
*
(
BYTE
**
)
pbEncoded
;
*
pbEncoded
++
=
ASN_SEQUENCEOF
;
CRYPT_EncodeLen
(
dataLen
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
i
<
capabilities
->
cCapability
;
i
++
)
{
DWORD
size
=
dataLen
;
ret
=
CRYPT_AsnEncodeSMIMECapability
(
dwCertEncodingType
,
ret
=
CRYPT_AsnEncodeSMIMECapability
(
dwCertEncodingType
,
NULL
,
&
capabilities
->
rgCapability
[
i
],
0
,
NULL
,
pbEncoded
,
NULL
,
&
capabilities
->
rgCapability
[
i
],
0
,
NULL
,
&
size
);
pbEncoded
,
&
size
);
pbEncoded
+=
size
;
pbEncoded
+=
size
;
dataLen
-=
size
;
dataLen
-=
size
;
}
}
}
}
}
}
}
...
...
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