summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/saml2/__init__.py2
-rw-r--r--src/saml2/sigver.py8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/saml2/__init__.py b/src/saml2/__init__.py
index db055476..c391a512 100644
--- a/src/saml2/__init__.py
+++ b/src/saml2/__init__.py
@@ -42,7 +42,7 @@ NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion'
#XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'
NAMEID_FORMAT_EMAILADDRESS = (
- "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress")
+ "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress")
# These are defined in saml2.saml
#NAME_FORMAT_UNSPECIFIED = (
diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py
index 0f2d1fbb..5a8fae6a 100644
--- a/src/saml2/sigver.py
+++ b/src/saml2/sigver.py
@@ -1132,6 +1132,7 @@ class CertHandler(object):
#This cert do not have to be valid, it is just the last cert to be
# validated.
self._last_cert_verified = None
+ self._last_validated_cert = None
if cert_type == "pem" and key_type == "pem":
self._verify_cert = verify_cert is True
self._security_context = security_context
@@ -1162,7 +1163,10 @@ class CertHandler(object):
def verify_cert(self, cert_file):
if self._verify_cert:
- cert_str = self._osw.read_str_from_file(cert_file, "pem")
+ if cert_file and os.path.isfile(cert_file):
+ cert_str = self._osw.read_str_from_file(cert_file, "pem")
+ else:
+ return False
self._last_validated_cert = cert_str
if self._cert_handler_extra_class is not None and \
self._cert_handler_extra_class.use_validate_cert_func():
@@ -1191,7 +1195,7 @@ class CertHandler(object):
else:
self._tmp_cert_str, self._tmp_key_str = self._osw\
.create_certificate(
- self._cert_info, request=True)
+ self._cert_info, request=True)
self._tmp_cert_str = self._osw.create_cert_signed_certificate(
self._cert_str, self._key_str, self._tmp_cert_str)
valid, mess = self._osw.verify(self._cert_str,