diff options
author | Galen Guyer <galen@galenguyer.com> | 2022-07-12 23:13:38 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2022-07-12 23:13:38 -0400 |
commit | afc6bf5bf802f470c427424f440f51a7dc2ec5a5 (patch) | |
tree | ffb56741e480ea11c4a08ddff030e96d3bce501e | |
parent | b3e6f24f97c4d262002a57ff7b5aea040a4c84d6 (diff) |
print original lifetime in list
-rw-r--r-- | src/lib/ops.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ops.rs b/src/lib/ops.rs index a0eac3d..27d874b 100644 --- a/src/lib/ops.rs +++ b/src/lib/ops.rs @@ -253,6 +253,7 @@ fn cert_info(crt: openssl::x509::X509) -> String { }; let cn = get_cn(&crt); + let orig = crt.not_before().diff(crt.not_after()).unwrap().days; let ex = match now.compare(crt.not_after()).unwrap() { Ordering::Greater => { match now.diff(crt.not_after()).unwrap().days { @@ -276,7 +277,7 @@ fn cert_info(crt: openssl::x509::X509) -> String { } Ordering::Equal => String::from("right now"), }; - format!("{cn} - expires {ex}") + format!("{cn} - expires {ex} (originally {orig} days)") } fn validate_key_type(input: &str) -> Result<(), String> { |