Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2bd5a8d5
Commit
2bd5a8d5
authored
Feb 17, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Support retrieving the PaddingSchemes property for RSA.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f29d4a43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+17
-0
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
+7
-1
bcrypt.h
include/bcrypt.h
+6
-0
No files found.
dlls/bcrypt/bcrypt_main.c
View file @
2bd5a8d5
...
...
@@ -528,6 +528,20 @@ static NTSTATUS get_aes_property( enum mode_id mode, const WCHAR *prop, UCHAR *b
return
STATUS_NOT_IMPLEMENTED
;
}
static
NTSTATUS
get_rsa_property
(
enum
mode_id
mode
,
const
WCHAR
*
prop
,
UCHAR
*
buf
,
ULONG
size
,
ULONG
*
ret_size
)
{
if
(
!
strcmpW
(
prop
,
BCRYPT_PADDING_SCHEMES
))
{
*
ret_size
=
sizeof
(
ULONG
);
if
(
size
<
sizeof
(
ULONG
))
return
STATUS_BUFFER_TOO_SMALL
;
if
(
buf
)
*
(
ULONG
*
)
buf
=
BCRYPT_SUPPORTED_PAD_PKCS1_SIG
;
return
STATUS_SUCCESS
;
}
FIXME
(
"unsupported property %s
\n
"
,
debugstr_w
(
prop
)
);
return
STATUS_NOT_IMPLEMENTED
;
}
NTSTATUS
get_alg_property
(
const
struct
algorithm
*
alg
,
const
WCHAR
*
prop
,
UCHAR
*
buf
,
ULONG
size
,
ULONG
*
ret_size
)
{
NTSTATUS
status
;
...
...
@@ -541,6 +555,9 @@ NTSTATUS get_alg_property( const struct algorithm *alg, const WCHAR *prop, UCHAR
case
ALG_ID_AES
:
return
get_aes_property
(
alg
->
mode
,
prop
,
buf
,
size
,
ret_size
);
case
ALG_ID_RSA
:
return
get_rsa_property
(
alg
->
mode
,
prop
,
buf
,
size
,
ret_size
);
default:
break
;
}
...
...
dlls/bcrypt/tests/bcrypt.c
View file @
2bd5a8d5
...
...
@@ -1786,7 +1786,7 @@ static void test_RSA(void)
BCRYPT_KEY_HANDLE
key
;
BCRYPT_RSAKEY_BLOB
*
rsablob
;
UCHAR
sig
[
64
];
ULONG
len
,
size
;
ULONG
len
,
size
,
schemes
;
NTSTATUS
ret
;
BYTE
*
buf
;
...
...
@@ -1797,6 +1797,12 @@ static void test_RSA(void)
return
;
}
schemes
=
size
=
0
;
ret
=
pBCryptGetProperty
(
alg
,
L"PaddingSchemes"
,
(
UCHAR
*
)
&
schemes
,
sizeof
(
schemes
),
&
size
,
0
);
ok
(
!
ret
,
"got %08x
\n
"
,
ret
);
ok
(
schemes
,
"schemes not set
\n
"
);
ok
(
size
==
sizeof
(
schemes
),
"got %u
\n
"
,
size
);
ret
=
pBCryptImportKeyPair
(
alg
,
NULL
,
BCRYPT_RSAPUBLIC_BLOB
,
&
key
,
rsaPublicBlob
,
sizeof
(
rsaPublicBlob
),
0
);
ok
(
!
ret
,
"pBCryptImportKeyPair failed: %08x
\n
"
,
ret
);
...
...
include/bcrypt.h
View file @
2bd5a8d5
...
...
@@ -189,6 +189,12 @@ static const WCHAR BCRYPT_KDF_RAW_SECRET[] = {'T','R','U','N','C','A','T','E',0}
#define BCRYPT_RNG_INTERFACE 0x00000006
#define BCRYPT_KEY_DERIVATION_INTERFACE 0x00000007
#define BCRYPT_SUPPORTED_PAD_ROUTER 0x00000001
#define BCRYPT_SUPPORTED_PAD_PKCS1_ENC 0x00000002
#define BCRYPT_SUPPORTED_PAD_PKCS1_SIG 0x00000004
#define BCRYPT_SUPPORTED_PAD_OAEP 0x00000008
#define BCRYPT_SUPPORTED_PAD_PSS 0x00000010
typedef
struct
_BCRYPT_ALGORITHM_IDENTIFIER
{
LPWSTR
pszName
;
...
...
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