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
8610a0b5
Commit
8610a0b5
authored
Dec 09, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Dec 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Add tests for WVTAsn1SpcSpOpusInfoDecode.
parent
9e7c5626
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
asn.c
dlls/wintrust/tests/asn.c
+74
-0
No files found.
dlls/wintrust/tests/asn.c
View file @
8610a0b5
...
...
@@ -865,6 +865,79 @@ static void test_encodeSpOpusInfo(void)
}
}
static
void
test_decodeSpOpusInfo
(
void
)
{
BOOL
ret
;
DWORD
size
;
SPC_SP_OPUS_INFO
*
info
;
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
emptySequence
,
sizeof
(
emptySequence
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
!
info
->
pwszProgramName
,
"expected NULL
\n
"
);
ok
(
!
info
->
pMoreInfo
,
"expected NULL
\n
"
);
ok
(
!
info
->
pPublisherInfo
,
"expected NULL
\n
"
);
LocalFree
(
info
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
spOpusInfoWithProgramName
,
sizeof
(
spOpusInfoWithProgramName
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
info
->
pwszProgramName
&&
!
lstrcmpW
(
info
->
pwszProgramName
,
progName
),
"unexpected program name
\n
"
);
ok
(
!
info
->
pMoreInfo
,
"expected NULL
\n
"
);
ok
(
!
info
->
pPublisherInfo
,
"expected NULL
\n
"
);
LocalFree
(
info
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
spOpusInfoWithMoreInfo
,
sizeof
(
spOpusInfoWithMoreInfo
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
!
info
->
pwszProgramName
,
"expected NULL
\n
"
);
ok
(
info
->
pMoreInfo
!=
NULL
,
"expected a value for pMoreInfo
\n
"
);
if
(
info
->
pMoreInfo
)
{
ok
(
info
->
pMoreInfo
->
dwLinkChoice
==
SPC_URL_LINK_CHOICE
,
"unexpected link choice %d
\n
"
,
info
->
pMoreInfo
->
dwLinkChoice
);
ok
(
!
lstrcmpW
(
info
->
pMoreInfo
->
pwszUrl
,
winehq
),
"unexpected link value
\n
"
);
}
ok
(
!
info
->
pPublisherInfo
,
"expected NULL
\n
"
);
LocalFree
(
info
);
}
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
spOpusInfoWithPublisherInfo
,
sizeof
(
spOpusInfoWithPublisherInfo
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
!
info
->
pwszProgramName
,
"expected NULL
\n
"
);
ok
(
!
info
->
pMoreInfo
,
"expected NULL
\n
"
);
ok
(
info
->
pPublisherInfo
!=
NULL
,
"expected a value for pPublisherInfo
\n
"
);
if
(
info
->
pPublisherInfo
)
{
ok
(
info
->
pPublisherInfo
->
dwLinkChoice
==
SPC_URL_LINK_CHOICE
,
"unexpected link choice %d
\n
"
,
info
->
pPublisherInfo
->
dwLinkChoice
);
ok
(
!
lstrcmpW
(
info
->
pPublisherInfo
->
pwszUrl
,
winehq
),
"unexpected link value
\n
"
);
}
LocalFree
(
info
);
}
}
START_TEST
(
asn
)
{
HMODULE
hCrypt32
=
LoadLibraryA
(
"crypt32.dll"
);
...
...
@@ -882,6 +955,7 @@ START_TEST(asn)
test_encodeCatNameValue
();
test_decodeCatNameValue
();
test_encodeSpOpusInfo
();
test_decodeSpOpusInfo
();
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