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
d59011a9
Commit
d59011a9
authored
Aug 05, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Aug 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: A 40 bit key on Enhanced provider will not have salt even if asked for.
parent
d7aae7d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
26 deletions
+11
-26
rsaenh.c
dlls/rsaenh/rsaenh.c
+11
-1
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+0
-25
No files found.
dlls/rsaenh/rsaenh.c
View file @
d59011a9
...
...
@@ -873,6 +873,7 @@ static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTK
destroy_key
,
(
OBJECTHDR
**
)
&
pCryptKey
);
if
(
hCryptKey
!=
(
HCRYPTKEY
)
INVALID_HANDLE_VALUE
)
{
KEYCONTAINER
*
pKeyContainer
=
get_key_container
(
hProv
);
pCryptKey
->
aiAlgid
=
aiAlgid
;
pCryptKey
->
hProv
=
hProv
;
pCryptKey
->
dwModeBits
=
0
;
...
...
@@ -882,7 +883,16 @@ static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTK
pCryptKey
->
dwPermissions
|=
CRYPT_EXPORT
;
pCryptKey
->
dwKeyLen
=
dwKeyLen
>>
3
;
pCryptKey
->
dwEffectiveKeyLen
=
0
;
if
((
dwFlags
&
CRYPT_CREATE_SALT
)
||
(
dwKeyLen
==
40
&&
!
(
dwFlags
&
CRYPT_NO_SALT
)))
/*
* For compatibility reasons a 40 bit key on the Enhanced
* provider will not have salt
*/
if
(
pKeyContainer
->
dwPersonality
==
RSAENH_PERSONALITY_ENHANCED
&&
(
aiAlgid
==
CALG_RC2
||
aiAlgid
==
CALG_RC4
)
&&
(
dwFlags
&
CRYPT_CREATE_SALT
)
&&
dwKeyLen
==
40
)
pCryptKey
->
dwSaltLen
=
0
;
else
if
((
dwFlags
&
CRYPT_CREATE_SALT
)
||
(
dwKeyLen
==
40
&&
!
(
dwFlags
&
CRYPT_NO_SALT
)))
pCryptKey
->
dwSaltLen
=
16
/*FIXME*/
-
pCryptKey
->
dwKeyLen
;
else
pCryptKey
->
dwSaltLen
=
0
;
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
d59011a9
...
...
@@ -1604,22 +1604,10 @@ static void test_rc2(void)
result
=
CryptEncrypt
(
hKey
,
0
,
TRUE
,
0
,
pbData
,
&
dwDataLen
,
24
);
if
(
result
)
{
/* Remove IF when fixed */
if
(
ENHANCED_PROV
)
{
todo_wine
ok
((
ENHANCED_PROV
&&
!
memcmp
(
pbData
,
rc2_40_salt_enh
,
dwDataLen
))
||
(
STRONG_PROV
&&
!
memcmp
(
pbData
,
rc2_40_salt_strong
,
dwDataLen
))
||
(
BASE_PROV
&&
!
memcmp
(
pbData
,
rc2_40_salt_base
,
dwDataLen
)),
"RC2 encryption failed!
\n
"
);
}
else
{
ok
((
ENHANCED_PROV
&&
!
memcmp
(
pbData
,
rc2_40_salt_enh
,
dwDataLen
))
||
(
STRONG_PROV
&&
!
memcmp
(
pbData
,
rc2_40_salt_strong
,
dwDataLen
))
||
(
BASE_PROV
&&
!
memcmp
(
pbData
,
rc2_40_salt_base
,
dwDataLen
)),
"RC2 encryption failed!
\n
"
);
}
}
else
/* <= XP */
{
...
...
@@ -1640,7 +1628,6 @@ static void test_rc2(void)
if
(
!
ENHANCED_PROV
)
ok
(
dwLen
==
11
,
"Expected 11, got %d
\n
"
,
dwLen
);
else
todo_wine
ok
(
dwLen
==
0
,
"Expected 0, got %d
\n
"
,
dwLen
);
result
=
CryptDestroyKey
(
hKey
);
...
...
@@ -1778,20 +1765,9 @@ static void test_rc4(void)
SetLastError
(
0xdeadbeef
);
result
=
CryptEncrypt
(
hKey
,
0
,
TRUE
,
0
,
pbData
,
&
dwDataLen
,
24
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
/* Remove IF when fixed */
if
(
ENHANCED_PROV
)
{
todo_wine
ok
((
ENHANCED_PROV
&&
!
memcmp
(
pbData
,
rc4_40_salt
,
dwDataLen
))
||
(
!
ENHANCED_PROV
&&
!
memcmp
(
pbData
,
rc4_40_salt_base
,
dwDataLen
)),
"RC4 encryption failed!
\n
"
);
}
else
{
ok
((
ENHANCED_PROV
&&
!
memcmp
(
pbData
,
rc4_40_salt
,
dwDataLen
))
||
(
!
ENHANCED_PROV
&&
!
memcmp
(
pbData
,
rc4_40_salt_base
,
dwDataLen
)),
"RC4 encryption failed!
\n
"
);
}
dwLen
=
sizeof
(
DWORD
);
dwKeyLen
=
12345
;
...
...
@@ -1806,7 +1782,6 @@ static void test_rc4(void)
if
(
!
ENHANCED_PROV
)
ok
(
dwLen
==
11
,
"Expected 11, got %d
\n
"
,
dwLen
);
else
todo_wine
ok
(
dwLen
==
0
,
"Expected 0, got %d
\n
"
,
dwLen
);
result
=
CryptDestroyKey
(
hKey
);
...
...
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