X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=a50a840f22b573dc08fd6710109d443de91dd41a;hb=7132fa99d5e9754b353c58ecd69efac9b1ff86b9;hp=47c80f3c137975468569f7b8cb354688448edfce;hpb=21779bfb08067d38a43f5af9667082a3ea8ca043;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 47c80f3c..a50a840f 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -26,6 +26,7 @@ import codecs, commands, email.Header, os, pwd, re, select, socket, shutil, \ sys, tempfile, traceback, stat import apt_pkg import database +import time from dak_exceptions import * ################################################################################ @@ -1231,11 +1232,22 @@ used.""" if keywords.has_key("NODATA"): reject("no signature found in %s." % (sig_filename)) bad = 1 + if keywords.has_key("EXPKEYSIG"): + args = keywords["EXPKEYSIG"] + if len(args) >= 1: + key = args[0] + reject("Signature made by expired key 0x%s" % (key)) + bad = 1 if keywords.has_key("KEYEXPIRED") and not keywords.has_key("GOODSIG"): args = keywords["KEYEXPIRED"] + expiredate="" if len(args) >= 1: - key = args[0] - reject("The key (0x%s) used to sign %s has expired." % (key, sig_filename)) + timestamp = args[0] + if timestamp.count("T") == 0: + expiredate = time.strftime("%Y-%m-%d", time.gmtime(timestamp)) + else: + expiredate = timestamp + reject("The key used to sign %s has expired on %s" % (sig_filename, expiredate)) bad = 1 if bad: