Derive the vault key from the mnemonic's words however they are spaced (closes #135) #160

Merged
clawbot merged 1 commits from mnemonic-whitespace into next 2026-10-13 01:09:37 +02:00
1 Commits
Author SHA1 Message Date
clawbot 613895afbf Derive the vault key from the mnemonic's words however they are spaced (closes #135)
check / check (push) Failing after 4s
The long-term key was derived from the mnemonic text exactly as typed,
so a double space, a tab or a trailing newline gave a different key,
and a vault made that way did not open with the same words typed
normally. agehd.DeriveEntropy, which init, vault create, vault import,
unlocker add and every unlock go through, now joins the words with
single spaces and puts them in Unicode NFKD, as BIP39 defines the
seed's input, before hashing them. golang.org/x/text, already an
indirect dependency, becomes a direct one for the NFKD step.

Judgement call: internal/bip39's NewSeed keeps hashing its input as
given, as upstream does; the normalising is in agehd.

Model: opus-5-5
2026-10-12 22:51:00 +00:00