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
fc78c224
Commit
fc78c224
authored
Nov 21, 2011
by
Alexander Morozov
Committed by
Alexandre Julliard
Nov 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Add some tests for CryptDecodeObjectEx without CRYPT_DECODE_ALLOC_FLAG.
parent
c360ee0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
107 additions
and
0 deletions
+107
-0
encode.c
dlls/crypt32/tests/encode.c
+107
-0
No files found.
dlls/crypt32/tests/encode.c
View file @
fc78c224
...
...
@@ -2710,6 +2710,21 @@ static void test_decodeExtensions(DWORD dwEncoding)
}
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_EXTENSIONS
,
exts
[
i
].
encoded
,
exts
[
i
].
encoded
[
1
]
+
2
,
0
,
NULL
,
NULL
,
&
bufSize
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
bufSize
);
if
(
buf
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_EXTENSIONS
,
exts
[
i
].
encoded
,
exts
[
i
].
encoded
[
1
]
+
2
,
0
,
NULL
,
buf
,
&
bufSize
);
if
(
!
i
)
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
else
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
}
...
...
@@ -3601,6 +3616,20 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
ok
(
!
lstrcmpW
(
U
(
*
entry
).
pwszURL
,
url
),
"Unexpected name
\n
"
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CRL_DIST_POINTS
,
distPointWithUrlAndIssuer
,
distPointWithUrlAndIssuer
[
1
]
+
2
,
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
buf
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CRL_DIST_POINTS
,
distPointWithUrlAndIssuer
,
distPointWithUrlAndIssuer
[
1
]
+
2
,
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
static
const
BYTE
badFlagsIDP
[]
=
{
0x30
,
0x06
,
0x81
,
0x01
,
0xff
,
0x82
,
0x01
,
0xff
};
...
...
@@ -4741,6 +4770,18 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
usage
->
rgpszUsageIdentifier
[
i
]);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ENHANCED_KEY_USAGE
,
encodedUsage
,
sizeof
(
encodedUsage
),
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
buf
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ENHANCED_KEY_USAGE
,
encodedUsage
,
sizeof
(
encodedUsage
),
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
static
BYTE
keyId
[]
=
{
1
,
2
,
3
,
4
};
...
...
@@ -5215,6 +5256,20 @@ static void test_decodeAuthorityInfoAccess(DWORD dwEncoding)
LocalFree
(
buf
);
buf
=
NULL
;
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_AUTHORITY_INFO_ACCESS
,
authorityInfoAccessWithUrlAndIPAddr
,
sizeof
(
authorityInfoAccessWithUrlAndIPAddr
),
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
buf
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_AUTHORITY_INFO_ACCESS
,
authorityInfoAccessWithUrlAndIPAddr
,
sizeof
(
authorityInfoAccessWithUrlAndIPAddr
),
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
static
const
BYTE
emptyCTL
[]
=
{
...
...
@@ -6168,6 +6223,18 @@ static void test_decodePKCSAttributes(DWORD dwEncoding)
attributes
->
rgAttr
[
1
].
rgValue
[
0
].
cbData
),
"Unexpected value
\n
"
);
LocalFree
(
buf
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_ATTRIBUTES
,
doublePKCSAttributes
,
sizeof
(
doublePKCSAttributes
),
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
buf
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_ATTRIBUTES
,
doublePKCSAttributes
,
sizeof
(
doublePKCSAttributes
),
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
static
const
BYTE
singleCapability
[]
=
{
...
...
@@ -6325,6 +6392,20 @@ static void test_decodePKCSSMimeCapabilities(DWORD dwEncoding)
compareSMimeCapabilities
(
"two capabilities"
,
&
capabilities
,
ptr
);
LocalFree
(
ptr
);
}
SetLastError
(
0xdeadbeef
);
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_SMIME_CAPABILITIES
,
twoCapabilities
,
sizeof
(
twoCapabilities
),
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ptr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
ptr
)
{
SetLastError
(
0xdeadbeef
);
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_SMIME_CAPABILITIES
,
twoCapabilities
,
sizeof
(
twoCapabilities
),
0
,
NULL
,
ptr
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
}
static
BYTE
encodedCommonNameNoNull
[]
=
{
0x30
,
0x14
,
0x31
,
0x12
,
0x30
,
0x10
,
...
...
@@ -7487,6 +7568,18 @@ static void test_decodeCertPolicies(DWORD dwEncoding)
"unexpected qualifier value
\n
"
);
LocalFree
(
info
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CERT_POLICIES
,
twoPolicies
,
sizeof
(
twoPolicies
),
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
info
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
info
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CERT_POLICIES
,
twoPolicies
,
sizeof
(
twoPolicies
),
0
,
NULL
,
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
info
);
}
}
static
const
BYTE
policyMappingWithOneMapping
[]
=
{
...
...
@@ -7630,6 +7723,20 @@ static void test_decodeCertPolicyMappings(DWORD dwEncoding)
info
->
rgPolicyMapping
[
1
].
pszSubjectDomainPolicy
);
LocalFree
(
info
);
}
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
mappingOids
[
i
],
policyMappingWithTwoMappings
,
sizeof
(
policyMappingWithTwoMappings
),
0
,
NULL
,
NULL
,
&
size
);
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
info
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
info
)
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
mappingOids
[
i
],
policyMappingWithTwoMappings
,
sizeof
(
policyMappingWithTwoMappings
),
0
,
NULL
,
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
info
);
}
}
}
...
...
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