From: Joerg Jaspert Date: Sat, 21 Feb 2009 11:13:02 +0000 (+0100) Subject: key expire X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b34e1454c174ccc89f552a0871fbf18e19a01264;p=dak key expire 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 --- diff --git a/daklib/utils.py b/daklib/utils.py index cb5df31c..b20a063a 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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))