From 71358222f05918644c1606732a371709654b5a44 Mon Sep 17 00:00:00 2001 From: "Jason A. Beranek" Date: Thu, 19 Sep 2013 23:30:22 -0500 Subject: [PATCH] communicator/ssh, builder/digitalocean: fix new SSH API from upstream --- builder/digitalocean/step_create_ssh_key.go | 3 ++- communicator/ssh/keychain.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/digitalocean/step_create_ssh_key.go b/builder/digitalocean/step_create_ssh_key.go index 6a9f0426c..04699ec66 100644 --- a/builder/digitalocean/step_create_ssh_key.go +++ b/builder/digitalocean/step_create_ssh_key.go @@ -38,7 +38,8 @@ func (s *stepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction { state.Put("privateKey", string(pem.EncodeToMemory(&priv_blk))) // Marshal the public key into SSH compatible format - pub := ssh.NewRSAPublicKey(&priv.PublicKey) + // TODO properly handle the public key error + pub, _ := ssh.NewPublicKey(&priv.PublicKey) pub_sshformat := string(ssh.MarshalAuthorizedKey(pub)) // The name of the public key on DO diff --git a/communicator/ssh/keychain.go b/communicator/ssh/keychain.go index d7934f8a8..f9965c0da 100644 --- a/communicator/ssh/keychain.go +++ b/communicator/ssh/keychain.go @@ -60,9 +60,9 @@ func (k *SimpleKeychain) Key(i int) (ssh.PublicKey, error) { } switch key := k.keys[i].(type) { case *rsa.PrivateKey: - return ssh.NewRSAPublicKey(&key.PublicKey), nil + return ssh.NewPublicKey(&key.PublicKey) case *dsa.PrivateKey: - return ssh.NewDSAPublicKey(&key.PublicKey), nil + return ssh.NewPublicKey(&key.PublicKey) } panic("unknown key type") }