mirror of
https://github.com/distribution/distribution.git
synced 2025-08-01 23:18:31 +00:00
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:
parent
53c382641c
commit
6ed60b0f48
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user