]> git.decadent.org.uk Git - dak.git/commitdiff
key expire
authorJoerg Jaspert <joerg@debian.org>
Sat, 21 Feb 2009 11:13:02 +0000 (12:13 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sat, 21 Feb 2009 11:13:02 +0000 (12:13 +0100)
catch a case where the key is expired and no not-expired-subkey is
used to sign the .changes, ie. no GOODSIG token available. The
timestamp we get back from the command is unixtime, but type string,
so we should cast it to float or time.gmtime will complain.

And if that doesnt work, for whatever reason, issue a more generic
reject message.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
daklib/utils.py

index cb5df31ce30fd77e2c086c6266209720fbffec88..b20a063a452d4e9d1354f8e4a19c519205855295 100755 (executable)
@@ -1345,7 +1345,10 @@ def check_signature (sig_filename, reject, data_filename="", keyrings=None, auto
         if len(args) >= 1:
             timestamp = args[0]
             if timestamp.count("T") == 0:
-                expiredate = time.strftime("%Y-%m-%d", time.gmtime(timestamp))
+                try:
+                    expiredate = time.strftime("%Y-%m-%d", time.gmtime(float(timestamp)))
+                except ValueError:
+                    expiredate = "unknown (%s)" % (timestamp)
             else:
                 expiredate = timestamp
         reject("The key used to sign %s has expired on %s" % (sig_filename, expiredate))