From 01ce17452bc4831ea0ee2e4b479870994c1f2b6d Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 5 Jul 2011 08:07:36 -0400 Subject: [PATCH] call utcparse before exiting get_expiration istead of calling it when timestamp is compared --- sfa/trust/credential.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfa/trust/credential.py b/sfa/trust/credential.py index 5f980c97..e84b8c98 100644 --- a/sfa/trust/credential.py +++ b/sfa/trust/credential.py @@ -362,7 +362,7 @@ class Credential(object): def get_expiration(self): if not self.expiration: self.decode() - return self.expiration + return utcparse(self.expiration) ## # For legacy sake @@ -760,7 +760,7 @@ class Credential(object): return True # make sure it is not expired - if utcparse(self.get_expiration()) < datetime.datetime.utcnow(): + if self.get_expiration() < datetime.datetime.utcnow(): raise CredentialNotVerifiable("Credential expired at %s" % self.expiration.isoformat()) # Verify the signatures -- 2.43.0