Skip to content

Commit

Permalink
Perform case-insensitive comparison of the Common Name to the GUN in …
Browse files Browse the repository at this point in the history
…x509 certificate validation

Signed-off-by: Stefan Zhelyazkov <stefan.zhelyazkov@gmail.com>
  • Loading branch information
stefan-zh committed Nov 23, 2021
1 parent 1062e48 commit 2c99de2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trustpinning/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func MatchCNToGun(commonName string, gun data.GUN) bool {
logrus.Debugf("checking gun %s against wildcard prefix %s", gun, prefix)
return strings.HasPrefix(gun.String(), prefix)
}
return commonName == gun.String()
return strings.EqualFold(commonName, gun.String())
}

// validRootLeafCerts returns a list of possibly (if checkExpiry is true) non-expired, non-sha1 certificates
Expand Down

0 comments on commit 2c99de2

Please sign in to comment.