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
f772fb98
Commit
f772fb98
authored
May 10, 2007
by
Mounir IDRASSI
Committed by
Alexandre Julliard
May 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Add support for mandatory parameters to RSAENH_CPGetProvParam.
parent
c4eeb9f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
rsaenh.c
dlls/rsaenh/rsaenh.c
+17
-0
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+29
-4
No files found.
dlls/rsaenh/rsaenh.c
View file @
f772fb98
...
...
@@ -2907,6 +2907,7 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData,
switch
(
dwParam
)
{
case
PP_CONTAINER
:
case
PP_UNIQUE_CONTAINER
:
/* MSDN says we can return the same value as PP_CONTAINER */
return
copy_param
(
pbData
,
pdwDataLen
,
(
CONST
BYTE
*
)
pKeyContainer
->
szName
,
strlen
(
pKeyContainer
->
szName
)
+
1
);
...
...
@@ -2914,6 +2915,22 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData,
return
copy_param
(
pbData
,
pdwDataLen
,
(
CONST
BYTE
*
)
pKeyContainer
->
szProvName
,
strlen
(
pKeyContainer
->
szProvName
)
+
1
);
case
PP_PROVTYPE
:
dwTemp
=
PROV_RSA_FULL
;
return
copy_param
(
pbData
,
pdwDataLen
,
(
CONST
BYTE
*
)
&
dwTemp
,
sizeof
(
dwTemp
));
case
PP_KEYSPEC
:
dwTemp
=
AT_SIGNATURE
|
AT_KEYEXCHANGE
;
return
copy_param
(
pbData
,
pdwDataLen
,
(
CONST
BYTE
*
)
&
dwTemp
,
sizeof
(
dwTemp
));
case
PP_KEYSET_TYPE
:
dwTemp
=
pKeyContainer
->
dwFlags
&
CRYPT_MACHINE_KEYSET
;
return
copy_param
(
pbData
,
pdwDataLen
,
(
CONST
BYTE
*
)
&
dwTemp
,
sizeof
(
dwTemp
));
case
PP_KEYSTORAGE
:
dwTemp
=
CRYPT_SEC_DESCR
;
return
copy_param
(
pbData
,
pdwDataLen
,
(
CONST
BYTE
*
)
&
dwTemp
,
sizeof
(
dwTemp
));
case
PP_SIG_KEYSIZE_INC
:
case
PP_KEYX_KEYSIZE_INC
:
dwTemp
=
8
;
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
f772fb98
...
...
@@ -1480,7 +1480,8 @@ static void test_null_provider(void)
HCRYPTPROV
prov
;
HCRYPTKEY
key
;
BOOL
result
;
DWORD
keySpec
,
dataLen
;
DWORD
keySpec
,
dataLen
,
dwParam
;
char
szName
[
MAX_PATH
];
result
=
CryptAcquireContext
(
NULL
,
szContainer
,
NULL
,
0
,
0
);
ok
(
!
result
&&
GetLastError
()
==
NTE_BAD_PROV_TYPE
,
...
...
@@ -1556,11 +1557,35 @@ static void test_null_provider(void)
CRYPT_NEWKEYSET
);
ok
(
result
,
"CryptAcquireContext failed: %08x
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
/* Test provider parameters getter */
dataLen
=
sizeof
(
dwParam
);
result
=
CryptGetProvParam
(
prov
,
PP_PROVTYPE
,
(
LPBYTE
)
&
dwParam
,
&
dataLen
,
0
);
ok
(
result
&&
dataLen
==
sizeof
(
dwParam
)
&&
dwParam
==
PROV_RSA_FULL
,
"Expected PROV_RSA_FULL, got 0x%08X
\n
"
,
dwParam
);
dataLen
=
sizeof
(
dwParam
);
result
=
CryptGetProvParam
(
prov
,
PP_KEYSET_TYPE
,
(
LPBYTE
)
&
dwParam
,
&
dataLen
,
0
);
ok
(
result
&&
dataLen
==
sizeof
(
dwParam
)
&&
dwParam
==
0
,
"Expected 0, got 0x%08X
\n
"
,
dwParam
);
dataLen
=
sizeof
(
dwParam
);
result
=
CryptGetProvParam
(
prov
,
PP_KEYSTORAGE
,
(
LPBYTE
)
&
dwParam
,
&
dataLen
,
0
);
ok
(
result
&&
dataLen
==
sizeof
(
dwParam
)
&&
(
dwParam
&
CRYPT_SEC_DESCR
),
"Expected CRYPT_SEC_DESCR to be set, got 0x%08X
\n
"
,
dwParam
);
dataLen
=
sizeof
(
keySpec
);
result
=
CryptGetProvParam
(
prov
,
PP_KEYSPEC
,
(
LPBYTE
)
&
keySpec
,
&
dataLen
,
0
);
if
(
result
)
ok
(
keySpec
==
(
AT_KEYEXCHANGE
|
AT_SIGNATURE
),
"Expected AT_KEYEXCHANGE | AT_SIGNATURE, got %08x
\n
"
,
keySpec
);
ok
(
result
&&
keySpec
==
(
AT_KEYEXCHANGE
|
AT_SIGNATURE
),
"Expected AT_KEYEXCHANGE | AT_SIGNATURE, got %08x
\n
"
,
keySpec
);
/* PP_CONTAINER parameter */
dataLen
=
sizeof
(
szName
);
result
=
CryptGetProvParam
(
prov
,
PP_CONTAINER
,
(
LPBYTE
)
szName
,
&
dataLen
,
0
);
ok
(
result
&&
dataLen
==
strlen
(
szContainer
)
+
1
&&
strcmp
(
szContainer
,
szName
)
==
0
,
"failed getting PP_CONTAINER. result = %s. Error 0x%08X. returned length = %d
\n
"
,
(
result
)
?
"TRUE"
:
"FALSE"
,
GetLastError
(),
dataLen
);
/* PP_UNIQUE_CONTAINER parameter */
dataLen
=
sizeof
(
szName
);
result
=
CryptGetProvParam
(
prov
,
PP_UNIQUE_CONTAINER
,
(
LPBYTE
)
szName
,
&
dataLen
,
0
);
ok
(
result
&&
dataLen
==
strlen
(
szContainer
)
+
1
&&
strcmp
(
szContainer
,
szName
)
==
0
,
"failed getting PP_CONTAINER. result = %s. Error 0x%08X. returned length = %d
\n
"
,
(
result
)
?
"TRUE"
:
"FALSE"
,
GetLastError
(),
dataLen
);
result
=
CryptGetUserKey
(
prov
,
AT_KEYEXCHANGE
,
&
key
);
ok
(
!
result
&&
GetLastError
()
==
NTE_NO_KEY
,
"Expected NTE_NO_KEY, got %08x
\n
"
,
GetLastError
());
...
...
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