bcrypt: Copy all fields in key_duplicate.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2020-10-19 11:24:11 +02:00 committed by Alexandre Julliard
parent f1e11804a0
commit 437d932809
1 changed files with 3 additions and 0 deletions

View File

@ -1476,8 +1476,11 @@ static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy )
if (!(buffer = heap_alloc( key_orig->u.a.pubkey_len ))) return STATUS_NO_MEMORY; if (!(buffer = heap_alloc( key_orig->u.a.pubkey_len ))) return STATUS_NO_MEMORY;
memcpy( buffer, key_orig->u.a.pubkey, key_orig->u.a.pubkey_len ); memcpy( buffer, key_orig->u.a.pubkey, key_orig->u.a.pubkey_len );
key_copy->u.a.bitlen = key_orig->u.a.bitlen;
key_copy->u.a.flags = key_orig->u.a.flags;
key_copy->u.a.pubkey = buffer; key_copy->u.a.pubkey = buffer;
key_copy->u.a.pubkey_len = key_orig->u.a.pubkey_len; key_copy->u.a.pubkey_len = key_orig->u.a.pubkey_len;
key_copy->u.a.dss_seed = key_orig->u.a.dss_seed;
if ((status = key_funcs->key_asymmetric_duplicate( key_orig, key_copy ))) return status; if ((status = key_funcs->key_asymmetric_duplicate( key_orig, key_copy ))) return status;
} }