pvl.login.pubtkt: ExpiredError is not a VerifyError, and use valid()
authorTero Marttila <terom@paivola.fi>
Tue, 14 Jan 2014 21:02:39 +0200
changeset 371 8c17eb11858f
parent 370 184917c7d4d4
child 372 24e6c32c488f
pvl.login.pubtkt: ExpiredError is not a VerifyError, and use valid()
pvl/login/pubtkt.py
--- a/pvl/login/pubtkt.py	Mon Jan 13 22:21:42 2014 +0200
+++ b/pvl/login/pubtkt.py	Tue Jan 14 21:02:39 2014 +0200
@@ -42,7 +42,7 @@
         self.pubtkt = pubtkt
         self.error = error
 
-class ExpiredError (VerifyError) :
+class ExpiredError (Error) :
     """
         Login token has expired
     """
@@ -96,11 +96,10 @@
         except M2Crypto.RSA.RSAError as ex :
             raise VerifyError(pubtkt, str(ex))
         
-        now = cls.now()
 
-        log.debug("validating %s < %s", pubtkt.validuntil, now)
-
-        if pubtkt.validuntil < now :
+        log.debug("checking expiry %s", pubtkt.validuntil)
+        
+        if not pubtkt.valid() :
             raise ExpiredError(pubtkt, pubtkt.validuntil)
 
         return pubtkt