summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-12-18 13:22:37 +0100
committerSander Vrijders <sander@ouroboros.rocks>2023-12-31 16:47:55 +0100
commit863553891b296c5574d6b0893ad21fe16b97a6ea (patch)
tree4b71169f7aea62a0c043ff85d9597b9e395b26bd /src/lib
parent9ecb29b3691df17c0beec56ddf4f27160bb3ef58 (diff)
downloadouroboros-863553891b296c5574d6b0893ad21fe16b97a6ea.tar.gz
ouroboros-863553891b296c5574d6b0893ad21fe16b97a6ea.zip
irmd: Fix passing symmetric key on allocation
The check if the flow requires a key in irmd flow_alloc was missing when setting the pointers for the piggyback data, so non-encrypted flow allocations failed on irm_msg__pack(). Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index acf18da2..74a8c62d 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -475,7 +475,7 @@ static int flow_init(int flow_id,
flow->crypt.flags = qs.cypher_s; /* TODO: remove cypher_s from qos */
- if (flow->crypt.flags > 0)
+ if (flow->crypt.flags > 0 && s != NULL) /* static analyzer s != NULL */
memcpy(flow->crypt.key, s ,SYMMKEYSZ);
else
memset(flow->crypt.key, 0, SYMMKEYSZ);