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
ddf78bdb
Commit
ddf78bdb
authored
Nov 09, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Test decoding alternate names with embedded NULLs.
parent
6a3901f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
encode.c
dlls/crypt32/tests/encode.c
+38
-0
No files found.
dlls/crypt32/tests/encode.c
View file @
ddf78bdb
...
...
@@ -1541,6 +1541,12 @@ static void test_decodeAltName(DWORD dwEncoding)
0x00
,
0x00
,
0x01
};
static
const
BYTE
bogusType
[]
=
{
0x30
,
0x06
,
0x89
,
0x04
,
0x7f
,
0x00
,
0x00
,
0x01
};
static
const
BYTE
dns_embedded_null
[]
=
{
0x30
,
0x10
,
0x82
,
0x0e
,
0x66
,
0x6f
,
0x6f
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x00
,
0x62
,
0x61
,
0x64
,
0x64
,
0x69
,
0x65
};
static
const
BYTE
dns_embedded_bell
[]
=
{
0x30
,
0x10
,
0x82
,
0x0e
,
0x66
,
0x6f
,
0x6f
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x07
,
0x62
,
0x61
,
0x64
,
0x64
,
0x69
,
0x65
};
static
const
BYTE
url_embedded_null
[]
=
{
0x30
,
0x10
,
0x86
,
0x0e
,
0x66
,
0x6f
,
0x6f
,
0x2e
,
0x63
,
0x6f
,
0x6d
,
0x00
,
0x62
,
0x61
,
0x64
,
0x64
,
0x69
,
0x65
};
BOOL
ret
;
BYTE
*
buf
=
NULL
;
DWORD
bufSize
=
0
;
...
...
@@ -1679,6 +1685,38 @@ static void test_decodeAltName(DWORD dwEncoding)
"Unexpected directory name value
\n
"
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ALTERNATE_NAME
,
dns_embedded_null
,
sizeof
(
dns_embedded_null
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
bufSize
);
/* Fails on WinXP with CRYPT_E_ASN1_RULE. I'm not too concerned about the
* particular failure, just that it doesn't decode.
*/
todo_wine
ok
(
!
ret
,
"expected failure
\n
"
);
/* An embedded bell character is allowed, however. */
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ALTERNATE_NAME
,
dns_embedded_bell
,
sizeof
(
dns_embedded_bell
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
bufSize
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
info
=
(
CERT_ALT_NAME_INFO
*
)
buf
;
ok
(
info
->
cAltEntry
==
1
,
"Expected 1 entries, got %d
\n
"
,
info
->
cAltEntry
);
ok
(
info
->
rgAltEntry
[
0
].
dwAltNameChoice
==
CERT_ALT_NAME_DNS_NAME
,
"Expected CERT_ALT_NAME_DNS_NAME, got %d
\n
"
,
info
->
rgAltEntry
[
0
].
dwAltNameChoice
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ALTERNATE_NAME
,
url_embedded_null
,
sizeof
(
dns_embedded_null
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
bufSize
);
/* Again, fails on WinXP with CRYPT_E_ASN1_RULE. I'm not too concerned
* about the particular failure, just that it doesn't decode.
*/
todo_wine
ok
(
!
ret
,
"expected failure
\n
"
);
}
struct
UnicodeExpectedError
...
...
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