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
52751981
Commit
52751981
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 WVTAsn1CatMemberInfoEncode.
parent
4ffb8a23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
asn.c
dlls/wintrust/tests/asn.c
+71
-0
No files found.
dlls/wintrust/tests/asn.c
View file @
52751981
...
...
@@ -464,6 +464,76 @@ static void test_decodeSPCPEImage(void)
}
}
static
WCHAR
foo
[]
=
{
'f'
,
'o'
,
'o'
,
0
};
static
WCHAR
guidStr
[]
=
{
'{'
,
'8'
,
'b'
,
'c'
,
'9'
,
'6'
,
'b'
,
'0'
,
'0'
,
'-'
,
'8'
,
'd'
,
'a'
,
'1'
,
'-'
,
'1'
,
'1'
,
'c'
,
'f'
,
'-'
,
'8'
,
'7'
,
'3'
,
'6'
,
'-'
,
'0'
,
'0'
,
'a'
,
'a'
,
'0'
,
'0'
,
'a'
,
'4'
,
'8'
,
'5'
,
'e'
,
'b'
,
'}'
,
0
};
static
const
BYTE
emptyCatMemberInfo
[]
=
{
0x30
,
0x05
,
0x1e
,
0x00
,
0x02
,
0x01
,
0x00
};
static
const
BYTE
catMemberInfoWithSillyGuid
[]
=
{
0x30
,
0x0b
,
0x1e
,
0x06
,
0x00
,
0x66
,
0x00
,
0x6f
,
0x00
,
0x6f
,
0x02
,
0x01
,
0x00
};
static
const
BYTE
catMemberInfoWithGuid
[]
=
{
0x30
,
0x51
,
0x1e
,
0x4c
,
0x00
,
0x7b
,
0x00
,
0x38
,
0x00
,
0x62
,
0x00
,
0x63
,
0x00
,
0x39
,
0x00
,
0x36
,
0x00
,
0x62
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x2d
,
0x00
,
0x38
,
0x00
,
0x64
,
0x00
,
0x61
,
0x00
,
0x31
,
0x00
,
0x2d
,
0x00
,
0x31
,
0x00
,
0x31
,
0x00
,
0x63
,
0x00
,
0x66
,
0x00
,
0x2d
,
0x00
,
0x38
,
0x00
,
0x37
,
0x00
,
0x33
,
0x00
,
0x36
,
0x00
,
0x2d
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x61
,
0x00
,
0x61
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x61
,
0x00
,
0x34
,
0x00
,
0x38
,
0x00
,
0x35
,
0x00
,
0x65
,
0x00
,
0x62
,
0x00
,
0x7d
,
0x02
,
0x01
,
0x00
};
static
void
test_encodeCatMemberInfo
(
void
)
{
CAT_MEMBERINFO
info
;
BOOL
ret
;
DWORD
size
=
0
;
LPBYTE
buf
;
memset
(
&
info
,
0
,
sizeof
(
info
));
if
(
!
pCryptEncodeObjectEx
)
{
skip
(
"CryptEncodeObjectEx() is not available. Skipping the encodeCatMemberInfo tests
\n
"
);
return
;
}
ret
=
pCryptEncodeObjectEx
(
X509_ASN_ENCODING
,
CAT_MEMBERINFO_STRUCT
,
&
info
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptEncodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
size
==
sizeof
(
emptyCatMemberInfo
),
"Unexpected size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
emptyCatMemberInfo
,
sizeof
(
emptyCatMemberInfo
)),
"Unexpected value
\n
"
);
LocalFree
(
buf
);
}
info
.
pwszSubjGuid
=
foo
;
ret
=
pCryptEncodeObjectEx
(
X509_ASN_ENCODING
,
CAT_MEMBERINFO_STRUCT
,
(
LPBYTE
)
&
info
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptEncodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
size
==
sizeof
(
catMemberInfoWithSillyGuid
),
"Unexpected size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
catMemberInfoWithSillyGuid
,
sizeof
(
catMemberInfoWithSillyGuid
)),
"Unexpected value
\n
"
);
LocalFree
(
buf
);
}
info
.
pwszSubjGuid
=
guidStr
;
ret
=
pCryptEncodeObjectEx
(
X509_ASN_ENCODING
,
CAT_MEMBERINFO_STRUCT
,
(
LPBYTE
)
&
info
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptEncodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
ok
(
size
==
sizeof
(
catMemberInfoWithGuid
),
"Unexpected size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
catMemberInfoWithGuid
,
sizeof
(
catMemberInfoWithGuid
)),
"Unexpected value
\n
"
);
LocalFree
(
buf
);
}
}
START_TEST
(
asn
)
{
HMODULE
hCrypt32
=
LoadLibraryA
(
"crypt32.dll"
);
...
...
@@ -474,6 +544,7 @@ START_TEST(asn)
test_decodeSPCLink
();
test_encodeSPCPEImage
();
test_decodeSPCPEImage
();
test_encodeCatMemberInfo
();
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