Overview
Implement WiFi Access Point mode so the HavenLink device can broadcast a mesh hotspot, with the WiFi passphrase derived from the USB identity key.
Depends on: #24 (havenlink-tools)
Part 1: Wire up WiFi AP mode
Config files already exist (config/hostapd.conf, config/dnsmasq.conf). Remaining work:
- Add
hostapd and dnsmasq to the default runlevel in build-image.sh
- Configure
wlan0 with static IP 10.0.0.1/24 in /etc/network/interfaces
- Update
config/hostapd.conf: replace wpa_passphrase with wpa_passphrase_file=/run/hostapd.psk
- Add nftables rules: allow DHCP (UDP 67/68) and mesh ports (9001-9010) on
wlan0
isolate_clients=1 already set — clients cannot reach each other, only the HavenLink node
Part 2: USB key-derived WiFi passphrase
Implemented in havenlink-tools wifi start (see #24):
havenlink-tools usb init --device /dev/sdb writes wifi-salt (32 random bytes) to USB key
- At boot or on demand:
havenlink-tools wifi start --device /dev/sdb
- Reads
wifi-salt from USB
- Derives passphrase:
HKDF-SHA256(wifi-salt, info="havenlink-wifi-v1") → base64url → 43 chars
- Writes to
/run/hostapd.psk (tmpfs, mode 0600)
- Starts hostapd
- No USB key = WiFi AP does not start
Security Properties
- Passphrase never stored on device (tmpfs only, wiped on reboot/stop)
- Physical USB key required to stand up the WiFi network
- Rotating
wifi-salt invalidates all previously shared passphrases
- HKDF is one-way: brute-forcing the passphrase reveals nothing about the USB secret
Acceptance Criteria
Overview
Implement WiFi Access Point mode so the HavenLink device can broadcast a mesh hotspot, with the WiFi passphrase derived from the USB identity key.
Depends on: #24 (havenlink-tools)
Part 1: Wire up WiFi AP mode
Config files already exist (
config/hostapd.conf,config/dnsmasq.conf). Remaining work:hostapdanddnsmasqto the default runlevel inbuild-image.shwlan0with static IP10.0.0.1/24in/etc/network/interfacesconfig/hostapd.conf: replacewpa_passphrasewithwpa_passphrase_file=/run/hostapd.pskwlan0isolate_clients=1already set — clients cannot reach each other, only the HavenLink nodePart 2: USB key-derived WiFi passphrase
Implemented in
havenlink-tools wifi start(see #24):havenlink-tools usb init --device /dev/sdbwriteswifi-salt(32 random bytes) to USB keyhavenlink-tools wifi start --device /dev/sdbwifi-saltfrom USBHKDF-SHA256(wifi-salt, info="havenlink-wifi-v1")→ base64url → 43 chars/run/hostapd.psk(tmpfs, mode 0600)Security Properties
wifi-saltinvalidates all previously shared passphrasesAcceptance Criteria
HavenLink-MeshSSID whenwlan0is present and USB key is insertedisolate_clients=1)