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
ae194f69
Commit
ae194f69
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: Pass output length as a separate parameter to key_asymmetric_decrypt.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3deb9615
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
23 deletions
+8
-23
bcrypt_internal.h
dlls/bcrypt/bcrypt_internal.h
+1
-1
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+1
-10
gnutls.c
dlls/bcrypt/gnutls.c
+6
-12
No files found.
dlls/bcrypt/bcrypt_internal.h
View file @
ae194f69
...
...
@@ -206,7 +206,7 @@ struct key_funcs
void
(
CDECL
*
key_symmetric_destroy
)(
struct
key
*
);
NTSTATUS
(
CDECL
*
key_asymmetric_init
)(
struct
key
*
);
NTSTATUS
(
CDECL
*
key_asymmetric_generate
)(
struct
key
*
);
NTSTATUS
(
CDECL
*
key_asymmetric_decrypt
)(
struct
key
*
,
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
*
);
NTSTATUS
(
CDECL
*
key_asymmetric_decrypt
)(
struct
key
*
,
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
,
ULONG
*
);
NTSTATUS
(
CDECL
*
key_asymmetric_duplicate
)(
struct
key
*
,
struct
key
*
);
NTSTATUS
(
CDECL
*
key_asymmetric_sign
)(
struct
key
*
,
void
*
,
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
,
ULONG
*
,
ULONG
);
NTSTATUS
(
CDECL
*
key_asymmetric_verify
)(
struct
key
*
,
void
*
,
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
,
DWORD
);
...
...
dlls/bcrypt/bcrypt_main.c
View file @
ae194f69
...
...
@@ -1715,21 +1715,12 @@ 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
);
return
key_
funcs
->
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
,
...
...
dlls/bcrypt/gnutls.c
View file @
ae194f69
...
...
@@ -1846,32 +1846,26 @@ static NTSTATUS CDECL key_asymmetric_duplicate( struct key *key_orig, struct key
return
STATUS_SUCCESS
;
}
static
NTSTATUS
CDECL
key_asymmetric_decrypt
(
struct
key
*
key
,
UCHAR
*
input
,
ULONG
input_len
,
UCHAR
*
output
,
ULONG
*
outpu
t_len
)
static
NTSTATUS
CDECL
key_asymmetric_decrypt
(
struct
key
*
key
,
UCHAR
*
input
,
ULONG
input_len
,
UCHAR
*
output
,
ULONG
output_len
,
ULONG
*
re
t_len
)
{
gnutls_datum_t
e
,
d
=
{
0
};
NTSTATUS
status
=
STATUS_SUCCESS
;
int
ret
;
e
.
data
=
(
unsigned
char
*
)
input
;
e
.
data
=
input
;
e
.
size
=
input_len
;
if
((
ret
=
pgnutls_privkey_decrypt_data
(
key_data
(
key
)
->
privkey
,
0
,
&
e
,
&
d
)))
{
pgnutls_perror
(
ret
);
return
STATUS_INTERNAL_ERROR
;
}
if
(
*
output_len
>=
d
.
size
)
{
*
output_len
=
d
.
size
;
memcpy
(
output
,
d
.
data
,
*
output_len
);
}
else
status
=
STATUS_BUFFER_TOO_SMALL
;
*
ret_len
=
d
.
size
;
if
(
output_len
>=
d
.
size
)
memcpy
(
output
,
d
.
data
,
*
ret_len
);
else
status
=
STATUS_BUFFER_TOO_SMALL
;
free
(
d
.
data
);
return
status
;
}
...
...
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