From 828269773470eb0e4b5251163744fe866c1ef345 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 17 Aug 2020 17:06:31 +0100 Subject: [PATCH] Keys should not verify revoked email addresses (#12486) (#12495) Backport #12486 Fix #6778 Signed-off-by: Andrew Thornton Co-authored-by: Lunny Xiao --- models/gpg_key.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/gpg_key.go b/models/gpg_key.go index 309d914bbc7..8897bba56b8 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 {