summaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:05 +0000
commite7fd617327ed9d30f093a78a016511ab5c984ba4 (patch)
treebb534b4fd912969c90022ad00726253be891ad8a /g10/parse-packet.c
parentReleasing progress-linux version 2.2.40-3~progress7.99u1. (diff)
downloadgnupg2-e7fd617327ed9d30f093a78a016511ab5c984ba4.tar.xz
gnupg2-e7fd617327ed9d30f093a78a016511ab5c984ba4.zip
Merging upstream version 2.2.43.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--g10/parse-packet.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 5fea1ac..e0fe9c0 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -2189,8 +2189,21 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
&& opt.verbose && !glo_ctrl.silence_parse_warnings)
log_info ("signature packet without timestamp\n");
- p = parse_sig_subpkt2 (sig, SIGSUBPKT_ISSUER);
- if (p)
+ /* Set the key id. We first try the issuer fingerprint and if
+ * this is not found fallback to the issuer. Note that
+ * only the issuer packet is also searched in the unhashed area. */
+ p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_ISSUER_FPR, &len);
+ if (p && len == 21 && p[0] == 4)
+ {
+ sig->keyid[0] = buf32_to_u32 (p + 1 + 12);
+ sig->keyid[1] = buf32_to_u32 (p + 1 + 16);
+ }
+ else if (p && len == 33 && p[0] == 5)
+ {
+ sig->keyid[0] = buf32_to_u32 (p + 1 );
+ sig->keyid[1] = buf32_to_u32 (p + 1 + 4);
+ }
+ else if ((p = parse_sig_subpkt2 (sig, SIGSUBPKT_ISSUER)))
{
sig->keyid[0] = buf32_to_u32 (p);
sig->keyid[1] = buf32_to_u32 (p + 4);