Skip to content

Commit

Permalink
Merge pull request #1251 from tomc797/fix/crypto.PrivateKey_type_asse…
Browse files Browse the repository at this point in the history
…rtion

EC key: panic: interface conversion: crypto.PrivateKey is *ecdsa.PrivateKey, not *rsa.PrivateKe
  • Loading branch information
andrewpmartinez authored Aug 16, 2023
2 parents 697a7af + dea6cc6 commit 774451c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ziti/pki/pki/pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,10 @@ func (e *ZitiPKI) Sign(signer *certificate.Bundle, req *Request) error {
return fmt.Errorf("failed generating private key: %v", err)
}
} else {
pk, err := e.GetPrivateKey(signer.Name, req.KeyName)
privateKey, err = e.GetPrivateKey(signer.Name, req.KeyName)
if err != nil {
return fmt.Errorf("failed fetching private key: %v", err)
}
privateKey = pk.(*rsa.PrivateKey)
}

publicKey, err := publicKeyFromPrivate(privateKey)
Expand Down

0 comments on commit 774451c

Please sign in to comment.