summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-02-11 17:10:15 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-02-11 17:19:52 +0100
commitd7b10e952b964d363527e94d49fa057902d21672 (patch)
tree532aad22f65bad7ca79c80fdbb897b288ba0acfb /tool
parentab70e971c2e858869af40dafc7952da6d793775d (diff)
sq: Don't round-down validity periods.
- This seems very surprising.
Diffstat (limited to 'tool')
-rw-r--r--tool/src/commands/key.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/tool/src/commands/key.rs b/tool/src/commands/key.rs
index ae647c6c..bf12c04a 100644
--- a/tool/src/commands/key.rs
+++ b/tool/src/commands/key.rs
@@ -184,15 +184,6 @@ pub fn generate(m: &ArgMatches, force: bool) -> failure::Fallible<()> {
}
fn parse_duration(expiry: &str) -> failure::Fallible<Duration> {
- let even_off = |s| {
- if s < 7 * SECONDS_IN_DAY {
- // Don't round down, too small.
- s
- } else {
- s - (s % SECONDS_IN_DAY)
- }
- };
-
let mut expiry = expiry.chars().peekable();
let _ = expiry.by_ref()
@@ -251,5 +242,5 @@ fn parse_duration(expiry: &str) -> failure::Fallible<Duration> {
junk, count, factor));
}
- Ok(Duration::new(even_off(count * factor), 0))
+ Ok(Duration::new(count * factor, 0))
}