mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
Get bits from private key rather than user input.
This commit is contained in:
parent
f3128143fa
commit
58c692a587
1 changed files with 2 additions and 2 deletions
|
|
@ -157,7 +157,7 @@ func (o *defaultKeyPairBuilder) newEcdsaKeyPair() (KeyPair, error) {
|
|||
|
||||
return &defaultKeyPair{
|
||||
kind: Ecdsa,
|
||||
bits: o.bits,
|
||||
bits: privateKey.Curve.Params().BitSize,
|
||||
name: o.name,
|
||||
privateKeyDerBytes: raw,
|
||||
publicKey: sshPublicKey,
|
||||
|
|
@ -182,7 +182,7 @@ func (o *defaultKeyPairBuilder) newRsaKeyPair() (KeyPair, error) {
|
|||
|
||||
return &defaultKeyPair{
|
||||
kind: Rsa,
|
||||
bits: o.bits,
|
||||
bits: privateKey.N.BitLen(),
|
||||
name: o.name,
|
||||
privateKeyDerBytes: x509.MarshalPKCS1PrivateKey(privateKey),
|
||||
publicKey: sshPublicKey,
|
||||
|
|
|
|||
Loading…
Reference in a new issue