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
32b23dd1
Commit
32b23dd1
authored
Mar 17, 2020
by
Serge Gautherie
Committed by
Alexandre Julliard
Mar 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add more cases for CryptReleaseContext().
Signed-off-by:
Serge Gautherie
<
winehq-git_serge_180711@gautherie.fr
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
812c9818
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
5 deletions
+52
-5
crypt.c
dlls/advapi32/tests/crypt.c
+52
-5
No files found.
dlls/advapi32/tests/crypt.c
View file @
32b23dd1
...
...
@@ -125,6 +125,56 @@ static void clean_up_environment(void)
}
}
static
void
test_CryptReleaseContext
(
void
)
{
BOOL
ret
;
HCRYPTPROV
prov
;
/* TODO: Add cases for ERROR_BUSY, ERROR_INVALID_HANDLE and NTE_BAD_UID */
/* NULL provider */
SetLastError
(
0xdeadbeef
);
ret
=
CryptReleaseContext
(
0
,
0
);
ok
(
!
ret
,
"CryptReleaseContext succeeded unexpectedly
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptReleaseContext
(
0
,
~
0
);
ok
(
!
ret
,
"CryptReleaseContext succeeded unexpectedly
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
GetLastError
());
/* Additional refcount */
ret
=
CryptAcquireContextA
(
&
prov
,
szKeySet
,
szRsaBaseProv
,
PROV_RSA_FULL
,
0
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
CryptContextAddRef
(
prov
,
NULL
,
0
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
CryptReleaseContext
(
prov
,
0
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
/* Nonzero flags, which allow release nonetheless */
SetLastError
(
0xdeadbeef
);
ret
=
CryptReleaseContext
(
prov
,
~
0
);
ok
(
!
ret
,
"CryptReleaseContext succeeded unexpectedly
\n
"
);
ok
(
GetLastError
()
==
NTE_BAD_FLAGS
,
"got %u
\n
"
,
GetLastError
());
/* Obsolete provider */
SetLastError
(
0xdeadbeef
);
ret
=
CryptReleaseContext
(
prov
,
0
);
ok
(
!
ret
,
"CryptReleaseContext succeeded unexpectedly
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
CryptReleaseContext
(
prov
,
~
0
);
ok
(
!
ret
,
"CryptReleaseContext succeeded unexpectedly
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
GetLastError
());
}
static
void
test_acquire_context
(
void
)
{
BOOL
result
;
...
...
@@ -259,11 +309,6 @@ static void test_incorrect_api_usage(void)
ok
(
result
,
"got %u
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
SetLastError
(
0xdeadbeef
);
result
=
CryptReleaseContext
(
hProv
,
0
);
ok
(
!
result
,
"CryptReleaseContext succeeded unexpectedly
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
GetLastError
());
result
=
pCryptGenRandom
(
hProv
,
1
,
&
temp
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d
\n
"
,
GetLastError
());
...
...
@@ -1166,7 +1211,9 @@ START_TEST(crypt)
init_function_pointers
();
test_rc2_keylen
();
init_environment
();
test_CryptReleaseContext
();
test_acquire_context
();
test_incorrect_api_usage
();
test_verify_sig
();
...
...
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