From 85cc8d28d263a8b8ff04d90622311f5d68e26e6f Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 14 Feb 2026 16:26:15 +0100 Subject: irmd: Clean up key exchange debug logs This cleans up a few debug logs related to encryption to not show KEM info for non-KEM algorithms. Also removes refcount logs for the PUP. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/irmd/oap/hdr.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/irmd/oap/hdr.c') diff --git a/src/irmd/oap/hdr.c b/src/irmd/oap/hdr.c index cdff7ab6..154923e1 100644 --- a/src/irmd/oap/hdr.c +++ b/src/irmd/oap/hdr.c @@ -361,6 +361,7 @@ int oap_hdr_encode(struct oap_hdr * hdr, } #ifdef DEBUG_PROTO_OAP +#define OAP_KEX_IS_KEM(hdr) ((hdr)->kex_flags.role | (hdr)->kex_flags.fmt) static void debug_oap_hdr(const struct oap_hdr * hdr) { assert(hdr); @@ -370,12 +371,20 @@ static void debug_oap_hdr(const struct oap_hdr * hdr) else log_proto(" crt: "); - if (hdr->kex.len > 0) - log_proto(" Key Exchange Data: [%zu bytes] [%s]", - hdr->kex.len, hdr->kex_flags.role ? - "Client encaps" : "Server encaps"); - else - log_proto(" Ephemeral Public Key: "); + if (hdr->kex.len > 0) { + if (OAP_KEX_IS_KEM(hdr)) + log_proto(" Key Exchange Data:" + " [%zu bytes] [%s]", + hdr->kex.len, + hdr->kex_flags.role ? + "Client encaps" : + "Server encaps"); + else + log_proto(" Key Exchange Data:" + " [%zu bytes]", + hdr->kex.len); + } else + log_proto(" Key Exchange Data: "); if (hdr->cipher_str != NULL) log_proto(" Cipher: %s", hdr->cipher_str); -- cgit v1.2.3