core: add support for RFC7217 stable privacy addressing

System Internals / NetworkManager - Lubomir Rintel [v3.sk] - 2 November 2015 13:27 UTC

RFC7217 introduces an alternative mechanism for creating addresses during stateless IPv6 address configuration. It's supposed to create addresses whose host part stays stable in a particular network but changes when the hosts enters another network to mitigate possibility of tracking the host movement.

It can be used alongside RFC 4941 privacy extensions (temporary addresses) and replaces the use of RFC 4862 interface identifiers.

The address creation mode is controlld by ip6.addr_gen_mode property (ADDR_GEN_MODE in ifcfg-rh), with values of "stable-privacy" and "eui-64", defaulting to "eui-64" if unspecified.

The host part of an address is computed by hashing a system-specific secret salted with various stable values that identify the connection with a secure hash algorithm:

RID = F(Prefix, Net_Iface, Network_ID, DAD_Counter, secret_key)

For NetworkManager we use these parameters:

- F() SHA256 hash function.

- Prefix This is a network part of the /64 address

- Net_Iface We use the interface name (e.g. "eth0"). This ensures the address won't change with the change of interface hardware.

- Network_ID We use the connection UUID here. This ensures the salt is different for wireless networks with a different SSID as suggested by RFC7217.

- DAD_Counter A per-address counter that increases with each DAD failure.

- secret_key We store the secret key in /var/lib/NetworkManager/secret_key. If it's shorter than 128 bits then it's rejected. If the file is not present we initialize it by fetching 256 pseudo-random bits from /dev/urandom on first use.

Duplicate address detection uses IDGEN_RETRIES = 3 and does not utilize the IDGEN_DELAY delay (despite it SHOULD). This is for ease of implementation and may change in future. Neither parameter is currently configurable.

e603c86 core: add support for RFC7217 stable privacy addressing
src/NetworkManagerUtils.c | 121 +++++++++++++++++++++++++++++++++++-
src/NetworkManagerUtils.h | 6 ++
src/devices/nm-device.c | 83 ++++++++++++++++++-------
src/nm-iface-helper.c | 5 +-
src/rdisc/nm-lndp-rdisc.c | 4 +-
src/rdisc/nm-lndp-rdisc.h | 2 +-
src/rdisc/nm-rdisc.c | 29 ++++++++-
src/rdisc/nm-rdisc.h | 3 +
src/rdisc/tests/test-rdisc-linux.c | 5 +-
src/tests/Makefile.am | 22 ++++++-
src/tests/test-utils.c | 63 +++++++++++++++++++
11 files changed, 314 insertions(+), 29 deletions(-)

Upstream: cgit.freedesktop.org


  • Share