From bdb5136518ded51d5f2b0c71befe6b2ffbc632db Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 12 Apr 2022 14:53:46 +0900 Subject: [PATCH] Parse Preferred AEAD cerphersuites subpacket. Signed-off-by: NIIBE Yutaka --- common/openpgpdefs.h | 2 ++ g10/parse-packet.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h index 0696172d7..18d79fdbb 100644 --- a/common/openpgpdefs.h +++ b/common/openpgpdefs.h @@ -122,6 +122,8 @@ typedef enum SIGSUBPKT_ATTST_SIGS = 37, /* Attested Certifications. */ SIGSUBPKT_KEY_BLOCK = 38, /* Entire key used. */ + SIGSUBPKT_PREF_AEAD2 = 39, /* Preferred AEAD ciphersuites. */ + SIGSUBPKT_FLAG_CRITICAL = 128 } sigsubpkttype_t; diff --git a/g10/parse-packet.c b/g10/parse-packet.c index 230eb52b5..91347ba34 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -1756,6 +1756,16 @@ dump_sig_subpkt (int hashed, int type, int critical, } break; + case SIGSUBPKT_PREF_AEAD2: + es_fputs ("pref-aead-cipersuites:", listfp); + if ((length % 1)) + p = "[invalid subpacket]"; + else + { + for (i = 0; i < length/2; i++) + es_fprintf (listfp, " %d:%d", buffer[i*2], buffer[i*2+1]); + } + break; default: if (type >= 100 && type <= 110) @@ -1800,6 +1810,7 @@ parse_one_sig_subpkt (const byte * buffer, size_t n, int type) case SIGSUBPKT_FEATURES: case SIGSUBPKT_REGEXP: case SIGSUBPKT_ATTST_SIGS: + case SIGSUBPKT_PREF_AEAD2: return 0; case SIGSUBPKT_SIGNATURE: case SIGSUBPKT_EXPORTABLE: @@ -1905,6 +1916,7 @@ can_handle_critical (const byte * buffer, size_t n, int type) case SIGSUBPKT_POLICY: case SIGSUBPKT_PREF_KS: case SIGSUBPKT_REVOC_REASON: /* At least we know about it. */ + case SIGSUBPKT_PREF_AEAD2: return 1; case SIGSUBPKT_KEY_BLOCK: @@ -2260,7 +2272,7 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen, if (p) sig->timestamp = buf32_to_u32 (p); else if (!(sig->pubkey_algo >= 100 && sig->pubkey_algo <= 110) - && opt.verbose && !glo_ctrl.silence_parse_warnings) + && opt.verbose && !glo_ctrl.silence_parse_warnings)// log_info ("signature packet without timestamp\n"); /* Set the key id. We first try the issuer fingerprint and if