Derive the vault key from the mnemonic's words however they are spaced (closes #135)
check / check (push) Failing after 4s
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
This commit is contained in:
@@ -19,6 +19,7 @@ require (
|
||||
golang.org/x/crypto v0.38.0
|
||||
golang.org/x/sys v0.33.0
|
||||
golang.org/x/term v0.32.0
|
||||
golang.org/x/text v0.25.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -31,6 +32,5 @@ require (
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
golang.org/x/text v0.25.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user