summaryrefslogtreecommitdiffstats
path: root/models/gpg_key.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-06-17 13:56:40 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-17 18:56:40 +0800
commit1a906f800deed6d21eb8d8737c3577746ae7388b (patch)
tree74bc6c21fa03667739be89302ec2f7a79393fa5f /models/gpg_key.go
parent6678593b3c612e77707f6197ebfb9524eb9a88d7 (diff)
downloadgitea-1a906f800deed6d21eb8d8737c3577746ae7388b.tar.gz
gitea-1a906f800deed6d21eb8d8737c3577746ae7388b.zip
Fix GPG email checking to be case insensitive (#1988)
Diffstat (limited to 'models/gpg_key.go')
-rw-r--r--models/gpg_key.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go
index 6a5daf6361..5763ef8403 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -211,9 +211,9 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
emails := make([]*EmailAddress, len(e.Identities))
n := 0
for _, ident := range e.Identities {
-
+ email := strings.ToLower(strings.TrimSpace(ident.UserId.Email))
for _, e := range userEmails {
- if e.Email == ident.UserId.Email && e.IsActivated {
+ if e.Email == email && e.IsActivated {
emails[n] = e
break
}