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
cbccab62
Commit
cbccab62
authored
Nov 03, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Nov 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Implement WVTAsn1SpcFinancialCriteriaInfoDecode.
parent
4c88340f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
4 deletions
+66
-4
asn.c
dlls/wintrust/asn.c
+66
-2
asn.c
dlls/wintrust/tests/asn.c
+0
-2
No files found.
dlls/wintrust/asn.c
View file @
cbccab62
...
...
@@ -2186,11 +2186,75 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodeBool
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
BOOL
ret
;
if
(
cbEncoded
<
3
)
{
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
return
FALSE
;
}
if
(
GET_LEN_BYTES
(
pbEncoded
[
1
])
>
1
)
{
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
return
FALSE
;
}
if
(
pbEncoded
[
1
]
>
1
)
{
SetLastError
(
CRYPT_E_ASN1_CORRUPT
);
return
FALSE
;
}
if
(
!
pvStructInfo
)
{
*
pcbStructInfo
=
sizeof
(
BOOL
);
ret
=
TRUE
;
}
else
if
(
*
pcbStructInfo
<
sizeof
(
BOOL
))
{
*
pcbStructInfo
=
sizeof
(
BOOL
);
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
}
else
{
*
pcbStructInfo
=
sizeof
(
BOOL
);
*
(
BOOL
*
)
pvStructInfo
=
pbEncoded
[
2
]
?
TRUE
:
FALSE
;
ret
=
TRUE
;
}
TRACE
(
"returning %d (%08x)
\n
"
,
ret
,
GetLastError
());
return
ret
;
}
BOOL
WINAPI
WVTAsn1SpcFinancialCriteriaInfoDecode
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
FIXME
(
"(%p, %d, %08x, %p, %d): stub
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
BOOL
ret
=
FALSE
;
TRACE
(
"(%p, %d, %08x, %p, %d)
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
);
return
FALSE
;
__TRY
{
struct
AsnDecodeSequenceItem
items
[]
=
{
{
ASN_BOOL
,
offsetof
(
SPC_FINANCIAL_CRITERIA
,
fFinancialInfoAvailable
),
CRYPT_AsnDecodeBool
,
sizeof
(
BOOL
),
FALSE
,
FALSE
,
0
,
0
},
{
ASN_BOOL
,
offsetof
(
SPC_FINANCIAL_CRITERIA
,
fMeetsCriteria
),
CRYPT_AsnDecodeBool
,
sizeof
(
BOOL
),
FALSE
,
FALSE
,
0
,
0
},
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
}
__ENDTRY
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
}
dlls/wintrust/tests/asn.c
View file @
cbccab62
...
...
@@ -79,7 +79,6 @@ static void test_decodeSPCFinancialCriteria(void)
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_FINANCIAL_CRITERIA_STRUCT
,
falseCriteria
,
sizeof
(
falseCriteria
),
0
,
NULL
,
&
criteria
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -88,7 +87,6 @@ static void test_decodeSPCFinancialCriteria(void)
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_FINANCIAL_CRITERIA_STRUCT
,
trueCriteria
,
sizeof
(
trueCriteria
),
0
,
NULL
,
&
criteria
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
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