NetworkManager/src/core/ndisc
Thomas Haller 6e96d71731
all: use nm_random_*() instead of g_random_*()
g_random_*() is based on GRand, which is not a CSPRNG. Instead, rely on
kernel to give us good random numbers, which is what nm_random_*() does.

Note that nm_random_*() calls getrandom() (or reads /dev/urandom), which
most likely is slower than GRand. It doesn't matter for our uses though.

It is cumbersome to review all uses of g_rand_*() whether their usage of
a non-cryptographically secure generator is appropriate. Instead, just
always use an appropriate function, thereby avoiding this question. Even
glib documentation refers to reading "/dev/urandom" as alternative. Which
is what nm_random_*() does. These days, it seems unnecessary to not use
the best random generator available, unless it's not fast enough or you
need a stable/seedable stream of random numbers.

In particular in nmcli, we used g_random_int_range() to generate
passwords. That is not appropriate. Sure, it's *only* for the hotspot,
but still.
2023-01-30 10:51:13 +01:00
..
tests ndisc/tests: fix reference counting in nm_fake_ndisc_new() 2023-01-05 12:13:39 +01:00
nm-fake-ndisc.c ndisc/tests: fix reference counting in nm_fake_ndisc_new() 2023-01-05 12:13:39 +01:00
nm-fake-ndisc.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-lndp-ndisc.c ndisc: Accept routes from on-link prefixes form ra 2023-01-23 16:50:08 +00:00
nm-lndp-ndisc.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-ndisc-private.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-ndisc.c all: use nm_random_*() instead of g_random_*() 2023-01-30 10:51:13 +01:00
nm-ndisc.h ndisc: Accept routes from on-link prefixes form ra 2023-01-23 16:50:08 +00:00