diff options
author | zeripath <art27@cantab.net> | 2020-08-17 17:06:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-17 12:06:31 -0400 |
commit | 828269773470eb0e4b5251163744fe866c1ef345 (patch) | |
tree | a23ede4cdc3d8a346da230955ad758f5630cf32e /models | |
parent | ec48618d40c12cc14e902062f6393ebeb9b0e365 (diff) | |
download | gitea-828269773470eb0e4b5251163744fe866c1ef345.tar.gz gitea-828269773470eb0e4b5251163744fe866c1ef345.zip |
Keys should not verify revoked email addresses (#12486) (#12495)
Backport #12486
Fix #6778
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'models')
-rw-r--r-- | models/gpg_key.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go index 309d914bbc..8897bba56b 100644 --- a/models/gpg_key.go +++ b/models/gpg_key.go @@ -286,6 +286,9 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) { emails := make([]*EmailAddress, 0, len(e.Identities)) for _, ident := range e.Identities { + if ident.Revocation != nil { + continue + } email := strings.ToLower(strings.TrimSpace(ident.UserId.Email)) for _, e := range userEmails { if e.Email == email { |