Blame SOURCES/BZ-1778784-check-for-revoked-subkeys-before-checking-the-signature.patch

582920
From f8616a2d6e22705371fe6ba47597238d3d1dc2f1 Mon Sep 17 00:00:00 2001
582920
From: Pavla Kratochvilova <pkratoch@redhat.com>
582920
Date: Fri, 3 Apr 2020 07:59:38 +0200
582920
Subject: [PATCH] Check for revoked subkeys before checking the signature. BZ 1778784
582920
582920
The reverse order resulted in error "Invalid GPG Key from
582920
<path to GPG key>: signature 9 doesn't bind subkey to key, type is
582920
subkey revocation" when the package was signed with a GPG key
582920
with revoked subkey.
582920
---
582920
 yum/pgpmsg.py | 12 ++++++------
582920
 1 file changed, 6 insertions(+), 6 deletions(-)
582920
582920
diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
582920
index d3d30a1..1b7698b 100644
582920
--- a/yum/pgpmsg.py
582920
+++ b/yum/pgpmsg.py
582920
@@ -1074,21 +1074,21 @@ be scanned to make sure they are valid for a pgp certificate."""
582920
                     pkt_idx = pkt_idx + 1
582920
                     is_revoked = 0
582920
 
582920
+                    # there may optionally be a revocation
582920
+                    if pkt_idx < len(pkts) and pkts[pkt_idx].pkt_typ == CTB_PKT_SIG and pkts[pkt_idx].sig_type == SIG_TYPE_SUBKEY_REVOKE :
582920
+                        is_revoked = 1
582920
+                        subkey.append(pkts[pkt_idx])
582920
+                        pkt_idx = pkt_idx + 1
582920
+
582920
                     # there must be one signature following the subkey that binds it to the main key
582920
                     if pkt_idx >= len(pkts) :
582920
                         raise ValueError('subkey at index %d was not followed by a signature' % (pkt_idx-1))
582920
                     if pkts[pkt_idx].pkt_typ != CTB_PKT_SIG or pkts[pkt_idx].sig_type != SIG_TYPE_SUBKEY_BIND :
582920
                         raise ValueError('signature %d doesn\'t bind subkey to key, type is %s' % (pkt_idx, map_to_str(sig_type_to_str, pkts[pkt_idx].sig_type)))
582920
                     subkey.append(pkts[pkt_idx])
582920
 
582920
                     pkt_idx = pkt_idx + 1
582920
 
582920
-                    # there may optionally be a revocation
582920
-                    if pkt_idx < len(pkts) and pkts[pkt_idx].pkt_typ == CTB_PKT_SIG and pkts[pkt_idx].sig_type == SIG_TYPE_SUBKEY_REVOKE :
582920
-                        is_revoked = 1
582920
-                        subkey.append(pkts[pkt_idx])
582920
-                        pkt_idx = pkt_idx + 1
582920
-
582920
                     # append the user ID and signature(s) onto the list
582920
                     if is_revoked :
582920
                         self.rvkd_subkeys.append(subkey)
582920
--
582920
libgit2 0.28.5
582920