From 71cbc0efd3fc12767f800e0e8f862afe7f580ae2 Mon Sep 17 00:00:00 2001 From: Diep Pham Date: Mon, 19 Jun 2017 15:59:07 +0700 Subject: [PATCH] [easyssh] logs errors when parsing public keys (appleboy/easyssh-proxy#33) * logs errors when parsing public keys * adds missing newline https://github.com/appleboy/drone-ssh/commit/b777a323265 --- vendor/github.com/appleboy/easyssh-proxy/easyssh.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vendor/github.com/appleboy/easyssh-proxy/easyssh.go b/vendor/github.com/appleboy/easyssh-proxy/easyssh.go index 08aa356..879e951 100644 --- a/vendor/github.com/appleboy/easyssh-proxy/easyssh.go +++ b/vendor/github.com/appleboy/easyssh-proxy/easyssh.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "io/ioutil" + "log" "net" "os" "path/filepath" @@ -80,13 +81,17 @@ func getSSHConfig(config DefaultConfig) *ssh.ClientConfig { } if config.KeyPath != "" { - if pubkey, err := getKeyFile(config.KeyPath); err == nil { + if pubkey, err := getKeyFile(config.KeyPath); err != nil { + log.Printf("getKeyFile: %v\n", err) + } else { auths = append(auths, ssh.PublicKeys(pubkey)) } } if config.Key != "" { - if signer, err := ssh.ParsePrivateKey([]byte(config.Key)); err == nil { + if signer, err := ssh.ParsePrivateKey([]byte(config.Key)); err != nil { + log.Printf("ssh.ParsePrivateKey: %v\n", err) + } else { auths = append(auths, ssh.PublicKeys(signer)) } }