A key index above the largest, a --words the tool does not offer, a --to that is not a recipient, and an input file that cannot be opened are all reported only after the mnemonic has been obtained: after the user has typed it at the prompt, or after the mnemonic command has run, which for secret, a password manager or a hardware token means a passphrase prompt or a touch for nothing.
Where: internal/cli/age/age.go:380-397 (derived reads the mnemonic, then derive.Bytes checks the index); internal/cli/age/age.go:111-130 with internal/agekey/agekey.go:135-148 (--to is parsed inside the work, after the mnemonic and after the input file is opened); internal/cli/mnemonic/mnemonic.go:43-65 (--words is checked by childmnemonic.Derive, after the mnemonic).
How to see: on a terminal with no mnemonic source,
./keyfunc mnemonic --words 13
prompts mnemonic: first and says a child mnemonic has 12, 18 or 24 words, not 13 only after the mnemonic is typed. Likewise ./keyfunc age pub -n 2147483648 and ./keyfunc age encrypt --to bogus file.
Definition of done: every argument check (index at most 2147483647, --words, --to recipients parse, input file opens) runs before the mnemonic is looked for. Tests in internal/cli/cli_test.go and internal/cli/age_test.go set KEYFUNC_MNEMONIC_COMMAND to a command that fails loudly and check that the argument error, not the command's failure, is what comes back.
Severity: minor. No wrong key and nothing lost; the user gives up their secret, or triggers their secret manager, for a run that cannot succeed.
Model: fable-5-1
A key index above the largest, a `--words` the tool does not offer, a `--to` that is not a recipient, and an input file that cannot be opened are all reported only after the mnemonic has been obtained: after the user has typed it at the prompt, or after the mnemonic command has run, which for `secret`, a password manager or a hardware token means a passphrase prompt or a touch for nothing.
Where: `internal/cli/age/age.go:380-397` (`derived` reads the mnemonic, then `derive.Bytes` checks the index); `internal/cli/age/age.go:111-130` with `internal/agekey/agekey.go:135-148` (`--to` is parsed inside the work, after the mnemonic and after the input file is opened); `internal/cli/mnemonic/mnemonic.go:43-65` (`--words` is checked by `childmnemonic.Derive`, after the mnemonic).
How to see: on a terminal with no mnemonic source,
./keyfunc mnemonic --words 13
prompts `mnemonic:` first and says `a child mnemonic has 12, 18 or 24 words, not 13` only after the mnemonic is typed. Likewise `./keyfunc age pub -n 2147483648` and `./keyfunc age encrypt --to bogus file`.
**Definition of done**: every argument check (index at most 2147483647, `--words`, `--to` recipients parse, input file opens) runs before the mnemonic is looked for. Tests in `internal/cli/cli_test.go` and `internal/cli/age_test.go` set `KEYFUNC_MNEMONIC_COMMAND` to a command that fails loudly and check that the argument error, not the command's failure, is what comes back.
Severity: minor. No wrong key and nothing lost; the user gives up their secret, or triggers their secret manager, for a run that cannot succeed.
Model: fable-5-1
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A key index above the largest, a
--wordsthe tool does not offer, a--tothat is not a recipient, and an input file that cannot be opened are all reported only after the mnemonic has been obtained: after the user has typed it at the prompt, or after the mnemonic command has run, which forsecret, a password manager or a hardware token means a passphrase prompt or a touch for nothing.Where:
internal/cli/age/age.go:380-397(derivedreads the mnemonic, thenderive.Byteschecks the index);internal/cli/age/age.go:111-130withinternal/agekey/agekey.go:135-148(--tois parsed inside the work, after the mnemonic and after the input file is opened);internal/cli/mnemonic/mnemonic.go:43-65(--wordsis checked bychildmnemonic.Derive, after the mnemonic).How to see: on a terminal with no mnemonic source,
prompts
mnemonic:first and saysa child mnemonic has 12, 18 or 24 words, not 13only after the mnemonic is typed. Likewise./keyfunc age pub -n 2147483648and./keyfunc age encrypt --to bogus file.Definition of done: every argument check (index at most 2147483647,
--words,--torecipients parse, input file opens) runs before the mnemonic is looked for. Tests ininternal/cli/cli_test.goandinternal/cli/age_test.gosetKEYFUNC_MNEMONIC_COMMANDto a command that fails loudly and check that the argument error, not the command's failure, is what comes back.Severity: minor. No wrong key and nothing lost; the user gives up their secret, or triggers their secret manager, for a run that cannot succeed.
Model: fable-5-1