Skip to content

Commit dcf5b53

Browse files
author
Roland Hedberg
committed
Signature verification failure should be handled as an error.
1 parent ede428a commit dcf5b53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/saml2/entity.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from saml2 import class_name
5050
from saml2.config import config_factory
5151
from saml2.httpbase import HTTPBase
52-
from saml2.sigver import security_context, response_factory
52+
from saml2.sigver import security_context, response_factory, SignatureError
5353
from saml2.sigver import pre_signature_part
5454
from saml2.sigver import signed_instance_factory
5555
from saml2.virtual_org import VirtualOrg
@@ -794,6 +794,9 @@ def _parse_response(self, xmlstr, response_cls, service, binding, **kwargs):
794794

795795
try:
796796
response = response.loads(xmlstr, False)
797+
except SignatureError, err:
798+
logger.error("Signature Error: %s" % err)
799+
return None
797800
except Exception, err:
798801
if "not well-formed" in "%s" % err:
799802
logger.error("Not well-formed XML")

0 commit comments

Comments
 (0)