From 08a3a4db27dcc3d50038cf5bdba94a6f0b548b01 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 28 Sep 2021 17:12:26 +0900 Subject: [PATCH] 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 --- kbx/keybox-blob.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c index 5cba6576b..2564d1f48 100644 --- a/kbx/keybox-blob.c +++ b/kbx/keybox-blob.c @@ -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));