File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -171,12 +171,17 @@ func Copy(client *ssh.Client) {
171171func ConfigureAuthentication (key string , passphrase string , password string ) []ssh.AuthMethod {
172172 // Create signer for public key authentication method.
173173 auth := make ([]ssh.AuthMethod , 1 )
174+
174175 if key != "" {
176+ var err error
177+ var targetSigner ssh.Signer
178+
175179 if passphrase != "" {
176- targetSigner , err : = ssh .ParsePrivateKeyWithPassphrase ([]byte (key ), []byte (passphrase ))
180+ targetSigner , err = ssh .ParsePrivateKeyWithPassphrase ([]byte (key ), []byte (passphrase ))
177181 } else {
178- targetSigner , err : = ssh .ParsePrivateKey ([]byte (key ))
182+ targetSigner , err = ssh .ParsePrivateKey ([]byte (key ))
179183 }
184+
180185 if err != nil {
181186 log .Fatalf ("❌ Failed to parse private key: %v" , err )
182187 }
You can’t perform that action at this time.
0 commit comments