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
54c1b0ac
Commit
54c1b0ac
authored
Sep 29, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Move the public key initialization to the generic code.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d70c8e46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
22 deletions
+29
-22
bcrypt_internal.h
dlls/bcrypt/bcrypt_internal.h
+9
-1
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+15
-3
gnutls.c
dlls/bcrypt/gnutls.c
+4
-16
macos.c
dlls/bcrypt/macos.c
+1
-2
No files found.
dlls/bcrypt/bcrypt_internal.h
View file @
54c1b0ac
...
...
@@ -229,6 +229,13 @@ struct key_symmetric
enum
mode_id
mode
;
};
struct
key_asymmetric
{
ULONG
bitlen
;
/* ignored for ECC keys */
UCHAR
*
pubkey
;
ULONG
pubkey_len
;
};
struct
key
{
struct
object
hdr
;
...
...
@@ -236,6 +243,7 @@ struct key
union
{
struct
key_symmetric
s
;
struct
key_asymmetric
a
;
}
u
;
};
#endif
...
...
@@ -254,7 +262,7 @@ NTSTATUS key_symmetric_set_auth_data( struct key *, UCHAR *, ULONG ) DECLSPEC_HI
NTSTATUS
key_symmetric_encrypt
(
struct
key
*
,
const
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_symmetric_decrypt
(
struct
key
*
,
const
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_symmetric_get_tag
(
struct
key
*
,
UCHAR
*
,
ULONG
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_asymmetric_init
(
struct
key
*
,
struct
algorithm
*
,
ULONG
,
const
UCHAR
*
,
ULONG
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_asymmetric_init
(
struct
key
*
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_asymmetric_generate
(
struct
key
*
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_asymmetric_sign
(
struct
key
*
,
void
*
,
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
,
ULONG
*
,
ULONG
)
DECLSPEC_HIDDEN
;
NTSTATUS
key_asymmetric_verify
(
struct
key
*
,
void
*
,
UCHAR
*
,
ULONG
,
UCHAR
*
,
ULONG
,
DWORD
)
DECLSPEC_HIDDEN
;
...
...
dlls/bcrypt/bcrypt_main.c
View file @
54c1b0ac
...
...
@@ -862,9 +862,22 @@ static NTSTATUS key_asymmetric_create( struct key **ret_key, struct algorithm *a
if
(
!
(
key
=
heap_alloc_zero
(
sizeof
(
*
key
)
)))
return
STATUS_NO_MEMORY
;
key
->
hdr
.
magic
=
MAGIC_KEY
;
key
->
alg_id
=
alg
->
id
;
key
->
u
.
a
.
bitlen
=
bitlen
;
if
(
(
status
=
key_asymmetric_init
(
key
,
alg
,
bitlen
,
pubkey
,
pubkey_len
))
)
if
(
pubkey_len
)
{
if
(
!
(
key
->
u
.
a
.
pubkey
=
heap_alloc
(
pubkey_len
)))
{
heap_free
(
key
);
return
STATUS_NO_MEMORY
;
}
memcpy
(
key
->
u
.
a
.
pubkey
,
pubkey
,
pubkey_len
);
key
->
u
.
a
.
pubkey_len
=
pubkey_len
;
}
if
((
status
=
key_asymmetric_init
(
key
)))
{
heap_free
(
key
->
u
.
a
.
pubkey
);
heap_free
(
key
);
return
status
;
}
...
...
@@ -1321,8 +1334,7 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
return
STATUS_NOT_IMPLEMENTED
;
}
NTSTATUS
key_asymmetric_init
(
struct
key
*
key
,
struct
algorithm
*
alg
,
ULONG
bitlen
,
const
UCHAR
*
pubkey
,
ULONG
pubkey_len
)
NTSTATUS
key_asymmetric_init
(
struct
key
*
key
)
{
ERR
(
"support for keys not available at build time
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
...
...
dlls/bcrypt/gnutls.c
View file @
54c1b0ac
...
...
@@ -1121,12 +1121,11 @@ NTSTATUS key_import_dsa_capi( struct key *key, UCHAR *buf, ULONG len )
return
STATUS_SUCCESS
;
}
NTSTATUS
key_asymmetric_init
(
struct
key
*
key
,
struct
algorithm
*
alg
,
ULONG
bitlen
,
const
UCHAR
*
pubkey
,
ULONG
pubkey_len
)
NTSTATUS
key_asymmetric_init
(
struct
key
*
key
)
{
if
(
!
libgnutls_handle
)
return
STATUS_INTERNAL_ERROR
;
switch
(
alg
->
id
)
switch
(
key
->
alg_
id
)
{
case
ALG_ID_ECDH_P256
:
case
ALG_ID_ECDSA_P256
:
...
...
@@ -1134,23 +1133,12 @@ NTSTATUS key_asymmetric_init( struct key *key, struct algorithm *alg, ULONG bitl
case
ALG_ID_RSA
:
case
ALG_ID_RSA_SIGN
:
case
ALG_ID_DSA
:
break
;
return
STATUS_SUCCESS
;
default:
FIXME
(
"algorithm %u not supported
\n
"
,
alg
->
id
);
FIXME
(
"algorithm %u not supported
\n
"
,
key
->
alg_
id
);
return
STATUS_NOT_SUPPORTED
;
}
if
(
pubkey_len
)
{
if
(
!
(
key
->
u
.
a
.
pubkey
=
heap_alloc
(
pubkey_len
)))
return
STATUS_NO_MEMORY
;
memcpy
(
key
->
u
.
a
.
pubkey
,
pubkey
,
pubkey_len
);
key
->
u
.
a
.
pubkey_len
=
pubkey_len
;
}
key
->
alg_id
=
alg
->
id
;
key
->
u
.
a
.
bitlen
=
bitlen
;
return
STATUS_SUCCESS
;
}
static
NTSTATUS
import_gnutls_pubkey_ecc
(
struct
key
*
key
,
gnutls_pubkey_t
*
gnutls_key
)
...
...
dlls/bcrypt/macos.c
View file @
54c1b0ac
...
...
@@ -219,8 +219,7 @@ NTSTATUS key_symmetric_get_tag( struct key *key, UCHAR *tag, ULONG len )
return
STATUS_NOT_IMPLEMENTED
;
}
NTSTATUS
key_asymmetric_init
(
struct
key
*
key
,
struct
algorithm
*
alg
,
ULONG
bitlen
,
const
UCHAR
*
pubkey
,
ULONG
pubkey_len
)
NTSTATUS
key_asymmetric_init
(
struct
key
*
key
)
{
FIXME
(
"not implemented on Mac
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
...
...
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