Skip to content

Commit

Permalink
Fix x25519 thumbprint
Browse files Browse the repository at this point in the history
  • Loading branch information
maraino committed Jan 4, 2022
1 parent 74b0c4b commit cfaa65f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jose/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ func Thumbprint(jwk *JSONWebKey) (string, error) {
case x25519.PublicKey:
sum, err = x25519Thumbprint(key, crypto.SHA256)
case x25519.PrivateKey:
sum, err = x25519Thumbprint(key.Public(), crypto.SHA256)
var pub x25519.PublicKey
if pub, err = key.PublicKey(); err == nil {
sum, err = x25519Thumbprint(pub, crypto.SHA256)
}
default:
sum, err = jwk.Thumbprint(crypto.SHA256)
}
Expand Down

0 comments on commit cfaa65f

Please sign in to comment.