Skip to content

Commit

Permalink
drop passphrase flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Dec 23, 2022
1 parent aa18003 commit 9ce65f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/ssh-to-age/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import (
"errors"
"flag"
"fmt"
sshage "github.com/Mic92/ssh-to-age"
"io"
"io/ioutil"
"os"
"strings"

sshage "github.com/Mic92/ssh-to-age"
)

type options struct {
out, in string
privateKey, passphrase bool
out, in string
privateKey bool
}

func parseFlags(args []string) options {
Expand All @@ -22,7 +23,6 @@ func parseFlags(args []string) options {
f.BoolVar(&opts.privateKey, "private-key", false, "convert private key instead of public key")
f.StringVar(&opts.in, "i", "-", "Input path. Reads by default from standard output")
f.StringVar(&opts.out, "o", "-", "Output path. Prints by default to standard output")
f.BoolVar(&opts.passphrase, "passphrase", false, "Indicate private key passphrase should be read from `SSH_TO_AGE_PASSPHRASE` environment variable")
if err := f.Parse(args[1:]); err != nil {
// should never happen since flag.ExitOnError
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ssh-to-age/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestPrivateKeyWithPassphrase(t *testing.T) {
os.Setenv("SSH_TO_AGE_PASSPHRASE", passphrase)
defer os.Unsetenv("SSH_TO_AGE_PASSPHRASE")

err := convertKeys([]string{"ssh-to-age", "-private-key", "-i", Asset("id_ed25519_passphrase"), "-passphrase", "-o", out})
err := convertKeys([]string{"ssh-to-age", "-private-key", "-i", Asset("id_ed25519_passphrase"), "-o", out})
ok(t, err)

rawPrivateKey, err := ioutil.ReadFile(out)
Expand Down

0 comments on commit 9ce65f9

Please sign in to comment.