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
5c1b0e5d
Commit
5c1b0e5d
authored
Aug 14, 2022
by
Santino Mazza
Committed by
Alexandre Julliard
Aug 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Move symmetric flags check to symmetric section.
Signed-off-by:
Santino Mazza
<
mazzasantino1206@gmail.com
>
parent
a0eaae85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+23
-14
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
+2
-1
No files found.
dlls/bcrypt/bcrypt_main.c
View file @
5c1b0e5d
...
...
@@ -1928,34 +1928,43 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp
ULONG
iv_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
ret_len
,
ULONG
flags
)
{
struct
key_asymmetric_decrypt_params
params
;
NTSTATUS
ret
;
struct
key
*
key
=
handle
;
TRACE
(
"%p, %p, %lu, %p, %p, %lu, %p, %lu, %p, %#lx
\n
"
,
handle
,
input
,
input_len
,
padding
,
iv
,
iv_len
,
output
,
output_len
,
ret_len
,
flags
);
if
(
!
key
||
key
->
hdr
.
magic
!=
MAGIC_KEY
)
return
STATUS_INVALID_HANDLE
;
if
(
flags
&
~
BCRYPT_BLOCK_PADDING
)
{
FIXME
(
"flags %#lx not supported
\n
"
,
flags
);
return
STATUS_NOT_IMPLEMENTED
;
}
if
(
key_is_symmetric
(
key
))
{
NTSTATUS
ret
;
if
(
flags
&
~
BCRYPT_BLOCK_PADDING
)
{
FIXME
(
"flags %#lx not supported
\n
"
,
flags
);
return
STATUS_NOT_IMPLEMENTED
;
}
EnterCriticalSection
(
&
key
->
u
.
s
.
cs
);
ret
=
key_symmetric_decrypt
(
key
,
input
,
input_len
,
padding
,
iv
,
iv_len
,
output
,
output_len
,
ret_len
,
flags
);
LeaveCriticalSection
(
&
key
->
u
.
s
.
cs
);
return
ret
;
}
else
{
if
(
flags
&
BCRYPT_PAD_NONE
||
flags
&
BCRYPT_PAD_OAEP
)
{
FIXME
(
"flags %#lx not implemented
\n
"
,
flags
);
return
STATUS_NOT_IMPLEMENTED
;
}
params
.
key
=
key
;
params
.
input
=
input
;
params
.
input_len
=
input_len
;
params
.
output
=
output
;
params
.
output_len
=
output_len
;
params
.
ret_len
=
ret_len
;
ret
=
UNIX_CALL
(
key_asymmetric_decrypt
,
&
params
);
}
params
.
key
=
key
;
params
.
input
=
input
;
params
.
input_len
=
input_len
;
params
.
output
=
output
;
params
.
output_len
=
output_len
;
params
.
ret_len
=
ret_len
;
return
UNIX_CALL
(
key_asymmetric_decrypt
,
&
params
);
return
ret
;
}
NTSTATUS
WINAPI
BCryptSetProperty
(
BCRYPT_HANDLE
handle
,
const
WCHAR
*
prop
,
UCHAR
*
value
,
ULONG
size
,
ULONG
flags
)
...
...
dlls/bcrypt/tests/bcrypt.c
View file @
5c1b0e5d
...
...
@@ -2258,13 +2258,14 @@ static void test_rsa_encrypt(void)
ok
(
ret
==
STATUS_SUCCESS
,
"got %lx
\n
"
,
ret
);
ok
(
memcmp
(
encrypted_a
,
encrypted_b
,
encrypted_size
),
"Both outputs are the same
\n
"
);
todo_wine
{
BCryptDecrypt
(
key
,
encrypted_a
,
encrypted_size
,
NULL
,
NULL
,
0
,
NULL
,
0
,
&
decrypted_size
,
BCRYPT_PAD_PKCS1
);
ok
(
decrypted_size
==
sizeof
(
input
),
"got size of %ld
\n
"
,
decrypted_size
);
decrypted
=
malloc
(
decrypted_size
);
BCryptDecrypt
(
key
,
encrypted_a
,
encrypted_size
,
NULL
,
NULL
,
0
,
decrypted
,
decrypted_size
,
&
decrypted_size
,
BCRYPT_PAD_PKCS1
);
ok
(
!
memcmp
(
decrypted
,
input
,
sizeof
(
input
)),
"Decrypted output it's not what expected
\n
"
);
free
(
decrypted
);
todo_wine
{
encrypted_size
=
60
;
/* OAEP Padding */
ret
=
BCryptEncrypt
(
key
,
input
,
sizeof
(
input
),
&
oaep_pad
,
NULL
,
0
,
NULL
,
0
,
&
encrypted_size
,
BCRYPT_PAD_OAEP
);
...
...
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