diff --git a/internal/secret/crypto.go b/internal/secret/crypto.go index d0fc8e4..328f9a2 100644 --- a/internal/secret/crypto.go +++ b/internal/secret/crypto.go @@ -85,12 +85,16 @@ func ReadPassphrase(prompt string) (string, error) { // Check if stdin is a terminal if !term.IsTerminal(syscall.Stdin) { // Not a terminal - never read passphrases from piped input for security reasons - return "", fmt.Errorf("cannot read passphrase from non-terminal stdin (piped input or script). Please set the SB_UNLOCK_PASSPHRASE environment variable or run interactively") + return "", fmt.Errorf("cannot read passphrase from non-terminal stdin " + + "(piped input or script). Please set the SB_UNLOCK_PASSPHRASE " + + "environment variable or run interactively") } // stdin is a terminal, check if stderr is also a terminal for interactive prompting if !term.IsTerminal(syscall.Stderr) { - return "", fmt.Errorf("cannot prompt for passphrase: stderr is not a terminal (running in non-interactive mode). Please set the SB_UNLOCK_PASSPHRASE environment variable") + return "", fmt.Errorf("cannot prompt for passphrase: stderr is not a terminal " + + "(running in non-interactive mode). Please set the SB_UNLOCK_PASSPHRASE " + + "environment variable") } // Both stdin and stderr are terminals - use secure password reading