Closed t-8ch closed 6 years ago
this is addressed by #21 => I took this into a different PR.
Thinking about further, I think we should not use srand(time(0))
.
If we have many systems rebooting at the same time, for example after a powercut in a big installation, we can experience duplicate nonces.
We should probably use getrandom(2)
or /dev/urandom
.
Personally I would prefer getrandom(2)
, but it requires Linux >= 3.17 and has no wrapper support in musl.
we are on linux >4.4 so requiring kernel >=3.17 is no issue imho.
this will be handled by #25 - no need to keep issue AND pr.
Currently
src/intercom.c
usesrand()
to produce nonces. This RNG is deterministic and seeded to the value 1 on startup. This makes nonce collisions quite likely.The RNG should be seeded with a nonconstant value.