summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-01-08 10:10:58 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-01-08 10:23:23 +0100
commit5b0b546ce73cc3a2bfed085726c43635d5519924 (patch)
tree4747952e3ee06339f95ec571681e62d21168d3d0 /openpgp/src/parse
parentf10ceaa4ac04dcafe0bce42eb4fed3832225b594 (diff)
openpgp: Include a reference time in KeyAmalgamation.
- Including the reference time in the KeyAmalgamation structure rather than having the user supply it to the individual methods (like `KeyAmalgamation::alive`) helps ensure that the key is used consistent. For instance, this makes it harder to mistakenly query key's liveness at time t, but then use the current time to determine the key's capabilities.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/stream.rs16
1 files changed, 0 insertions, 16 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index fda80f62..3926299f 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -178,9 +178,6 @@ pub enum VerificationResult<'a> {
/// The signing key that made the signature.
ka: KeyAmalgamation<'a, key::PublicParts>,
-
- /// The time at which the signature is evaluated.
- time: time::SystemTime,
},
/// The signature is good, but it is not alive at the specified
@@ -197,9 +194,6 @@ pub enum VerificationResult<'a> {
/// The signing key that made the signature.
ka: KeyAmalgamation<'a, key::PublicParts>,
-
- /// The time at which the signature is evaluated.
- time: time::SystemTime,
},
/// Unable to verify the signature because the key is missing.
@@ -218,9 +212,6 @@ pub enum VerificationResult<'a> {
/// The signing key that made the signature.
ka: KeyAmalgamation<'a, key::PublicParts>,
-
- /// The time at which the signature is evaluated.
- time: time::SystemTime,
},
}
@@ -699,20 +690,17 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
VerificationResult::GoodChecksum {
sig: sig.clone(),
cert, ka,
- time: self.time,
}
} else {
VerificationResult::NotAlive {
sig: sig.clone(),
cert, ka,
- time: self.time,
}
}
} else {
VerificationResult::BadChecksum {
sig: sig.clone(),
cert, ka,
- time: self.time,
}
}
);
@@ -1609,14 +1597,12 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
{
sig: sig.clone(),
cert, ka,
- time: self.time,
}
} else {
VerificationResult::GoodChecksum
{
sig: sig.clone(),
cert, ka,
- time: self.time,
}
}
} else {
@@ -1624,14 +1610,12 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
VerificationResult::GoodChecksum {
sig: sig.clone(),
cert, ka,
- time: self.time,
}
}
} else {
VerificationResult::BadChecksum {
sig: sig.clone(),
cert, ka,
- time: self.time,
}
}
);