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
ab0a7d2a
Commit
ab0a7d2a
authored
Oct 06, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Fix buffer size query in BCryptSignHash.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d29f4244
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
gnutls.c
dlls/bcrypt/gnutls.c
+11
-8
No files found.
dlls/bcrypt/gnutls.c
View file @
ab0a7d2a
...
...
@@ -1415,9 +1415,9 @@ static NTSTATUS format_gnutls_signature( enum alg_id type, gnutls_datum_t signat
case
ALG_ID_RSA
:
case
ALG_ID_RSA_SIGN
:
{
if
(
output_len
<
signature
.
size
)
return
STATUS_BUFFER_TOO_SMALL
;
memcpy
(
output
,
signature
.
data
,
signature
.
size
);
*
ret_len
=
signature
.
size
;
if
(
output_len
<
signature
.
size
)
return
STATUS_BUFFER_TOO_SMALL
;
if
(
output
)
memcpy
(
output
,
signature
.
data
,
signature
.
size
);
return
STATUS_SUCCESS
;
}
case
ALG_ID_ECDSA_P256
:
...
...
@@ -1435,6 +1435,7 @@ static NTSTATUS format_gnutls_signature( enum alg_id type, gnutls_datum_t signat
return
STATUS_INTERNAL_ERROR
;
}
*
ret_len
=
sig_len
;
if
(
output_len
<
sig_len
)
return
STATUS_BUFFER_TOO_SMALL
;
if
(
r
.
size
%
2
)
/* remove prepended zero byte */
...
...
@@ -1457,14 +1458,16 @@ static NTSTATUS format_gnutls_signature( enum alg_id type, gnutls_datum_t signat
return
STATUS_INTERNAL_ERROR
;
}
pad_size_r
=
(
sig_len
/
2
)
-
r
.
size
;
pad_size_s
=
(
sig_len
/
2
)
-
s
.
size
;
memset
(
output
,
0
,
sig_len
);
if
(
output
)
{
pad_size_r
=
(
sig_len
/
2
)
-
r
.
size
;
pad_size_s
=
(
sig_len
/
2
)
-
s
.
size
;
memset
(
output
,
0
,
sig_len
);
memcpy
(
output
+
pad_size_r
,
r_data
,
r
.
size
);
memcpy
(
output
+
(
sig_len
/
2
)
+
pad_size_s
,
s_data
,
s
.
size
);
memcpy
(
output
+
pad_size_r
,
r_data
,
r
.
size
);
memcpy
(
output
+
(
sig_len
/
2
)
+
pad_size_s
,
s_data
,
s
.
size
);
}
*
ret_len
=
sig_len
;
free
(
r
.
data
);
free
(
s
.
data
);
return
STATUS_SUCCESS
;
}
...
...
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