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
b4b0c243
Commit
b4b0c243
authored
Jul 30, 2004
by
Michael Jung
Committed by
Alexandre Julliard
Jul 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a tiny unit test for rsabase.dll.
parent
ee15af05
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
0 deletions
+103
-0
configure
configure
+0
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/rsabase/Makefile.in
+2
-0
.cvsignore
dlls/rsabase/tests/.cvsignore
+3
-0
Makefile.in
dlls/rsabase/tests/Makefile.in
+13
-0
rsabase.c
dlls/rsabase/tests/rsabase.c
+84
-0
No files found.
configure
View file @
b4b0c243
This diff is collapsed.
Click to expand it.
configure.ac
View file @
b4b0c243
...
...
@@ -1632,6 +1632,7 @@ dlls/richedit/Makefile
dlls/rpcrt4/Makefile
dlls/rpcrt4/tests/Makefile
dlls/rsabase/Makefile
dlls/rsabase/tests/Makefile
dlls/secur32/Makefile
dlls/serialui/Makefile
dlls/setupapi/Makefile
...
...
dlls/rsabase/Makefile.in
View file @
b4b0c243
...
...
@@ -9,6 +9,8 @@ IMPORTS = advapi32 kernel32
C_SRCS
=
\
main.c
SUBDIRS
=
tests
@MAKE_DLL_RULES@
### Dependencies:
dlls/rsabase/tests/.cvsignore
0 → 100644
View file @
b4b0c243
Makefile
rsabase.ok
testlist.c
dlls/rsabase/tests/Makefile.in
0 → 100644
View file @
b4b0c243
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
rsabase.dll
IMPORTS
=
advapi32 kernel32
CTESTS
=
\
rsabase.c
@MAKE_TEST_RULES@
### Dependencies:
dlls/rsabase/tests/rsabase.c
0 → 100644
View file @
b4b0c243
/*
* Unit tests for rsabase functions
*
* Copyright (c) 2004 Michael Jung
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wincrypt.h"
HCRYPTPROV
hProv
;
static
const
char
szContainer
[]
=
"Wine Test Container"
;
static
const
char
szProvider
[]
=
MS_DEF_PROV_A
;
static
int
init_environment
(
void
)
{
hProv
=
(
HCRYPTPROV
)
INVALID_HANDLE_VALUE
;
if
(
!
CryptAcquireContext
(
&
hProv
,
szContainer
,
szProvider
,
PROV_RSA_FULL
,
0
))
{
if
(
GetLastError
()
==
NTE_BAD_KEYSET
)
{
if
(
!
CryptAcquireContext
(
&
hProv
,
szContainer
,
szProvider
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
))
{
trace
(
"%08x
\n
"
,
(
unsigned
int
)
GetLastError
());
return
0
;
}
}
else
{
trace
(
"%08x
\n
"
,
(
unsigned
int
)
GetLastError
());
return
0
;
}
}
return
1
;
}
static
void
clean_up_environment
(
void
)
{
CryptAcquireContext
(
&
hProv
,
szContainer
,
szProvider
,
PROV_RSA_FULL
,
CRYPT_DELETEKEYSET
);
}
static
void
test_gen_random
()
{
BOOL
result
;
BYTE
rnd1
[
16
],
rnd2
[
16
];
memset
(
rnd1
,
0
,
sizeof
(
rnd1
));
memset
(
rnd2
,
0
,
sizeof
(
rnd2
));
result
=
CryptGenRandom
(
hProv
,
sizeof
(
rnd1
),
rnd1
);
ok
(
result
,
"%08x
\n
"
,
(
unsigned
int
)
GetLastError
());
result
=
CryptGenRandom
(
hProv
,
sizeof
(
rnd2
),
rnd2
);
ok
(
result
,
"%08x
\n
"
,
(
unsigned
int
)
GetLastError
());
ok
(
memcmp
(
rnd1
,
rnd2
,
sizeof
(
rnd1
)),
"CryptGenRandom generates non random data
\n
"
);
}
START_TEST
(
rsabase
)
{
if
(
!
init_environment
())
return
;
test_gen_random
();
clean_up_environment
();
}
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