mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
[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
This commit is contained in:
parent
6e20c74ff3
commit
71cbc0efd3
9
vendor/github.com/appleboy/easyssh-proxy/easyssh.go
generated
vendored
9
vendor/github.com/appleboy/easyssh-proxy/easyssh.go
generated
vendored
@ -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))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user