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
6b13b356
Commit
6b13b356
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 WVTAsn1CatMemberInfoDecode.
parent
65c5d3e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
asn.c
dlls/wintrust/tests/asn.c
+58
-0
No files found.
dlls/wintrust/tests/asn.c
View file @
6b13b356
...
...
@@ -531,6 +531,63 @@ static void test_encodeCatMemberInfo(void)
}
}
static
void
test_decodeCatMemberInfo
(
void
)
{
BOOL
ret
;
LPBYTE
buf
;
DWORD
size
;
CAT_MEMBERINFO
*
info
;
if
(
!
pCryptDecodeObjectEx
)
{
skip
(
"CryptDecodeObjectEx() is not available. Skipping the decodeCatMemberInfo tests
\n
"
);
return
;
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_MEMBERINFO_STRUCT
,
emptyCatMemberInfo
,
sizeof
(
emptyCatMemberInfo
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
info
=
(
CAT_MEMBERINFO
*
)
buf
;
ok
(
!
info
->
pwszSubjGuid
||
!
info
->
pwszSubjGuid
[
0
],
"expected empty pwszSubjGuid
\n
"
);
ok
(
info
->
dwCertVersion
==
0
,
"expected dwCertVersion == 0, got %d
\n
"
,
info
->
dwCertVersion
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_MEMBERINFO_STRUCT
,
catMemberInfoWithSillyGuid
,
sizeof
(
catMemberInfoWithSillyGuid
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
info
=
(
CAT_MEMBERINFO
*
)
buf
;
ok
(
info
->
pwszSubjGuid
&&
!
lstrcmpW
(
info
->
pwszSubjGuid
,
foo
),
"unexpected pwszSubjGuid
\n
"
);
ok
(
info
->
dwCertVersion
==
0
,
"expected dwCertVersion == 0, got %d
\n
"
,
info
->
dwCertVersion
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
CAT_MEMBERINFO_STRUCT
,
catMemberInfoWithGuid
,
sizeof
(
catMemberInfoWithGuid
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
(
BYTE
*
)
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
info
=
(
CAT_MEMBERINFO
*
)
buf
;
ok
(
info
->
pwszSubjGuid
&&
!
lstrcmpW
(
info
->
pwszSubjGuid
,
guidStr
),
"unexpected pwszSubjGuid
\n
"
);
ok
(
info
->
dwCertVersion
==
0
,
"expected dwCertVersion == 0, got %d
\n
"
,
info
->
dwCertVersion
);
LocalFree
(
buf
);
}
}
START_TEST
(
asn
)
{
HMODULE
hCrypt32
=
LoadLibraryA
(
"crypt32.dll"
);
...
...
@@ -542,6 +599,7 @@ START_TEST(asn)
test_encodeSPCPEImage
();
test_decodeSPCPEImage
();
test_encodeCatMemberInfo
();
test_decodeCatMemberInfo
();
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