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
3deb9615
Commit
3deb9615
authored
Apr 20, 2021
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Decryption with asymmetric keys is supported.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
78866a7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
23 deletions
+17
-23
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+17
-23
No files found.
dlls/bcrypt/bcrypt_main.c
View file @
3deb9615
...
...
@@ -1240,24 +1240,6 @@ static NTSTATUS key_symmetric_decrypt( struct key *key, UCHAR *input, ULONG inpu
return
status
;
}
static
NTSTATUS
key_asymmetric_decrypt
(
struct
key
*
key
,
UCHAR
*
input
,
ULONG
input_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
ret_len
)
{
NTSTATUS
status
;
if
(
!
(
status
=
key_funcs
->
key_asymmetric_decrypt
(
key
,
input
,
input_len
,
output
,
&
output_len
)))
*
ret_len
=
output_len
;
return
status
;
}
static
NTSTATUS
key_decrypt
(
struct
key
*
key
,
UCHAR
*
input
,
ULONG
input_len
,
void
*
padding
,
UCHAR
*
iv
,
ULONG
iv_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
ret_len
,
ULONG
flags
)
{
return
key_is_symmetric
(
key
)
?
key_symmetric_decrypt
(
key
,
input
,
input_len
,
padding
,
iv
,
iv_len
,
output
,
output_len
,
ret_len
,
flags
)
:
key_asymmetric_decrypt
(
key
,
input
,
input_len
,
output
,
output_len
,
ret_len
);
}
static
NTSTATUS
key_import_pair
(
struct
algorithm
*
alg
,
const
WCHAR
*
type
,
BCRYPT_KEY_HANDLE
*
ret_key
,
UCHAR
*
input
,
ULONG
input_len
)
{
...
...
@@ -1733,6 +1715,23 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
return
key_encrypt
(
key
,
input
,
input_len
,
padding
,
iv
,
iv_len
,
output
,
output_len
,
ret_len
,
flags
);
}
static
NTSTATUS
key_asymmetric_decrypt
(
struct
key
*
key
,
UCHAR
*
input
,
ULONG
input_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
ret_len
)
{
NTSTATUS
status
;
if
(
!
(
status
=
key_funcs
->
key_asymmetric_decrypt
(
key
,
input
,
input_len
,
output
,
&
output_len
)))
*
ret_len
=
output_len
;
return
status
;
}
static
NTSTATUS
key_decrypt
(
struct
key
*
key
,
UCHAR
*
input
,
ULONG
input_len
,
void
*
padding
,
UCHAR
*
iv
,
ULONG
iv_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
ret_len
,
ULONG
flags
)
{
if
(
key_is_symmetric
(
key
))
return
key_symmetric_decrypt
(
key
,
input
,
input_len
,
padding
,
iv
,
iv_len
,
output
,
output_len
,
ret_len
,
flags
);
return
key_asymmetric_decrypt
(
key
,
input
,
input_len
,
output
,
output_len
,
ret_len
);
}
NTSTATUS
WINAPI
BCryptDecrypt
(
BCRYPT_KEY_HANDLE
handle
,
UCHAR
*
input
,
ULONG
input_len
,
void
*
padding
,
UCHAR
*
iv
,
ULONG
iv_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
ret_len
,
ULONG
flags
)
{
...
...
@@ -1742,11 +1741,6 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
output_len
,
ret_len
,
flags
);
if
(
!
key
||
key
->
hdr
.
magic
!=
MAGIC_KEY
)
return
STATUS_INVALID_HANDLE
;
if
(
!
key_is_symmetric
(
key
))
{
FIXME
(
"decryption with asymmetric keys not yet supported
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
}
if
(
flags
&
~
BCRYPT_BLOCK_PADDING
)
{
FIXME
(
"flags %08x not supported
\n
"
,
flags
);
...
...
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