Skip to main content

Module device_keys

Module device_keys 

Source
Expand description

The keys this machine issued to paired devices, on disk.

Deliberately not in settings_kv beside proxy_api_key. That store is printed in full by gglib config settings show — unmasked on purpose, so a rotated key can be recovered — and that output is what people paste into bug reports. One shared key there is a known cost; a device key each would quietly undo what per-device revocation is for. The roster’s readable half (ids, labels, last-seen) stays in settings; only the secrets are here.

Same directory and same posture as the endpoint identity: 0600, under data/, which a debug build resolves to the repository checkout where .gitignore covers it.

Statics§

NEXT_TMP 🔒
Distinguishes one writer’s temporary file from another’s within a process; the pid does it across processes in one pid namespace.

Functions§

create_private 🔒
Open the temporary file for writing: new, and 0600 from the moment it exists.
device_keys_path
Where the keys live: beside the endpoint identity.
load
Read the roster’s keys, or an empty map when nothing has been issued.
open_new 🔒
create_new, with the mode asked of open itself.
restrict 🔒
0600 exactly where the platform has a notion of it: the umask can take bits from the mode open_new asked for, the owner’s own among them. Set on the descriptor, so what changes is the file this writer created and not whatever is under its name by now.
store
Replace the stored keys, 0600, atomically.

Type Aliases§

DeviceKeys
Every device key this machine holds, by the id the tunnel edge knows it as.