diff --git a/saml/_version.py b/saml/_version.py index 138c06d..b47a122 100644 --- a/saml/_version.py +++ b/saml/_version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version_info__ = (0, 8, 0) +__version_info__ = (0, 9, 0) __version__ = '.'.join(map(str, __version_info__)) diff --git a/saml/schema/base.py b/saml/schema/base.py index f429eef..fbe64c6 100644 --- a/saml/schema/base.py +++ b/saml/schema/base.py @@ -446,4 +446,4 @@ def deserialize(cls, xml): @classmethod def fromstring(cls, text): - return cls.deserialized(etree.XML(text)) + return cls.deserialize(etree.XML(text)) diff --git a/saml/signature.py b/saml/signature.py index c4c388c..604874f 100644 --- a/saml/signature.py +++ b/saml/signature.py @@ -146,9 +146,12 @@ def verify(xml, stream): xmlsec.KeyFormat.PEM, xmlsec.KeyFormat.CERT_PEM]: stream.seek(0) - key = xmlsec.Key.from_memory(stream, fmt) - if key is not None: + try: + key = xmlsec.Key.from_memory(stream, fmt) break + except ValueError: + # xmlsec now throws when it can't load the key + pass # Set the key on the context. ctx.key = key