From 712ff0655383f49c0ca69dbeb326b28e20c6e080 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Fri, 22 Oct 2021 23:58:18 +0200 Subject: [PATCH] refactor rename Signed-off-by: Matej Vasek --- internal/sshdialer/ssh_dialer.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/sshdialer/ssh_dialer.go b/internal/sshdialer/ssh_dialer.go index 9d10c097f0..8c6aa5da68 100644 --- a/internal/sshdialer/ssh_dialer.go +++ b/internal/sshdialer/ssh_dialer.go @@ -222,29 +222,30 @@ func NewSSHClientConfig(url *urlPkg.URL, config Config) (*ssh.ClientConfig, erro // add signer from explicit identity parameter if config.Identity != "" { - s, err := loadSignerFromFile(config.Identity, []byte(config.Identity), config.PassPhraseCallback) + signer, err := loadSignerFromFile(config.Identity, []byte(config.Identity), config.PassPhraseCallback) if err != nil { return nil, fmt.Errorf("failed to parse identity file: %w", err) } - signers = append(signers, s) + signers = append(signers, signer) } - s, err := getSignersFromAgent() + // pulls signers (keys) from ssh-agent + signersFromAgent, err := getSignersFromAgent() if err != nil { return nil, err } - signers = append(signers, s...) + signers = append(signers, signersFromAgent...) // if there is no explicit identity file nor keys from ssh-agent then // add keys with standard name from ~/.ssh/ if len(signers) == 0 { defaultKeyPaths := getDefaultKeys() if len(defaultKeyPaths) == 1 { - s, err := loadSignerFromFile(defaultKeyPaths[0], []byte(config.PassPhrase), config.PassPhraseCallback) + signer, err := loadSignerFromFile(defaultKeyPaths[0], []byte(config.PassPhrase), config.PassPhraseCallback) if err != nil { return nil, err } - signers = append(signers, s) + signers = append(signers, signer) } }