Skip to content

Commit

Permalink
Revert "cmd/age: automatically load default SSH key paths"
Browse files Browse the repository at this point in the history
It's not clear the convenience for SSH keys is worth having any
implicitly configured identity at all. Will revisit after v1.0.0.

This reverts commit 225044b.
  • Loading branch information
FiloSottile committed Mar 10, 2021
1 parent 6c8d072 commit 710644e
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions cmd/age/age.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
_log "log"
"os"
"runtime/debug"
Expand Down Expand Up @@ -293,26 +292,6 @@ func decrypt(keys []string, in io.Reader, out io.Writer) {
&LazyScryptIdentity{passphrasePrompt},
}

// If they exist and are well-formed, load the default SSH keys. If they are
// passphrase protected, the passphrase will only be requested if the
// identity matches a recipient stanza.
for _, path := range []string{
os.ExpandEnv("$HOME/.ssh/id_rsa"),
os.ExpandEnv("$HOME/.ssh/id_ed25519"),
} {
content, err := ioutil.ReadFile(path)
if err != nil {
continue
}
ids, err := parseSSHIdentity(path, content)
if err != nil {
// If the key is explicitly requested, this error will be caught
// below, otherwise ignore it silently.
continue
}
identities = append(identities, ids...)
}

for _, name := range keys {
ids, err := parseIdentitiesFile(name)
if err != nil {
Expand Down

0 comments on commit 710644e

Please sign in to comment.