summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Scholle <Julian.scholle@googlemail.com>2017-10-06 22:28:21 +0200
committerLauris BH <lauris@nix.lv>2017-10-06 23:28:21 +0300
commit92123fe82a2dc4c01fdc180baaa7d2bfa2fe971a (patch)
treeb6426181e2d15c5c81ee18900f0bc3d697350a87
parentffab139c9193a70ed76d83a4655e82c74af52b25 (diff)
downloadgitea-92123fe82a2dc4c01fdc180baaa7d2bfa2fe971a.tar.gz
gitea-92123fe82a2dc4c01fdc180baaa7d2bfa2fe971a.zip
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>
-rw-r--r--models/gpg_key.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go
index 8823ad0c95..6959f373c9 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -401,8 +401,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
}