Skip to content

Commit

Permalink
Also add checks for delegation certs
Browse files Browse the repository at this point in the history
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
  • Loading branch information
riyazdf committed Jul 21, 2016
1 parent fad315b commit 84b60d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tuf/tuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ func (tr *Repo) GetDelegationRole(name string) (data.DelegationRole, error) {
if err != nil {
return err
}
// Check all public key certificates in the role for expiry
// Currently we do not reject expired delegation keys but warn if they might expire soon or have already
for keyID, pubKey := range delgRole.Keys {
certFromKey, err := utils.LoadCertFromPEM(pubKey.Public())
if err != nil {
continue
}
if err := utils.ValidateCertificate(certFromKey, true); err != nil {
logrus.Warnf("error with delegation %s key ID %d: %s", delgRole.Name, keyID, err)
}
}
foundRole = &delgRole
return StopWalk{}
}
Expand Down

0 comments on commit 84b60d2

Please sign in to comment.