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
c5a6b7b3
Commit
c5a6b7b3
authored
Mar 30, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Mar 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Support setting salt via KP_SALT (resend).
parent
ece32e7f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
rsaenh.c
dlls/rsaenh/rsaenh.c
+27
-0
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+0
-3
No files found.
dlls/rsaenh/rsaenh.c
View file @
c5a6b7b3
...
...
@@ -3354,6 +3354,33 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam
setup_key
(
pCryptKey
);
return
TRUE
;
case
KP_SALT
:
switch
(
pCryptKey
->
aiAlgid
)
{
case
CALG_RC2
:
case
CALG_RC4
:
if
(
!
pbData
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/* MSDN: the base provider always sets eleven bytes of
* salt value.
*/
memcpy
(
pCryptKey
->
abKeyValue
+
pCryptKey
->
dwKeyLen
,
pbData
,
11
);
pCryptKey
->
dwSaltLen
=
11
;
setup_key
(
pCryptKey
);
/* Strange but true: salt length reset to 0 after setting
* it via KP_SALT.
*/
pCryptKey
->
dwSaltLen
=
0
;
break
;
default:
SetLastError
(
NTE_BAD_KEY
);
return
FALSE
;
}
return
TRUE
;
case
KP_SALT_EX
:
{
CRYPT_INTEGER_BLOB
*
blob
=
(
CRYPT_INTEGER_BLOB
*
)
pbData
;
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
c5a6b7b3
...
...
@@ -986,13 +986,11 @@ static void test_rc2(void)
/* Setting the salt also succeeds... */
result
=
CryptSetKeyParam
(
hKey
,
KP_SALT
,
pbData
,
0
);
todo_wine
ok
(
result
,
"setting salt failed: %08x
\n
"
,
GetLastError
());
/* but the resulting salt length is now zero? */
dwLen
=
0
;
result
=
CryptGetKeyParam
(
hKey
,
KP_SALT
,
NULL
,
&
dwLen
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
todo_wine
ok
(
dwLen
==
0
,
"unexpected salt length %d
\n
"
,
dwLen
);
/* What sizes salt can I set? */
salt
.
pbData
=
pbData
;
...
...
@@ -1154,7 +1152,6 @@ static void test_rc4(void)
/* Setting the salt also succeeds... */
result
=
CryptSetKeyParam
(
hKey
,
KP_SALT
,
pbData
,
0
);
todo_wine
ok
(
result
,
"setting salt failed: %08x
\n
"
,
GetLastError
());
/* but the resulting salt length is now zero? */
dwLen
=
0
;
...
...
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