Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e009cd90
Commit
e009cd90
authored
Oct 17, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Oct 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Add tests for WVTAsn1CatNameValueDecode.
parent
9216340a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
asn.c
dlls/wintrust/tests/asn.c
+73
-0
No files found.
dlls/wintrust/tests/asn.c
View file @
e009cd90
...
@@ -653,6 +653,78 @@ static void test_encodeCatNameValue(void)
...
@@ -653,6 +653,78 @@ static void test_encodeCatNameValue(void)
}
}
}
}
static
void
test_decodeCatNameValue
(
void
)
{
BOOL
ret
;
LPBYTE
buf
;
DWORD
size
;
CAT_NAMEVALUE
*
value
;
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_NAMEVALUE_STRUCT
,
emptyCatNameValue
,
sizeof
(
emptyCatNameValue
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
value
=
(
CAT_NAMEVALUE
*
)
buf
;
ok
(
!
value
->
pwszTag
||
!
value
->
pwszTag
[
0
],
"expected empty pwszTag
\n
"
);
ok
(
value
->
fdwFlags
==
0
,
"expected fdwFlags == 0, got %08x
\n
"
,
value
->
fdwFlags
);
ok
(
value
->
Value
.
cbData
==
0
,
"expected 0-length value, got %d
\n
"
,
value
->
Value
.
cbData
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_NAMEVALUE_STRUCT
,
catNameValueWithTag
,
sizeof
(
catNameValueWithTag
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
value
=
(
CAT_NAMEVALUE
*
)
buf
;
ok
(
value
->
pwszTag
&&
!
lstrcmpW
(
value
->
pwszTag
,
foo
),
"unexpected pwszTag
\n
"
);
ok
(
value
->
fdwFlags
==
0
,
"expected fdwFlags == 0, got %08x
\n
"
,
value
->
fdwFlags
);
ok
(
value
->
Value
.
cbData
==
0
,
"expected 0-length value, got %d
\n
"
,
value
->
Value
.
cbData
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_NAMEVALUE_STRUCT
,
catNameValueWithFlags
,
sizeof
(
catNameValueWithFlags
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
value
=
(
CAT_NAMEVALUE
*
)
buf
;
ok
(
!
value
->
pwszTag
||
!
value
->
pwszTag
[
0
],
"expected empty pwszTag
\n
"
);
ok
(
value
->
fdwFlags
==
0xf00dd00d
,
"expected fdwFlags == 0xf00dd00d, got %08x
\n
"
,
value
->
fdwFlags
);
ok
(
value
->
Value
.
cbData
==
0
,
"expected 0-length value, got %d
\n
"
,
value
->
Value
.
cbData
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_NAMEVALUE_STRUCT
,
catNameValueWithValue
,
sizeof
(
catNameValueWithValue
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
value
=
(
CAT_NAMEVALUE
*
)
buf
;
ok
(
!
value
->
pwszTag
||
!
value
->
pwszTag
[
0
],
"expected empty pwszTag
\n
"
);
ok
(
value
->
fdwFlags
==
0
,
"expected fdwFlags == 0, got %08x
\n
"
,
value
->
fdwFlags
);
ok
(
value
->
Value
.
cbData
==
sizeof
(
aVal
),
"unexpected size %d
\n
"
,
value
->
Value
.
cbData
);
ok
(
!
memcmp
(
value
->
Value
.
pbData
,
aVal
,
value
->
Value
.
cbData
),
"unexpected value
\n
"
);
LocalFree
(
buf
);
}
}
START_TEST
(
asn
)
START_TEST
(
asn
)
{
{
HMODULE
hCrypt32
=
LoadLibraryA
(
"crypt32.dll"
);
HMODULE
hCrypt32
=
LoadLibraryA
(
"crypt32.dll"
);
...
@@ -666,6 +738,7 @@ START_TEST(asn)
...
@@ -666,6 +738,7 @@ START_TEST(asn)
test_encodeCatMemberInfo
();
test_encodeCatMemberInfo
();
test_decodeCatMemberInfo
();
test_decodeCatMemberInfo
();
test_encodeCatNameValue
();
test_encodeCatNameValue
();
test_decodeCatNameValue
();
FreeLibrary
(
hCrypt32
);
FreeLibrary
(
hCrypt32
);
}
}
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