mirror of
https://github.com/distribution/distribution.git
synced 2025-09-25 22:23:38 +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:
@@ -218,12 +218,12 @@ func verifyJWK(header jose.Header, verifyOpts VerifyOptions) (crypto.PublicKey,
|
|||||||
// Check to see if the key includes a certificate chain.
|
// Check to see if the key includes a certificate chain.
|
||||||
if len(jwk.Certificates) == 0 {
|
if len(jwk.Certificates) == 0 {
|
||||||
// The JWK should be one of the trusted root keys.
|
// The JWK should be one of the trusted root keys.
|
||||||
trustedKey, trusted := verifyOpts.TrustedKeys[jwk.KeyID]
|
key, trusted := verifyOpts.TrustedKeys[jwk.KeyID]
|
||||||
if !trusted {
|
if !trusted {
|
||||||
return nil, errors.New("untrusted JWK with no certificate chain")
|
return nil, errors.New("untrusted JWK with no certificate chain")
|
||||||
}
|
}
|
||||||
// The JWK is one of the trusted keys.
|
// The JWK is one of the trusted keys.
|
||||||
return trustedKey, nil
|
return key, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := x509.VerifyOptions{
|
opts := x509.VerifyOptions{
|
||||||
|
Reference in New Issue
Block a user