File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -263,29 +263,29 @@ def redis():
263263 return thread_data .redis
264264
265265
266- def check_signature (t : ElementTree , keys : Optional [list [str ]] = None , only_one_signature : bool = False ) -> ElementTree :
266+ def check_signature (tree : ElementTree , keys : Optional [list [str ]] = None , only_one_signature : bool = False ) -> ElementTree :
267267 if not keys :
268- return t
268+ return tree
269269
270- refs = []
270+ validated_refs = []
271271 for key in keys :
272272 log .debug (f"verifying signature using { key } " )
273273 try :
274- refs = refs + xmlsec .verified (t , key , drop_signature = True )
274+ validated_refs = validated_refs + xmlsec .verified (tree , key , drop_signature = True )
275275 except xmlsec .exceptions .XMLSigException :
276276 continue
277277
278- if not refs :
278+ if not validated_refs :
279279 raise MetadataException ("No valid signature(s) found" )
280280 else :
281- if only_one_signature and len (refs ) != 1 :
282- raise MetadataException ("XML metadata contains %d signatures - exactly 1 is required" % len (refs ))
281+ if only_one_signature and len (validated_refs ) != 1 :
282+ raise MetadataException ("XML metadata contains %d signatures - exactly 1 is required" % len (validated_refs ))
283283 # Make sure to only return one tree:
284284 # - prevent wrapping attacks
285285 # - pyff.samlmd.parse_saml_metadata doesn't handle when multiple trees are returned
286- t = refs [0 ]
286+ tree = validated_refs [0 ]
287287
288- return t
288+ return tree
289289
290290def validate_document (t ):
291291 schema ().assertValid (t )
You can’t perform that action at this time.
0 commit comments