summaryrefslogtreecommitdiff
path: root/src/saml2/entity.py
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2019-09-01 21:17:01 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2019-11-26 14:02:27 +0200
commit2109a65b1a233d42da84cc2aad982bf8a4b49816 (patch)
treeb7b265b89e013f90be80502fabddefc74e761a04 /src/saml2/entity.py
parent2a0dda1beeeb1b5d7f6fa31b628306ae8146996a (diff)
downloadpysaml2-2109a65b1a233d42da84cc2aad982bf8a4b49816.tar.gz
Read from env var PYSAML2_DELETE_TMPFILES
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'src/saml2/entity.py')
-rw-r--r--src/saml2/entity.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py
index 0e2cc94c..f76ae67d 100644
--- a/src/saml2/entity.py
+++ b/src/saml2/entity.py
@@ -144,8 +144,8 @@ class Entity(HTTPBase):
if _val.startswith("http"):
r = requests.request("GET", _val)
if r.status_code == 200:
- _, filename = make_temp(r.text, ".pem", False)
- setattr(self.config, item, filename)
+ tmp = make_temp(r.text, ".pem", False)
+ setattr(self.config, item, tmp.name)
else:
raise Exception(
"Could not fetch certificate from %s" % _val)
@@ -560,8 +560,8 @@ class Entity(HTTPBase):
_cert = "%s%s" % (begin_cert, _cert)
if end_cert not in _cert:
_cert = "%s%s" % (_cert, end_cert)
- _, cert_file = make_temp(_cert.encode('ascii'), decode=False)
- response = self.sec.encrypt_assertion(response, cert_file,
+ tmp = make_temp(_cert.encode('ascii'), decode=False)
+ response = self.sec.encrypt_assertion(response, tmp.name,
pre_encryption_part(),
node_xpath=node_xpath)
return response