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
48075d2a
Commit
48075d2a
authored
Mar 24, 2022
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Also duplicate the public key handle in key_asymmetric_duplicate().
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1fa5bfd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
gnutls.c
dlls/bcrypt/gnutls.c
+26
-4
No files found.
dlls/bcrypt/gnutls.c
View file @
48075d2a
...
...
@@ -1806,11 +1806,13 @@ static NTSTATUS key_asymmetric_duplicate( void *args )
const
struct
key_asymmetric_duplicate_params
*
params
=
args
;
struct
key
*
key_orig
=
params
->
key_orig
;
struct
key
*
key_copy
=
params
->
key_copy
;
gnutls_privkey_t
privkey
;
gnutls_pubkey_t
pubkey
;
int
ret
;
if
(
!
key_data
(
key_orig
)
->
a
.
privkey
)
return
STATUS_SUCCESS
;
if
((
ret
=
pgnutls_privkey_init
(
&
key_data
(
key_copy
)
->
a
.
privkey
)))
if
((
ret
=
pgnutls_privkey_init
(
&
privkey
)))
{
pgnutls_perror
(
ret
);
return
STATUS_INTERNAL_ERROR
;
...
...
@@ -1827,7 +1829,7 @@ static NTSTATUS key_asymmetric_duplicate( void *args )
pgnutls_perror
(
ret
);
return
STATUS_INTERNAL_ERROR
;
}
ret
=
pgnutls_privkey_import_rsa_raw
(
key_data
(
key_copy
)
->
a
.
privkey
,
&
m
,
&
e
,
&
d
,
&
p
,
&
q
,
&
u
,
&
e1
,
&
e2
);
ret
=
pgnutls_privkey_import_rsa_raw
(
privkey
,
&
m
,
&
e
,
&
d
,
&
p
,
&
q
,
&
u
,
&
e1
,
&
e2
);
free
(
m
.
data
);
free
(
e
.
data
);
free
(
d
.
data
);
free
(
p
.
data
);
free
(
q
.
data
);
free
(
u
.
data
);
free
(
e1
.
data
);
free
(
e2
.
data
);
if
(
ret
)
...
...
@@ -1845,13 +1847,14 @@ static NTSTATUS key_asymmetric_duplicate( void *args )
pgnutls_perror
(
ret
);
return
STATUS_INTERNAL_ERROR
;
}
ret
=
pgnutls_privkey_import_dsa_raw
(
key_data
(
key_copy
)
->
a
.
privkey
,
&
p
,
&
q
,
&
g
,
&
y
,
&
x
);
ret
=
pgnutls_privkey_import_dsa_raw
(
privkey
,
&
p
,
&
q
,
&
g
,
&
y
,
&
x
);
free
(
p
.
data
);
free
(
q
.
data
);
free
(
g
.
data
);
free
(
y
.
data
);
free
(
x
.
data
);
if
(
ret
)
{
pgnutls_perror
(
ret
);
return
STATUS_INTERNAL_ERROR
;
}
key_copy
->
u
.
a
.
dss_seed
=
key_orig
->
u
.
a
.
dss_seed
;
break
;
}
case
ALG_ID_ECDH_P256
:
...
...
@@ -1865,7 +1868,7 @@ static NTSTATUS key_asymmetric_duplicate( void *args )
pgnutls_perror
(
ret
);
return
STATUS_INTERNAL_ERROR
;
}
ret
=
pgnutls_privkey_import_ecc_raw
(
key_data
(
key_copy
)
->
a
.
privkey
,
curve
,
&
x
,
&
y
,
&
k
);
ret
=
pgnutls_privkey_import_ecc_raw
(
privkey
,
curve
,
&
x
,
&
y
,
&
k
);
free
(
x
.
data
);
free
(
y
.
data
);
free
(
k
.
data
);
if
(
ret
)
{
...
...
@@ -1879,6 +1882,25 @@ static NTSTATUS key_asymmetric_duplicate( void *args )
return
STATUS_INTERNAL_ERROR
;
}
if
(
key_data
(
key_orig
)
->
a
.
pubkey
)
{
if
((
ret
=
pgnutls_pubkey_init
(
&
pubkey
)))
{
pgnutls_perror
(
ret
);
pgnutls_privkey_deinit
(
privkey
);
return
STATUS_INTERNAL_ERROR
;
}
if
((
ret
=
pgnutls_pubkey_import_privkey
(
pubkey
,
key_data
(
key_orig
)
->
a
.
privkey
,
0
,
0
)))
{
pgnutls_perror
(
ret
);
pgnutls_pubkey_deinit
(
pubkey
);
pgnutls_privkey_deinit
(
privkey
);
return
STATUS_INTERNAL_ERROR
;
}
key_data
(
key_copy
)
->
a
.
pubkey
=
pubkey
;
}
key_data
(
key_copy
)
->
a
.
privkey
=
privkey
;
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