Apply suggestions from code review

Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>
Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com>
This commit is contained in:
Milos Gajdos 2025-02-06 17:43:28 +00:00 committed by GitHub
parent 53c382641c
commit 6ed60b0f48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -218,12 +218,12 @@ func verifyJWK(header jose.Header, verifyOpts VerifyOptions) (crypto.PublicKey,
// Check to see if the key includes a certificate chain.
if len(jwk.Certificates) == 0 {
// The JWK should be one of the trusted root keys.
trustedKey, trusted := verifyOpts.TrustedKeys[jwk.KeyID]
key, trusted := verifyOpts.TrustedKeys[jwk.KeyID]
if !trusted {
return nil, errors.New("untrusted JWK with no certificate chain")
}
// The JWK is one of the trusted keys.
return trustedKey, nil
return key, nil
}
opts := x509.VerifyOptions{