Browse Source

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>
Julian Scholle 1 year ago
parent
commit
92123fe82a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      models/gpg_key.go

+ 2 - 1
models/gpg_key.go

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