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
04acc70d
Commit
04acc70d
authored
Oct 20, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dssenh/tests: Add tests for CryptDuplicateKey.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c2883d77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
dssenh.c
dlls/dssenh/tests/dssenh.c
+31
-0
No files found.
dlls/dssenh/tests/dssenh.c
View file @
04acc70d
...
...
@@ -1514,6 +1514,36 @@ static void test_userkey(void)
ok
(
!
hprov
,
"got %08x
\n
"
,
(
DWORD
)
hprov
);
}
static
void
test_duplicate_key
(
void
)
{
HCRYPTPROV
hprov
;
HCRYPTKEY
hkey
,
hkey2
;
DWORD
len
;
BOOL
result
;
BYTE
buf
[
512
];
result
=
CryptAcquireContextA
(
&
hprov
,
NULL
,
MS_DEF_DSS_PROV_A
,
PROV_DSS
,
CRYPT_VERIFYCONTEXT
);
ok
(
result
,
"got %08x
\n
"
,
GetLastError
());
result
=
CryptImportKey
(
hprov
,
DSS_SIGN_PrivateKey
,
sizeof
(
DSS_SIGN_PrivateKey
),
0
,
CRYPT_EXPORTABLE
,
&
hkey
);
ok
(
result
,
"got %08x
\n
"
,
GetLastError
());
result
=
CryptDuplicateKey
(
hkey
,
NULL
,
0
,
&
hkey2
);
ok
(
result
,
"got %08x
\n
"
,
GetLastError
());
len
=
sizeof
(
buf
);
result
=
CryptExportKey
(
hkey2
,
0
,
PRIVATEKEYBLOB
,
0
,
buf
,
&
len
);
ok
(
result
,
"got %08x
\n
"
,
GetLastError
());
ok
(
len
==
sizeof
(
DSS_SIGN_PrivateKey
),
"got %u
\n
"
,
len
);
ok
(
!
memcmp
(
buf
,
DSS_SIGN_PrivateKey
,
sizeof
(
DSS_SIGN_PrivateKey
)),
"wrong data
\n
"
);
result
=
CryptDestroyKey
(
hkey2
);
ok
(
result
,
"got %08x
\n
"
,
GetLastError
());
result
=
CryptDestroyKey
(
hkey
);
ok
(
result
,
"got %08x
\n
"
,
GetLastError
());
}
START_TEST
(
dssenh
)
{
test_acquire_context
();
...
...
@@ -1525,4 +1555,5 @@ START_TEST(dssenh)
test_key_exchange
();
test_duplicate_hash
();
test_userkey
();
test_duplicate_key
();
}
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