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
ac758a2a
Commit
ac758a2a
authored
Nov 06, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Add more tests for I_CryptGetDefaultCryptProv.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7d8ff72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
main.c
dlls/crypt32/tests/main.c
+52
-0
No files found.
dlls/crypt32/tests/main.c
View file @
ac758a2a
...
...
@@ -305,8 +305,32 @@ static void test_readTrustedPublisherDWORD(void)
static
void
test_getDefaultCryptProv
(
void
)
{
#define ALG(id) id, #id
static
const
struct
{
ALG_ID
algid
;
const
char
*
name
;
BOOL
optional
;
}
test_prov
[]
=
{
{
ALG
(
CALG_MD2
),
TRUE
},
{
ALG
(
CALG_MD4
),
TRUE
},
{
ALG
(
CALG_MD5
),
TRUE
},
{
ALG
(
CALG_SHA
),
TRUE
},
{
ALG
(
CALG_RSA_SIGN
)
},
{
ALG
(
CALG_DSS_SIGN
)
},
{
ALG
(
CALG_NO_SIGN
)
},
{
ALG
(
CALG_ECDSA
),
TRUE
},
{
ALG
(
CALG_ECDH
),
TRUE
},
{
ALG
(
CALG_RSA_KEYX
)
},
{
ALG
(
CALG_RSA_KEYX
)
},
};
#undef ALG
HCRYPTPROV
(
WINAPI
*
pI_CryptGetDefaultCryptProv
)(
DWORD
w
);
HCRYPTPROV
prov
;
BOOL
ret
;
DWORD
size
,
i
;
LPSTR
name
;
pI_CryptGetDefaultCryptProv
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"I_CryptGetDefaultCryptProv"
);
if
(
!
pI_CryptGetDefaultCryptProv
)
return
;
...
...
@@ -323,6 +347,34 @@ static void test_getDefaultCryptProv(void)
prov
=
pI_CryptGetDefaultCryptProv
(
0
);
ok
(
prov
!=
0
,
"I_CryptGetDefaultCryptProv failed: %08x
\n
"
,
GetLastError
());
CryptReleaseContext
(
prov
,
0
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
test_prov
);
i
++
)
{
if
(
winetest_debug
>
1
)
trace
(
"%u: algid %#x (%s): class %u, type %u, sid %u
\n
"
,
i
,
test_prov
[
i
].
algid
,
test_prov
[
i
].
name
,
GET_ALG_CLASS
(
test_prov
[
i
].
algid
)
>>
13
,
GET_ALG_TYPE
(
test_prov
[
i
].
algid
)
>>
9
,
GET_ALG_SID
(
test_prov
[
i
].
algid
));
prov
=
pI_CryptGetDefaultCryptProv
(
test_prov
[
i
].
algid
);
if
(
!
prov
)
{
todo_wine_if
(
!
test_prov
[
i
].
optional
)
ok
(
test_prov
[
i
].
optional
,
"%u: I_CryptGetDefaultCryptProv(%#x) failed
\n
"
,
i
,
test_prov
[
i
].
algid
);
continue
;
}
ret
=
CryptGetProvParam
(
prov
,
PP_NAME
,
NULL
,
&
size
,
0
);
if
(
ret
)
/* some provders don't support PP_NAME */
{
name
=
CryptMemAlloc
(
size
);
ret
=
CryptGetProvParam
(
prov
,
PP_NAME
,
(
BYTE
*
)
name
,
&
size
,
0
);
ok
(
ret
,
"%u: CryptGetProvParam failed %#x
\n
"
,
i
,
GetLastError
());
if
(
winetest_debug
>
1
)
trace
(
"%u: algid %#x, name %s
\n
"
,
i
,
test_prov
[
i
].
algid
,
name
);
CryptMemFree
(
name
);
}
CryptReleaseContext
(
prov
,
0
);
}
}
static
void
test_CryptInstallOssGlobal
(
void
)
...
...
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