Merge pull request #8354 from alrs/fix-do-ssh-key
builder/digitalocean: fix dropped error on RSA key generation
This commit is contained in:
commit
be0e9f7816
|
@ -33,6 +33,12 @@ func (s *stepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) mu
|
||||||
ui.Say("Creating temporary ssh key for droplet...")
|
ui.Say("Creating temporary ssh key for droplet...")
|
||||||
|
|
||||||
priv, err := rsa.GenerateKey(rand.Reader, 2014)
|
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
|
// ASN.1 DER encoded form
|
||||||
priv_der := x509.MarshalPKCS1PrivateKey(priv)
|
priv_der := x509.MarshalPKCS1PrivateKey(priv)
|
||||||
|
|
Loading…
Reference in New Issue