Skip to content

Commit

Permalink
GPG key email verification no longer case sensitive (go-gitea#2661) (g…
Browse files Browse the repository at this point in the history
…o-gitea#2663)

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

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

Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
  • Loading branch information
CaeruleusAqua authored and sapk committed Oct 26, 2017
1 parent 10e1d3d commit 0c22cb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/gpg_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
for _, k := range keys {
//Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate
canValidate := false
lowerCommiterEmail := strings.ToLower(c.Committer.Email)
for _, e := range k.Emails {
if e.IsActivated && e.Email == c.Committer.Email {
if e.IsActivated && strings.ToLower(e.Email) == lowerCommiterEmail {
canValidate = true
break
}
Expand Down

0 comments on commit 0c22cb7

Please sign in to comment.