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
46ebd667
Commit
46ebd667
authored
Mar 02, 2005
by
Stefan Leichter
Committed by
Alexandre Julliard
Mar 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make rsaenh_crosstest.exe loadable on NT 4.0.
parent
a6044154
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+21
-15
No files found.
dlls/rsaenh/tests/rsaenh.c
View file @
46ebd667
...
@@ -31,6 +31,8 @@ static const char szContainer[] = "winetest";
...
@@ -31,6 +31,8 @@ static const char szContainer[] = "winetest";
static
const
unsigned
char
pbData
[]
=
"Wine rocks totally!"
;
static
const
unsigned
char
pbData
[]
=
"Wine rocks totally!"
;
static
const
char
szProvider
[]
=
MS_ENHANCED_PROV_A
;
static
const
char
szProvider
[]
=
MS_ENHANCED_PROV_A
;
static
BOOL
(
WINAPI
*
pCryptDuplicateHash
)
(
HCRYPTHASH
,
DWORD
*
,
DWORD
,
HCRYPTHASH
*
);
/*
/*
static void trace_hex(BYTE *pbData, DWORD dwLen) {
static void trace_hex(BYTE *pbData, DWORD dwLen) {
char szTemp[256];
char szTemp[256];
...
@@ -54,6 +56,8 @@ static int init_environment(void)
...
@@ -54,6 +56,8 @@ static int init_environment(void)
HCRYPTKEY
hKey
;
HCRYPTKEY
hKey
;
BOOL
result
;
BOOL
result
;
pCryptDuplicateHash
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"advapi32.dll"
),
"CryptDuplicateHash"
);
hProv
=
(
HCRYPTPROV
)
INVALID_HANDLE_VALUE
;
hProv
=
(
HCRYPTPROV
)
INVALID_HANDLE_VALUE
;
result
=
CryptAcquireContext
(
&
hProv
,
szContainer
,
szProvider
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
result
=
CryptAcquireContext
(
&
hProv
,
szContainer
,
szProvider
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
...
@@ -246,28 +250,30 @@ static void test_hashes(void)
...
@@ -246,28 +250,30 @@ static void test_hashes(void)
result
=
CryptHashData
(
hHash
,
(
BYTE
*
)
pbData
,
5
,
0
);
result
=
CryptHashData
(
hHash
,
(
BYTE
*
)
pbData
,
5
,
0
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
result
=
CryptDuplicateHash
(
hHash
,
0
,
0
,
&
hHashClone
);
if
(
pCryptDuplicateHash
)
{
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
result
=
pCryptDuplicateHash
(
hHash
,
0
,
0
,
&
hHashClone
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
result
=
CryptHashData
(
hHashClone
,
(
BYTE
*
)
pbData
+
5
,
sizeof
(
pbData
)
-
5
,
0
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
len
=
sizeof
(
DWORD
);
result
=
CryptHashData
(
hHashClone
,
(
BYTE
*
)
pbData
+
5
,
sizeof
(
pbData
)
-
5
,
0
);
result
=
CryptGetHashParam
(
hHashClone
,
HP_HASHSIZE
,
(
BYTE
*
)
&
hashlen
,
&
len
,
0
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
ok
(
result
&&
(
hashlen
==
20
),
"%08lx, hashlen: %ld
\n
"
,
GetLastError
(),
hashlen
);
len
=
20
;
len
=
sizeof
(
DWORD
)
;
result
=
CryptGetHashParam
(
hHashClone
,
HP_HASHVAL
,
pbHashValue
,
&
len
,
0
);
result
=
CryptGetHashParam
(
hHashClone
,
HP_HASHSIZE
,
(
BYTE
*
)
&
hashlen
,
&
len
,
0
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
()
);
ok
(
result
&&
(
hashlen
==
20
),
"%08lx, hashlen: %ld
\n
"
,
GetLastError
(),
hashlen
);
ok
(
!
memcmp
(
pbHashValue
,
sha1hash
,
20
),
"Wrong SHA1 hash!
\n
"
);
len
=
20
;
result
=
CryptGetHashParam
(
hHashClone
,
HP_HASHVAL
,
pbHashValue
,
&
len
,
0
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
result
=
CryptDestroyHash
(
hHashClone
);
ok
(
!
memcmp
(
pbHashValue
,
sha1hash
,
20
),
"Wrong SHA1 hash!
\n
"
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
result
=
CryptDestroyHash
(
hHashClone
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
}
result
=
CryptDestroyHash
(
hHash
);
result
=
CryptDestroyHash
(
hHash
);
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
ok
(
result
,
"%08lx
\n
"
,
GetLastError
());
}
}
static
void
test_block_cipher_modes
()
static
void
test_block_cipher_modes
()
{
{
...
...
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