File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1385,7 +1385,7 @@ def _verify_root_self_signed(self, signable):
1385
1385
signatures = signable ['signatures' ]
1386
1386
signed = securesystemslib .formats .encode_canonical (
1387
1387
signable ['signed' ]).encode ('utf-8' )
1388
- verified_sig_keyids = []
1388
+ verified_sig_keyids = set ()
1389
1389
1390
1390
for signature in signatures :
1391
1391
keyid = signature ['keyid' ]
@@ -1403,12 +1403,9 @@ def _verify_root_self_signed(self, signable):
1403
1403
valid_sig = securesystemslib .keys .verify_signature (key , signature , signed )
1404
1404
1405
1405
if valid_sig :
1406
- verified_sig_keyids .append (keyid )
1406
+ verified_sig_keyids .add (keyid )
1407
1407
1408
- # A signature with a given keyid should only count towards the threshold
1409
- # once. Convert the list of keyids into a set, in order to uniquify them
1410
- # and therefore count each keyid only once towards the threshold.
1411
- if len (set (verified_sig_keyids )) >= threshold :
1408
+ if len (verified_sig_keyids ) >= threshold :
1412
1409
return True
1413
1410
return False
1414
1411
You can’t perform that action at this time.
0 commit comments