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
5c0d8a3a
Commit
5c0d8a3a
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: Add tests for WVTAsn1SpcFinancialCriteriaInfoEncode.
parent
c196e2ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
asn.c
dlls/wintrust/tests/asn.c
+38
-0
No files found.
dlls/wintrust/tests/asn.c
View file @
5c0d8a3a
...
...
@@ -29,6 +29,43 @@
static
BOOL
(
WINAPI
*
pCryptDecodeObjectEx
)(
DWORD
,
LPCSTR
,
const
BYTE
*
,
DWORD
,
DWORD
,
PCRYPT_DECODE_PARA
,
void
*
,
DWORD
*
);
static
BOOL
(
WINAPI
*
pCryptEncodeObjectEx
)(
DWORD
,
LPCSTR
,
const
void
*
,
DWORD
,
PCRYPT_ENCODE_PARA
,
void
*
,
DWORD
*
);
static
const
BYTE
falseCriteria
[]
=
{
0x30
,
0x06
,
0x01
,
0x01
,
0x00
,
0x01
,
0x01
,
0x00
};
static
const
BYTE
trueCriteria
[]
=
{
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x01
,
0x01
,
0xff
};
static
void
test_encodeSPCFinancialCriteria
(
void
)
{
BOOL
ret
;
DWORD
size
=
0
;
LPBYTE
buf
;
SPC_FINANCIAL_CRITERIA
criteria
=
{
FALSE
,
FALSE
};
if
(
!
pCryptEncodeObjectEx
)
{
skip
(
"CryptEncodeObjectEx() is not available. Skipping the encodeFinancialCriteria tests
\n
"
);
return
;
}
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
)
{
ok
(
size
==
sizeof
(
falseCriteria
),
"Unexpected size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
falseCriteria
,
size
),
"Unexpected value
\n
"
);
LocalFree
(
buf
);
}
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
)
{
ok
(
size
==
sizeof
(
trueCriteria
),
"Unexpected size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
trueCriteria
,
size
),
"Unexpected value
\n
"
);
LocalFree
(
buf
);
}
}
static
WCHAR
url
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
...
...
@@ -727,6 +764,7 @@ START_TEST(asn)
pCryptDecodeObjectEx
=
(
void
*
)
GetProcAddress
(
hCrypt32
,
"CryptDecodeObjectEx"
);
pCryptEncodeObjectEx
=
(
void
*
)
GetProcAddress
(
hCrypt32
,
"CryptEncodeObjectEx"
);
test_encodeSPCFinancialCriteria
();
test_encodeSPCLink
();
test_decodeSPCLink
();
test_encodeSPCPEImage
();
...
...
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