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
3b7c61dc
Commit
3b7c61dc
authored
Jul 12, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jul 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh/tests: Add a pre XP DES compatibility test.
parent
c579945b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+22
-0
No files found.
dlls/rsaenh/tests/rsaenh.c
View file @
3b7c61dc
...
@@ -894,6 +894,9 @@ static void test_des(void)
...
@@ -894,6 +894,9 @@ static void test_des(void)
static
const
BYTE
des
[
16
]
=
{
static
const
BYTE
des
[
16
]
=
{
0x58
,
0x86
,
0x42
,
0x46
,
0x65
,
0x4b
,
0x92
,
0x62
,
0x58
,
0x86
,
0x42
,
0x46
,
0x65
,
0x4b
,
0x92
,
0x62
,
0xcf
,
0x0f
,
0x65
,
0x37
,
0x43
,
0x7a
,
0x82
,
0xb9
};
0xcf
,
0x0f
,
0x65
,
0x37
,
0x43
,
0x7a
,
0x82
,
0xb9
};
static
const
BYTE
des_old_behavior
[
16
]
=
{
0xb0
,
0xfd
,
0x11
,
0x69
,
0x76
,
0xb1
,
0xa1
,
0x03
,
0xf7
,
0xbc
,
0x23
,
0xaa
,
0xd4
,
0xc1
,
0xc9
,
0x55
};
int
i
;
int
i
;
result
=
derive_key
(
CALG_DES
,
&
hKey
,
0
);
result
=
derive_key
(
CALG_DES
,
&
hKey
,
0
);
...
@@ -981,6 +984,25 @@ static void test_des(void)
...
@@ -981,6 +984,25 @@ static void test_des(void)
result
=
CryptDestroyKey
(
hKey
);
result
=
CryptDestroyKey
(
hKey
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
/* Windows >= XP changed the way DES keys are derived, this test ensures we don't break that */
derive_key
(
CALG_DES
,
&
hKey
,
56
);
dwMode
=
CRYPT_MODE_ECB
;
result
=
CryptSetKeyParam
(
hKey
,
KP_MODE
,
(
BYTE
*
)
&
dwMode
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
for
(
i
=
0
;
i
<
sizeof
(
pbData
);
i
++
)
pbData
[
i
]
=
(
unsigned
char
)
i
;
dwLen
=
13
;
result
=
CryptEncrypt
(
hKey
,
0
,
TRUE
,
0
,
pbData
,
&
dwLen
,
16
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
pbData
,
des
,
sizeof
(
des
))
||
broken
(
!
memcmp
(
pbData
,
des_old_behavior
,
sizeof
(
des
)))
/* <= 2000 */
,
"DES encryption failed!
\n
"
);
result
=
CryptDestroyKey
(
hKey
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
}
}
static
void
test_3des
(
void
)
static
void
test_3des
(
void
)
...
...
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