Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7897c5a6
Commit
7897c5a6
authored
Jan 13, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt/tests: Don't load bcrypt dynamically.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2cd8d273
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
47 deletions
+14
-47
configure
configure
+1
-1
configure.ac
configure.ac
+1
-1
Makefile.in
dlls/bcrypt/Makefile.in
+1
-0
Makefile.in
dlls/bcrypt/tests/Makefile.in
+1
-1
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
+10
-44
No files found.
configure
View file @
7897c5a6
...
...
@@ -17379,7 +17379,7 @@ wine_fn_config_dll avifil32 enable_avifil32 clean,implib,po
wine_fn_config_test dlls/avifil32/tests avifil32_test
wine_fn_config_dll avifile.dll16 enable_win16
wine_fn_config_dll avrt enable_avrt implib
wine_fn_config_dll bcrypt enable_bcrypt
wine_fn_config_dll bcrypt enable_bcrypt
implib
wine_fn_config_test dlls/bcrypt/tests bcrypt_test
wine_fn_config_dll bluetoothapis enable_bluetoothapis
wine_fn_config_dll browseui enable_browseui clean,po
...
...
configure.ac
View file @
7897c5a6
...
...
@@ -2723,7 +2723,7 @@ WINE_CONFIG_DLL(avifil32,,[clean,implib,po])
WINE_CONFIG_TEST(dlls/avifil32/tests)
WINE_CONFIG_DLL(avifile.dll16,enable_win16)
WINE_CONFIG_DLL(avrt,,[implib])
WINE_CONFIG_DLL(bcrypt)
WINE_CONFIG_DLL(bcrypt
,,[implib]
)
WINE_CONFIG_TEST(dlls/bcrypt/tests)
WINE_CONFIG_DLL(bluetoothapis)
WINE_CONFIG_DLL(browseui,,[clean,po])
...
...
dlls/bcrypt/Makefile.in
View file @
7897c5a6
MODULE
=
bcrypt.dll
IMPORTS
=
advapi32
IMPORTLIB
=
bcrypt
EXTRAINCL
=
$(GNUTLS_CFLAGS)
C_SRCS
=
\
...
...
dlls/bcrypt/tests/Makefile.in
View file @
7897c5a6
TESTDLL
=
bcrypt.dll
IMPORTS
=
user32
IMPORTS
=
bcrypt
user32
C_SRCS
=
\
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
View file @
7897c5a6
...
...
@@ -25,57 +25,32 @@
#include "wine/test.h"
static
NTSTATUS
(
WINAPI
*
pBCryptGenRandom
)(
BCRYPT_ALG_HANDLE
hAlgorithm
,
PUCHAR
pbBuffer
,
ULONG
cbBuffer
,
ULONG
dwFlags
);
static
NTSTATUS
(
WINAPI
*
pBCryptGetFipsAlgorithmMode
)(
BOOLEAN
*
enabled
);
static
BOOL
Init
(
void
)
{
HMODULE
hbcrypt
=
LoadLibraryA
(
"bcrypt.dll"
);
if
(
!
hbcrypt
)
{
win_skip
(
"bcrypt library not available
\n
"
);
return
FALSE
;
}
pBCryptGenRandom
=
(
void
*
)
GetProcAddress
(
hbcrypt
,
"BCryptGenRandom"
);
pBCryptGetFipsAlgorithmMode
=
(
void
*
)
GetProcAddress
(
hbcrypt
,
"BCryptGetFipsAlgorithmMode"
);
return
TRUE
;
}
static
void
test_BCryptGenRandom
(
void
)
{
NTSTATUS
ret
;
UCHAR
buffer
[
256
];
if
(
!
pBCryptGenRandom
)
{
win_skip
(
"BCryptGenRandom is not available
\n
"
);
return
;
}
ret
=
pBCryptGenRandom
(
NULL
,
NULL
,
0
,
0
);
ret
=
BCryptGenRandom
(
NULL
,
NULL
,
0
,
0
);
ok
(
ret
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got 0x%x
\n
"
,
ret
);
ret
=
p
BCryptGenRandom
(
NULL
,
buffer
,
0
,
0
);
ret
=
BCryptGenRandom
(
NULL
,
buffer
,
0
,
0
);
ok
(
ret
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got 0x%x
\n
"
,
ret
);
ret
=
p
BCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
0
);
ret
=
BCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
0
);
ok
(
ret
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got 0x%x
\n
"
,
ret
);
ret
=
p
BCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ret
=
BCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ok
(
ret
==
STATUS_SUCCESS
,
"Expected success, got 0x%x
\n
"
,
ret
);
ret
=
p
BCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
ret
=
BCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
|
BCRYPT_RNG_USE_ENTROPY_IN_BUFFER
);
ok
(
ret
==
STATUS_SUCCESS
,
"Expected success, got 0x%x
\n
"
,
ret
);
ret
=
p
BCryptGenRandom
(
NULL
,
NULL
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ret
=
BCryptGenRandom
(
NULL
,
NULL
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ok
(
ret
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got 0x%x
\n
"
,
ret
);
/* Zero sized buffer should work too */
ret
=
p
BCryptGenRandom
(
NULL
,
buffer
,
0
,
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ret
=
BCryptGenRandom
(
NULL
,
buffer
,
0
,
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ok
(
ret
==
STATUS_SUCCESS
,
"Expected success, got 0x%x
\n
"
,
ret
);
/* Test random number generation - It's impossible for a sane RNG to return 8 zeros */
memset
(
buffer
,
0
,
16
);
ret
=
p
BCryptGenRandom
(
NULL
,
buffer
,
8
,
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ret
=
BCryptGenRandom
(
NULL
,
buffer
,
8
,
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ok
(
ret
==
STATUS_SUCCESS
,
"Expected success, got 0x%x
\n
"
,
ret
);
ok
(
memcmp
(
buffer
,
buffer
+
8
,
8
),
"Expected a random number, got 0
\n
"
);
}
...
...
@@ -85,24 +60,15 @@ static void test_BCryptGetFipsAlgorithmMode(void)
NTSTATUS
ret
;
BOOLEAN
enabled
;
if
(
!
pBCryptGetFipsAlgorithmMode
)
{
win_skip
(
"BCryptGetFipsAlgorithmMode is not available
\n
"
);
return
;
}
ret
=
pBCryptGetFipsAlgorithmMode
(
&
enabled
);
ret
=
BCryptGetFipsAlgorithmMode
(
&
enabled
);
ok
(
ret
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got 0x%x
\n
"
,
ret
);
ret
=
p
BCryptGetFipsAlgorithmMode
(
NULL
);
ret
=
BCryptGetFipsAlgorithmMode
(
NULL
);
ok
(
ret
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got 0x%x
\n
"
,
ret
);
}
START_TEST
(
bcrypt
)
{
if
(
!
Init
())
return
;
test_BCryptGenRandom
();
test_BCryptGetFipsAlgorithmMode
();
}
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