From 04a3795a70d6deb4840b30f5889e41ed42c85a6e Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 28 Mar 2020 16:08:28 +0100 Subject: irmd: Don't always send pub key in alloc response The allocation response was always containing an ECDHE key, which is not needed if the client doesn't request an encrypted flow. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 2 +- src/irmd/main.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cce6a10..f9122b9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ include(GNUInstallDirs) set(PACKAGE_VERSION_MAJOR 0) set(PACKAGE_VERSION_MINOR 17) -set(PACKAGE_VERSION_PATCH 1) +set(PACKAGE_VERSION_PATCH 2) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(PACKAGE_DESCRIPTION "The Ouroboros prototype") diff --git a/src/irmd/main.c b/src/irmd/main.c index 1c928dca..3709a3e5 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1358,6 +1358,11 @@ static int flow_accept(pid_t pid, pthread_rwlock_unlock(&irmd.reg_lock); + if (f->qs.cypher_s == 0) { /* no crypto requested, don't send pubkey */ + data = NULL; + len = 0; + } + if (ipcp_flow_alloc_resp(pid_n1, flow_id, pid_n, 0, data, len)) { pthread_rwlock_wrlock(&irmd.flows_lock); list_del(&f->next); -- cgit v1.2.3