From b34e1454c174ccc89f552a0871fbf18e19a01264 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 21 Feb 2009 12:13:02 +0100 Subject: [PATCH] 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 --- daklib/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)) -- 2.39.2