[Rpm-maint] [rpm-software-management/rpm] Ignore subkeys that cannot sign (PR #1938)

Panu Matilainen notifications at github.com
Thu Mar 24 11:59:24 UTC 2022


@pmatilai commented on this pull request.



> @@ -1220,10 +1234,31 @@ int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen,
 		pgpDigParamsFree(digps[count]);
 		continue;
 	    }
-	    count++;
+
+	    if (!params)
+		params = pgpDigParamsNew(0);
+
+	    if (decodePkt(p, (pend - p), &pkt) ||
+		pkt.tag != PGPTAG_SIGNATURE ||
+	        pgpPrtSig(0, pkt.body, pkt.blen, params) ||
+		params->sigtype != PGPSIGTYPE_SUBKEY_BINDING) {
+		pgpDigParamsFree(digps[count]);

The condition is on the same indentation level as the actual code block, which has quite an obfuscating effect. Please fix that, either by indenting the condition deeper (as below), placing the opening brace on a separate line or other more creative means (helper variables, functions...)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1938#pullrequestreview-920156005
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/1938/review/920156005 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220324/283df277/attachment.html>


More information about the Rpm-maint mailing list