summaryrefslogtreecommitdiff
path: root/src/lib/serdes-irm.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-06-21 13:35:45 +0200
committerSander Vrijders <sander@ouroboros.rocks>2026-06-29 08:32:59 +0200
commit110d3ed8526197bd866e02199bfeae7569d73d8d (patch)
tree2f1cd02c69dd6b7e1bf4924b488505f570e5c2b1 /src/lib/serdes-irm.c
parent84e1a6c0e9f6a7aed3c367e5b6fce029db0fc453 (diff)
downloadouroboros-110d3ed8526197bd866e02199bfeae7569d73d8d.tar.gz
ouroboros-110d3ed8526197bd866e02199bfeae7569d73d8d.zip
irmd: Complete bidirectional flow re-keying
Extend re-key delivery beyond the locally-initiated watermark path: Handle peer-initiated re-key requests, allowing one request and one response per flow at a time. The client side wins if both ends try to re-key at the same time. Caches the peer certificate to support cert-less authenticated/signed re-keys. After a rekey, the initiator promotes first (timer) and starts sending under the new key. The responder observes the new key (peer_synced) and then the responder promotes. The responder will self-decide to use the new keys if it exhausted the older set in the case where it never sees the peer (unidirectional flow). Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/serdes-irm.c')
-rw-r--r--src/lib/serdes-irm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/serdes-irm.c b/src/lib/serdes-irm.c
index 24bb349f..74ca694c 100644
--- a/src/lib/serdes-irm.c
+++ b/src/lib/serdes-irm.c
@@ -187,7 +187,8 @@ int flow__irm_result_des(buffer_t * buf,
int flow_rekey__irm_result_des(buffer_t * buf,
struct crypt_sk * sk,
- bool * has_key)
+ bool * has_key,
+ bool * initiator)
{
irm_msg_t * msg;
int err;
@@ -214,6 +215,7 @@ int flow_rekey__irm_result_des(buffer_t * buf,
sk->nid = NID_undef;
sk->epoch = msg->has_generation ?
(uint8_t) msg->generation : 0;
+ *initiator = msg->has_rk_initiator && msg->rk_initiator;
}
irm_msg__free_unpacked(msg, NULL);