kbx: A 20 byte fingerprint is right filled in version 2 blob.

* kbx/keybox-blob.c (create_blob_header): Fix creating FPR20 key
in blob with 32-byte fingerprint.

--

GnuPG-bug-id: 5609
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-09-28 17:12:26 +09:00
parent cc6152b802
commit 08a3a4db27
1 changed files with 2 additions and 0 deletions

View File

@ -578,6 +578,8 @@ create_blob_header (KEYBOXBLOB blob, int blobtype, int as_ephemeral,
if (want_fpr32)
{
put_membuf (a, blob->keys[i].fpr, blob->keys[i].fprlen);
if (blob->keys[i].fprlen < 32)
put_membuf (a, NULL, 32 - blob->keys[i].fprlen);
blob->keys[i].off_kid_addr = a->len;
if (blob->keys[i].fprlen == 32)
put16 ( a, (blob->keys[i].flags | 0x80));