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
bbecd691
Commit
bbecd691
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 WVTAsn1SpcFinancialCriteriaInfoEncode.
parent
5c0d8a3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
4 deletions
+53
-4
asn.c
dlls/wintrust/asn.c
+53
-2
asn.c
dlls/wintrust/tests/asn.c
+0
-2
No files found.
dlls/wintrust/asn.c
View file @
bbecd691
...
...
@@ -49,6 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(cryptasn);
#endif
#define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01)
#define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
#define ASN_BMPSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1e)
...
...
@@ -936,13 +937,63 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnEncodeBool
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
BOOL
val
=
*
(
const
BOOL
*
)
pvStructInfo
,
ret
;
TRACE
(
"%d
\n
"
,
val
);
if
(
!
pbEncoded
)
{
*
pcbEncoded
=
3
;
ret
=
TRUE
;
}
else
if
(
*
pcbEncoded
<
3
)
{
*
pcbEncoded
=
3
;
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
}
else
{
*
pcbEncoded
=
3
;
*
pbEncoded
++
=
ASN_BOOL
;
*
pbEncoded
++
=
1
;
*
pbEncoded
++
=
val
?
0xff
:
0
;
ret
=
TRUE
;
}
TRACE
(
"returning %d (%08x)
\n
"
,
ret
,
GetLastError
());
return
ret
;
}
BOOL
WINAPI
WVTAsn1SpcFinancialCriteriaInfoEncode
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
FIXME
(
"(0x%08x, %s, %p, %p, %p): stub
\n
"
,
dwCertEncodingType
,
BOOL
ret
=
FALSE
;
TRACE
(
"(0x%08x, %s, %p, %p, %p)
\n
"
,
dwCertEncodingType
,
debugstr_a
(
lpszStructType
),
pvStructInfo
,
pbEncoded
,
pcbEncoded
);
return
FALSE
;
__TRY
{
const
SPC_FINANCIAL_CRITERIA
*
criteria
=
pvStructInfo
;
struct
AsnEncodeSequenceItem
items
[]
=
{
{
&
criteria
->
fFinancialInfoAvailable
,
CRYPT_AsnEncodeBool
,
0
},
{
&
criteria
->
fMeetsCriteria
,
CRYPT_AsnEncodeBool
,
0
},
};
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
}
__ENDTRY
return
ret
;
}
/* Gets the number of length bytes from the given (leading) length byte */
...
...
dlls/wintrust/tests/asn.c
View file @
bbecd691
...
...
@@ -46,7 +46,6 @@ static void test_encodeSPCFinancialCriteria(void)
}
ret
=
pCryptEncodeObjectEx
(
X509_ASN_ENCODING
,
SPC_FINANCIAL_CRITERIA_STRUCT
,
&
criteria
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptEncodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -57,7 +56,6 @@ static void test_encodeSPCFinancialCriteria(void)
criteria
.
fFinancialInfoAvailable
=
criteria
.
fMeetsCriteria
=
TRUE
;
ret
=
pCryptEncodeObjectEx
(
X509_ASN_ENCODING
,
SPC_FINANCIAL_CRITERIA_STRUCT
,
&
criteria
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptEncodeObjectEx 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