1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-19 14:41:41 +02:00

tpm2d: Fix key import.

* tpm2d/tpm2.c (tpm2_import_key): Set the lengths from right
variables.

--

Fixes-commit: d631c8198c
GnuPG-bug-id: 7186
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Jakub Jelen 2024-07-04 13:57:44 +02:00 committed by NIIBE Yutaka
parent 736579331b
commit cf3cec982d
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -923,14 +923,14 @@ tpm2_import_key (ctrl_t ctrl, TSS_CONTEXT *tssc,
u16len = 0;
TSS_TPM2B_PUBLIC_Marshal (&objectPublic,
&u16len, &buffer, &size);
pub_len = len;
pub_len = u16len;
size = sizeof (priv);
buffer = priv;
u16len = 0;
TSS_TPM2B_PRIVATE_Marshal ((TPM2B_PRIVATE *)&outPrivate,
&u16len, &buffer, &size);
priv_len = len;
priv_len = u16len;
*shadow_info = make_tpm2_shadow_info (parent, pub, pub_len,
priv, priv_len, shadow_len);