summaryrefslogtreecommitdiff
path: root/src/irmd/oap
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-02-14 16:26:15 +0100
committerSander Vrijders <sander@ouroboros.rocks>2026-02-18 07:53:16 +0100
commit85cc8d28d263a8b8ff04d90622311f5d68e26e6f (patch)
tree0352865fe53e6748dd702f0ed239db0c3589a38a /src/irmd/oap
parentd85326a119c34789055c388fcd18bb0161fbfd21 (diff)
downloadouroboros-85cc8d28d263a8b8ff04d90622311f5d68e26e6f.tar.gz
ouroboros-85cc8d28d263a8b8ff04d90622311f5d68e26e6f.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/irmd/oap')
-rw-r--r--src/irmd/oap/cli.c7
-rw-r--r--src/irmd/oap/hdr.c21
2 files changed, 15 insertions, 13 deletions
diff --git a/src/irmd/oap/cli.c b/src/irmd/oap/cli.c
index 9472e331..b5183ac8 100644
--- a/src/irmd/oap/cli.c
+++ b/src/irmd/oap/cli.c
@@ -283,13 +283,6 @@ int oap_cli_prepare(void ** ctx,
goto fail_kex;
}
- log_dbg_id(s->id.data, "KEX config: algo=%s, mode=%s, cipher=%s.",
- s->kcfg.x.str != NULL ? s->kcfg.x.str : "none",
- s->kcfg.x.mode == KEM_MODE_CLIENT_ENCAP ? "client-encap" :
- s->kcfg.x.mode == KEM_MODE_SERVER_ENCAP ? "server-encap" :
- "none",
- s->kcfg.c.str != NULL ? s->kcfg.c.str : "none");
-
oap_hdr_init(&s->local_hdr, s->id, s->kex_buf, data, s->kcfg.c.nid);
if (do_client_kex_prepare(info->name, s) < 0) {
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: <none>");
- 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: <none>");
+ 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: <none>");
if (hdr->cipher_str != NULL)
log_proto(" Cipher: %s", hdr->cipher_str);