@@ -1369,6 +1369,15 @@ def _check_signature(self, decoded_xml, item, node_name=NODE_NAME,
1369
1369
1370
1370
def check_signature (self , item , node_name = NODE_NAME , origdoc = None ,
1371
1371
id_attr = "" , must = False ):
1372
+ """
1373
+
1374
+ :param item: Parsed entity
1375
+ :param node_name:
1376
+ :param origdoc: The original XML string
1377
+ :param id_attr:
1378
+ :param must:
1379
+ :return:
1380
+ """
1372
1381
return self ._check_signature (origdoc , item , node_name , origdoc ,
1373
1382
id_attr = id_attr , must = must )
1374
1383
@@ -1521,6 +1530,8 @@ def correctly_signed_response(self, decoded_xml, must=False, origdoc=None,
1521
1530
:param decoded_xml: The SAML message as a XML string
1522
1531
:param must: Whether there must be a signature
1523
1532
:param origdoc:
1533
+ :param only_valid_cert:
1534
+ :param require_response_signature:
1524
1535
:return: None if the signature can not be verified otherwise an instance
1525
1536
"""
1526
1537
@@ -1534,25 +1545,23 @@ def correctly_signed_response(self, decoded_xml, must=False, origdoc=None,
1534
1545
elif require_response_signature :
1535
1546
raise SignatureError ("Signature missing for response" )
1536
1547
1537
- if isinstance (response , Response ) and (response .assertion or
1538
- response .encrypted_assertion ):
1539
- # Try to find the signing cert in the assertion
1540
- for assertion in (
1541
- response .assertion or response .encrypted_assertion ):
1542
- if not hasattr (assertion , 'signature' ) or not assertion .signature :
1543
- logger .debug ("unsigned" )
1544
- if must :
1545
- raise SignatureError ("Signature missing for assertion" )
1546
- continue
1547
- else :
1548
- logger .debug ("signed" )
1549
-
1550
- try :
1551
- self ._check_signature (decoded_xml , assertion ,
1552
- class_name (assertion ), origdoc )
1553
- except Exception , exc :
1554
- logger .error ("correctly_signed_response: %s" % exc )
1555
- raise
1548
+ # if isinstance(response, Response) and response.assertion:
1549
+ # # Try to find the signing cert in the assertion
1550
+ # for assertion in response.assertion:
1551
+ # if not hasattr(assertion, 'signature') or not assertion.signature:
1552
+ # logger.debug("unsigned")
1553
+ # if must:
1554
+ # raise SignatureError("Signature missing for assertion")
1555
+ # continue
1556
+ # else:
1557
+ # logger.debug("signed")
1558
+ #
1559
+ # try:
1560
+ # self._check_signature(decoded_xml, assertion,
1561
+ # class_name(assertion), origdoc)
1562
+ # except Exception, exc:
1563
+ # logger.error("correctly_signed_response: %s" % exc)
1564
+ # raise
1556
1565
1557
1566
return response
1558
1567
0 commit comments