oddlama / agenix-rekey

An agenix extension adding secret generation and automatic rekeying using a YubiKey or master-identity
MIT License
197 stars 16 forks source link

wg: Trailing characters found after key #4

Closed bbigras closed 1 year ago

bbigras commented 1 year ago
❯ wg genkey | tee /dev/stdout | wg pubkey
/run/current-system/sw/bin/wg: Trailing characters found after key

❯ wg genkey | tee /dev/stdout
aBEpDuFghYG3CZOwU4Q19aiUDiZaTxeVfHyHRcI0FHI=
aBEpDuFghYG3CZOwU4Q19aiUDiZaTxeVfHyHRcI0FHI=

❯ echo $SHELL
/run/current-system/sw/bin/zsh
oddlama commented 1 year ago

Ugh good catch. For an interactive terminal /dev/tty would work, but this should probably be replaced with the equivalent of this:

priv=$(wg genkey)
wg pubkey <<< "$priv" > out.pub
echo "$priv"