mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-26 09:44:01 -04:00
Merge pull request #8354 from alrs/fix-do-ssh-key
builder/digitalocean: fix dropped error on RSA key generation
This commit is contained in:
@@ -33,6 +33,12 @@ func (s *stepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) mu
|
||||
ui.Say("Creating temporary ssh key for droplet...")
|
||||
|
||||
priv, err := rsa.GenerateKey(rand.Reader, 2014)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("error generating RSA key: %s", err)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
// ASN.1 DER encoded form
|
||||
priv_der := x509.MarshalPKCS1PrivateKey(priv)
|
||||
|
||||
Reference in New Issue
Block a user