diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-22 17:19:23 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-22 17:19:23 +0200 |
| commit | 2184c2a33b9c00a21d8816f42f5b76d5b9d59be6 (patch) | |
| tree | ac7ff9f0c1fdfd1d4da68e7a02b07a26f0a81851 /go.mod | |
| parent | 8b627f383e68ce2b71832d26e86f621239271ad0 (diff) | |
Fix PIN prompt and Ctrl+C behaviour in shell
PIN prompt: replace readline.ReadPassword (which silently failed to
display the prompt before the process was fully interactive) with
golang.org/x/term.ReadPassword, which reliably disables echo and prints
the prompt via a plain fmt.Print before reading. This fixes the root cause
of the decryption failures — the user was never prompted for their PIN,
so an empty/default PIN was used, producing a wrong IV.
Ctrl+C: return io.EOF from Shell.ReadLine on readline.ErrInterrupt so
that pressing Ctrl+C exits the shell loop, matching the Ruby behaviour
where SIGINT terminates the process.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'go.mod')
| -rw-r--r-- | go.mod | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,6 +1,6 @@ module codeberg.org/snonux/geheim -go 1.24 +go 1.24.0 require ( github.com/ergochat/readline v0.1.3 @@ -8,6 +8,7 @@ require ( ) require ( - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.40.0 // indirect golang.org/x/text v0.9.0 // indirect ) |
