fix: write back the generated expire-date in Simple Signer
authorFelix Dörre <felix@dogcraft.de>
Fri, 23 Jun 2017 19:19:51 +0000 (21:19 +0200)
committerFelix Dörre <felix@dogcraft.de>
Mon, 26 Jun 2017 15:51:19 +0000 (17:51 +0200)
fixes #110

Change-Id: Iee8f3a3225dbb2469e6c509440193b7f7f737449

util-testing/club/wpia/gigi/util/SimpleSigner.java

index 99feda2..5a2a5fa 100644 (file)
@@ -134,7 +134,7 @@ public class SimpleSigner {
                     getSANSs = new GigiPreparedStatement("SELECT contents, type FROM `subjectAlternativeNames` " + //
                             "WHERE `certId`=?");
 
-                    updateMail = new GigiPreparedStatement("UPDATE certs SET crt_name=?," + " created=NOW(), serial=?, caid=? WHERE id=?");
+                    updateMail = new GigiPreparedStatement("UPDATE certs SET crt_name=?," + " created=NOW(), serial=?, caid=?, expire=? WHERE id=?");
                     warnMail = new GigiPreparedStatement("UPDATE jobs SET warning=warning+1, state=CASE WHEN warning<3 THEN 'open'::`jobState` ELSE 'error'::`jobState` END WHERE id=?");
 
                     revoke = new GigiPreparedStatement("SELECT certs.id, certs.csr_name,jobs.id FROM jobs INNER JOIN certs ON jobs.`targetId`=certs.id" + " WHERE jobs.state='open' AND task='revoke'");
@@ -369,7 +369,8 @@ public class SimpleSigner {
                     updateMail.setString(1, crt.getPath());
                     updateMail.setString(2, serial.toString(16));
                     updateMail.setInt(3, caRs.getInt("id"));
-                    updateMail.setInt(4, id);
+                    updateMail.setTimestamp(4, new Timestamp(toDate.getTime()));
+                    updateMail.setInt(5, id);
                     updateMail.execute();
 
                     finishJob.setInt(1, rs.getInt("jobid"));