diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2019-07-10 11:36:26 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2019-07-10 11:36:26 +0300 |
commit | ffce19a9ec71a6753673f84535f16003f38eb214 (patch) | |
tree | 97ae4bd840814a259a3191c9452f288ec21fd6d2 /src/tools | |
parent | 5303dbe6249ed4b1e268f7a5c41ed6a638c4d0e3 (diff) | |
download | tor-ffce19a9ec71a6753673f84535f16003f38eb214.tar.gz tor-ffce19a9ec71a6753673f84535f16003f38eb214.zip |
Make tor-print-ed-signing-cert output RFC1123 and unix timestamps as well
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/tor-print-ed-signing-cert.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/tor-print-ed-signing-cert.c b/src/tools/tor-print-ed-signing-cert.c index 1f1a01ab5c..43a1d7bcbd 100644 --- a/src/tools/tor-print-ed-signing-cert.c +++ b/src/tools/tor-print-ed-signing-cert.c @@ -10,11 +10,13 @@ #include "lib/cc/torint.h" /* TOR_PRIdSZ */ #include "lib/crypt_ops/crypto_format.h" #include "lib/malloc/malloc.h" +#include "lib/encoding/time_fmt.h" int main(int argc, char **argv) { ed25519_cert_t *cert = NULL; + char rfc1123_buf[RFC1123_TIME_LEN+1] = ""; if (argc != 2) { fprintf(stderr, "Usage:\n"); @@ -59,6 +61,11 @@ main(int argc, char **argv) printf("Expires at: %s", ctime(&expires_at)); + format_rfc1123_time(rfc1123_buf, expires_at); + printf("RFC 1123 timestamp: %s\n", rfc1123_buf); + + printf("UNIX timestamp: %ld\n", (long int)expires_at); + ed25519_cert_free(cert); return 0; |