From c196097c63fd94404943c61130747d31b8aeee41 Mon Sep 17 00:00:00 2001 From: tpazderka Date: Mon, 23 Jun 2014 17:41:51 +0200 Subject: [PATCH 1/2] Fixed set_cookie max-age parsing Max-age is expected to be in seconds and thus cannot be parsed by _since_epoch. Expire attribute is calculated from now() and max-age --- src/saml2/httpbase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/saml2/httpbase.py b/src/saml2/httpbase.py index 56d4a7e..eeb0a56 100644 --- a/src/saml2/httpbase.py +++ b/src/saml2/httpbase.py @@ -177,7 +177,7 @@ class HTTPBase(object): std_attr[attr] = morsel[attr] elif attr == "max-age": if morsel["max-age"]: - std_attr["expires"] = _since_epoch(morsel["max-age"]) + std_attr["expires"] = time.time() + int(morsel["max-age"]) for att, item in PAIRS.items(): if std_attr[att]: From 1dd2f92e59cd6094665b45fe2658131c307e6a45 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 24 Aug 2014 23:02:11 -0500 Subject: [PATCH 2/2] Update request.py --- src/saml2/request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/saml2/request.py b/src/saml2/request.py index e834808..f840db1 100644 --- a/src/saml2/request.py +++ b/src/saml2/request.py @@ -75,7 +75,7 @@ class Request(object): def _verify(self): assert self.message.version == "2.0" - if self.message.destination and \ + if self.message.destination and self.receiver_addrs and \ self.message.destination not in self.receiver_addrs: logger.error("%s not in %s" % (self.message.destination, self.receiver_addrs))