Show Ed25519 in the public-key log field.
This commit is contained in:
parent
5a6517ca5b
commit
c1c986922b
2 changed files with 9 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"crypto"
|
||||
"crypto/dsa" //nolint
|
||||
"crypto/ecdsa"
|
||||
"crypto/ed25519"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"encoding/asn1"
|
||||
|
@ -437,7 +438,6 @@ func parseCursor(r *http.Request) (cursor string, limit int, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// TODO: add support for Ed25519 once it's supported
|
||||
func fmtPublicKey(cert *x509.Certificate) string {
|
||||
var params string
|
||||
switch pk := cert.PublicKey.(type) {
|
||||
|
@ -445,6 +445,8 @@ func fmtPublicKey(cert *x509.Certificate) string {
|
|||
params = pk.Curve.Params().Name
|
||||
case *rsa.PublicKey:
|
||||
params = strconv.Itoa(pk.Size() * 8)
|
||||
case ed25519.PublicKey:
|
||||
return cert.PublicKeyAlgorithm.String()
|
||||
case *dsa.PublicKey:
|
||||
params = strconv.Itoa(pk.Q.BitLen() * 8)
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue