From 65804c07c579c9d9701a3733a8c9e283c94f55f9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 26 Apr 2014 11:28:02 -0700 Subject: [PATCH] builder/null: pass SSH tests --- builder/null/ssh.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/builder/null/ssh.go b/builder/null/ssh.go index 60f9b6cea..ab9c9e40a 100644 --- a/builder/null/ssh.go +++ b/builder/null/ssh.go @@ -1,7 +1,7 @@ package null import ( - gossh "code.google.com/p/gosshold/ssh" + gossh "code.google.com/p/go.crypto/ssh" "fmt" "github.com/mitchellh/multistep" "github.com/mitchellh/packer/communicator/ssh" @@ -31,15 +31,15 @@ func SSHConfig(username string, password string, privateKeyFile string) func(mul } privateKey := string(bytes) - keyring := new(ssh.SimpleKeychain) - if err := keyring.AddPEMKey(privateKey); err != nil { + signer, err := gossh.ParsePrivateKey([]byte(privateKey)) + if err != nil { return nil, fmt.Errorf("Error setting up SSH config: %s", err) } return &gossh.ClientConfig{ User: username, - Auth: []gossh.ClientAuth{ - gossh.ClientAuthKeyring(keyring), + Auth: []gossh.AuthMethod{ + gossh.PublicKeys(signer), }, }, nil } else { @@ -47,9 +47,10 @@ func SSHConfig(username string, password string, privateKeyFile string) func(mul return &gossh.ClientConfig{ User: username, - Auth: []gossh.ClientAuth{ - gossh.ClientAuthPassword(ssh.Password(password)), - gossh.ClientAuthKeyboardInteractive(ssh.PasswordKeyboardInteractive(password)), + Auth: []gossh.AuthMethod{ + gossh.Password(password), + gossh.KeyboardInteractive( + ssh.PasswordKeyboardInteractive(password)), }, }, nil }