Skip to content

Commit

Permalink
puppeth: handle encrypted ssh keys (closes ethereum#15442) (ethereum#…
Browse files Browse the repository at this point in the history
…15443)

* cmd/puppeth: handle encrypted ssh keys

* cmd/puppeth: fix unconvert linter error
  • Loading branch information
Bo authored and karalabe committed Nov 12, 2017
1 parent f47adc9 commit cb8bbe7
Show file tree
Hide file tree
Showing 238 changed files with 51,116 additions and 27,559 deletions.
13 changes: 12 additions & 1 deletion cmd/puppeth/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,18 @@ func dial(server string, pubkey []byte) (*sshClient, error) {
} else {
key, err := ssh.ParsePrivateKey(buf)
if err != nil {
log.Warn("Bad SSH key, falling back to passwords", "path", path, "err", err)
fmt.Printf("What's the decryption password for %s? (won't be echoed)\n>", path)
blob, err := terminal.ReadPassword(int(os.Stdin.Fd()))
fmt.Println()
if err != nil {
log.Warn("Couldn't read password", "err", err)
}
key, err := ssh.ParsePrivateKeyWithPassphrase(buf, blob)
if err != nil {
log.Warn("Failed to decrypt SSH key, falling back to passwords", "path", path, "err", err)
} else {
auths = append(auths, ssh.PublicKeys(key))
}
} else {
auths = append(auths, ssh.PublicKeys(key))
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (w *wizard) makeServer() string {
fmt.Println()
fmt.Println("Please enter remote server's address:")

// Read and fial the server to ensure docker is present
// Read and dial the server to ensure docker is present
input := w.readString()

client, err := dial(input, nil)
Expand Down
2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/const_amd64.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/const_amd64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/curve25519.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/freeze_amd64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/mul_amd64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/curve25519/square_amd64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/golang.org/x/crypto/ed25519/ed25519.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions vendor/golang.org/x/crypto/scrypt/scrypt.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions vendor/golang.org/x/crypto/ssh/buffer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 25 additions & 9 deletions vendor/golang.org/x/crypto/ssh/certs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions vendor/golang.org/x/crypto/ssh/cipher.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/ssh/client_auth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/golang.org/x/crypto/ssh/connection.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/golang.org/x/crypto/ssh/kex.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cb8bbe7

Please sign in to comment.