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
0eb9ae17
Commit
0eb9ae17
authored
Jan 28, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jan 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Fix CryptSetKeyParam for KP_PERMISSIONS.
parent
1cc58867
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
rsaenh.c
dlls/rsaenh/rsaenh.c
+19
-1
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+0
-4
No files found.
dlls/rsaenh/rsaenh.c
View file @
0eb9ae17
...
...
@@ -2824,8 +2824,26 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam
return
TRUE
;
case
KP_PERMISSIONS
:
pCryptKey
->
dwPermissions
=
*
(
DWORD
*
)
pbData
;
{
DWORD
perms
=
*
(
DWORD
*
)
pbData
;
if
((
perms
&
CRYPT_EXPORT
)
&&
!
(
pCryptKey
->
dwPermissions
&
CRYPT_EXPORT
))
{
SetLastError
(
NTE_BAD_DATA
);
return
FALSE
;
}
else
if
(
!
(
perms
&
CRYPT_EXPORT
)
&&
(
pCryptKey
->
dwPermissions
&
CRYPT_EXPORT
))
{
/* Clearing the export permission appears to be ignored,
* see tests.
*/
perms
|=
CRYPT_EXPORT
;
}
pCryptKey
->
dwPermissions
=
perms
;
return
TRUE
;
}
case
KP_IV
:
memcpy
(
pCryptKey
->
abInitVector
,
pbData
,
pCryptKey
->
dwBlockLen
);
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
0eb9ae17
...
...
@@ -1581,7 +1581,6 @@ static void test_rsa_encrypt(void)
dwVal
|=
CRYPT_EXPORT
;
SetLastError
(
0xdeadbeef
);
result
=
CryptSetKeyParam
(
hRSAKey
,
KP_PERMISSIONS
,
(
BYTE
*
)
&
dwVal
,
0
);
todo_wine
ok
(
!
result
&&
GetLastError
()
==
NTE_BAD_DATA
,
"expected NTE_BAD_DATA, got %08x
\n
"
,
GetLastError
());
...
...
@@ -1614,7 +1613,6 @@ static void test_rsa_encrypt(void)
dwVal
|=
CRYPT_EXPORT
;
SetLastError
(
0xdeadbeef
);
result
=
CryptSetKeyParam
(
hRSAKey
,
KP_PERMISSIONS
,
(
BYTE
*
)
&
dwVal
,
0
);
todo_wine
ok
(
!
result
&&
GetLastError
()
==
NTE_BAD_DATA
,
"expected NTE_BAD_DATA, got %08x
\n
"
,
GetLastError
());
...
...
@@ -2157,7 +2155,6 @@ static void test_key_permissions(void)
dwLen
=
sizeof
(
DWORD
);
result
=
CryptGetKeyParam
(
hKey1
,
KP_PERMISSIONS
,
(
BYTE
*
)
&
dwVal
,
&
dwLen
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
todo_wine
ok
(
dwVal
==
(
CRYPT_MAC
|
CRYPT_WRITE
|
CRYPT_READ
|
CRYPT_EXPORT
|
CRYPT_DECRYPT
|
CRYPT_ENCRYPT
),
"expected CRYPT_MAC|CRYPT_WRITE|CRYPT_READ|CRYPT_EXPORT|CRYPT_DECRYPT|CRYPT_ENCRYPT,"
...
...
@@ -2178,7 +2175,6 @@ static void test_key_permissions(void)
dwLen
=
sizeof
(
DWORD
);
result
=
CryptGetKeyParam
(
hKey2
,
KP_PERMISSIONS
,
(
BYTE
*
)
&
dwVal
,
&
dwLen
,
0
);
ok
(
result
,
"%08x
\n
"
,
GetLastError
());
todo_wine
ok
(
dwVal
==
(
CRYPT_MAC
|
CRYPT_WRITE
|
CRYPT_READ
|
CRYPT_EXPORT
|
CRYPT_DECRYPT
|
CRYPT_ENCRYPT
),
"expected CRYPT_MAC|CRYPT_WRITE|CRYPT_READ|CRYPT_EXPORT|CRYPT_DECRYPT|CRYPT_ENCRYPT,"
...
...
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