diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-02-14 16:26:15 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-02-18 07:53:16 +0100 |
| commit | 85cc8d28d263a8b8ff04d90622311f5d68e26e6f (patch) | |
| tree | 0352865fe53e6748dd702f0ed239db0c3589a38a /src/irmd/oap/hdr.c | |
| parent | d85326a119c34789055c388fcd18bb0161fbfd21 (diff) | |
| download | ouroboros-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/hdr.c')
| -rw-r--r-- | src/irmd/oap/hdr.c | 21 |
1 files changed, 15 insertions, 6 deletions
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); |
