GPG key email verification no longer case sensitive (#2661) (#2663)

* GPG key email verification no longer case sensitive (#2661)

* case insensitive GPG key email verification now cached (#2661)

Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
release/v1.15
Julian Scholle 2017-10-06 22:28:21 +02:00 committed by Lauris BH
parent ffab139c91
commit 92123fe82a
1 changed files with 2 additions and 1 deletions

View File

@ -401,8 +401,9 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
for _, k := range keys { for _, k := range keys {
//Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate //Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate
canValidate := false canValidate := false
lowerCommiterEmail := strings.ToLower(c.Committer.Email)
for _, e := range k.Emails { for _, e := range k.Emails {
if e.IsActivated && e.Email == c.Committer.Email { if e.IsActivated && strings.ToLower(e.Email) == lowerCommiterEmail {
canValidate = true canValidate = true
break break
} }