-#! /usr/bin/tclsh8.5
+#! /usr/bin/tclsh
### -*-tcl-*-
###
### Insert a certificate request into the database.
## Check whether the profile exists.
if {![db exists {
- SELECT 1 FROM profile WHERE label = $profile;
+ SELECT 1 FROM profile WHERE label = $profile AND tombstone = 0;
}]} {
error "unknown profile `$profile'"
}
## Copy the file away.
fresh-temp "$CERTROOT/tmp" tmp {
- file copy $file $tmp
+ exec openssl req -text -in $file -out $tmp
}
cleanup { file delete $tmp }
## Issue a shiny new certificate.
issue-cert $id [now]
}
+
+## Publish any necessary changes.
+update-hook