From 710644eef89d5dc3e2df52be4a435917717fc0e5 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 9 Mar 2021 18:18:48 -0500 Subject: [PATCH] Revert "cmd/age: automatically load default SSH key paths" 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 225044b061de1f11e60ffe1bf460a6dbf3cdf061. --- cmd/age/age.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/cmd/age/age.go b/cmd/age/age.go index 3d70ed1e..1a6f0051 100644 --- a/cmd/age/age.go +++ b/cmd/age/age.go @@ -12,7 +12,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" _log "log" "os" "runtime/debug" @@ -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 {