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
5fbca384
Commit
5fbca384
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: Separate DecodeInt into an internal and external version.
parent
a538e95c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
17 deletions
+36
-17
decode.c
dlls/crypt32/decode.c
+36
-17
No files found.
dlls/crypt32/decode.c
View file @
5fbca384
...
@@ -3034,19 +3034,10 @@ static BOOL WINAPI CRYPT_AsnDecodeBits(DWORD dwCertEncodingType,
...
@@ -3034,19 +3034,10 @@ static BOOL WINAPI CRYPT_AsnDecodeBits(DWORD dwCertEncodingType,
return
ret
;
return
ret
;
}
}
static
BOOL
WINAPI
CRYPT_AsnDecodeInt
(
DWORD
dwCertEncodingType
,
static
BOOL
CRYPT_AsnDecodeIntInternal
(
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
,
DWORD
*
pcbDecoded
)
PCRYPT_DECODE_PARA
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
{
BOOL
ret
;
BOOL
ret
;
if
(
!
pvStructInfo
)
{
*
pcbStructInfo
=
sizeof
(
int
);
return
TRUE
;
}
__TRY
{
BYTE
buf
[
sizeof
(
CRYPT_INTEGER_BLOB
)
+
sizeof
(
int
)];
BYTE
buf
[
sizeof
(
CRYPT_INTEGER_BLOB
)
+
sizeof
(
int
)];
CRYPT_INTEGER_BLOB
*
blob
=
(
CRYPT_INTEGER_BLOB
*
)
buf
;
CRYPT_INTEGER_BLOB
*
blob
=
(
CRYPT_INTEGER_BLOB
*
)
buf
;
DWORD
size
=
sizeof
(
buf
);
DWORD
size
=
sizeof
(
buf
);
...
@@ -3058,18 +3049,17 @@ static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType,
...
@@ -3058,18 +3049,17 @@ static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType,
ret
=
FALSE
;
ret
=
FALSE
;
}
}
else
else
ret
=
CRYPT_AsnDecodeIntegerInternal
(
dwCertEncodingType
,
ret
=
CRYPT_AsnDecodeIntegerInternal
(
X509_ASN_ENCODING
,
NULL
,
X509_MULTI_BYTE_INTEGER
,
pbEncoded
,
cbEncoded
,
0
,
NULL
,
&
buf
,
pbEncoded
,
cbEncoded
,
0
,
NULL
,
&
buf
,
&
size
);
&
size
);
if
(
ret
)
if
(
ret
)
{
{
if
((
ret
=
CRYPT_DecodeEnsureSpace
(
dwFlags
,
pDecodePara
,
if
(
!
pvStructInfo
)
*
pcbStructInfo
=
sizeof
(
int
);
else
if
((
ret
=
CRYPT_DecodeEnsureSpace
(
dwFlags
,
NULL
,
pvStructInfo
,
pcbStructInfo
,
sizeof
(
int
))))
pvStructInfo
,
pcbStructInfo
,
sizeof
(
int
))))
{
{
int
val
,
i
;
int
val
,
i
;
if
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
)
pvStructInfo
=
*
(
BYTE
**
)
pvStructInfo
;
if
(
blob
->
pbData
[
blob
->
cbData
-
1
]
&
0x80
)
if
(
blob
->
pbData
[
blob
->
cbData
-
1
]
&
0x80
)
{
{
/* initialize to a negative value to sign-extend */
/* initialize to a negative value to sign-extend */
...
@@ -3087,6 +3077,35 @@ static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType,
...
@@ -3087,6 +3077,35 @@ static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType,
}
}
else
if
(
GetLastError
()
==
ERROR_MORE_DATA
)
else
if
(
GetLastError
()
==
ERROR_MORE_DATA
)
SetLastError
(
CRYPT_E_ASN1_LARGE
);
SetLastError
(
CRYPT_E_ASN1_LARGE
);
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodeInt
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
PCRYPT_DECODE_PARA
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
BOOL
ret
;
__TRY
{
DWORD
bytesNeeded
;
ret
=
CRYPT_AsnDecodeIntInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
bytesNeeded
,
NULL
);
if
(
ret
)
{
if
(
!
pvStructInfo
)
*
pcbStructInfo
=
bytesNeeded
;
else
if
((
ret
=
CRYPT_DecodeEnsureSpace
(
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
bytesNeeded
)))
{
if
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
)
pvStructInfo
=
*
(
BYTE
**
)
pvStructInfo
;
ret
=
CRYPT_AsnDecodeIntInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
pvStructInfo
,
&
bytesNeeded
,
NULL
);
}
}
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
...
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