summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-12-03 12:24:25 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-12-03 12:24:25 +0100
commitc0c2c235d0d90c7a56b763b08fa8c909aa389c82 (patch)
treed1231feeab301b23bf14848f405e34114e4fe47a /openpgp/src/parse
parent3cb87c45a2a43fc85f5be4fed5e914fd4c15557c (diff)
openpgp: Convert uses of Time::from_pgp.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/parse.rs5
-rw-r--r--openpgp/src/parse/stream.rs5
2 files changed, 4 insertions, 6 deletions
diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs
index b49f5139..4776ba0a 100644
--- a/openpgp/src/parse/parse.rs
+++ b/openpgp/src/parse/parse.rs
@@ -36,7 +36,6 @@ use crate::types::{
SymmetricAlgorithm,
Timestamp,
};
-use crate::conversions::Time;
use crate::crypto::{self, mpis::{PublicKey, MPI}};
use crate::crypto::symmetric::{Decryptor, BufferedReaderDecryptor};
use crate::message;
@@ -1530,7 +1529,7 @@ impl Key4<key::UnspecifiedParts, key::UnspecifiedRole>
-> Result<Key4<key::PublicParts, R>>
where R: key::KeyRole
{
- Key4::new(std::time::SystemTime::from_pgp(creation_time),
+ Key4::new(Timestamp::from(creation_time),
pk_algo, mpis)
}
fn s<R>(creation_time: u32,
@@ -1540,7 +1539,7 @@ impl Key4<key::UnspecifiedParts, key::UnspecifiedRole>
-> Result<Key4<key::SecretParts, R>>
where R: key::KeyRole
{
- Key4::with_secret(std::time::SystemTime::from_pgp(creation_time),
+ Key4::with_secret(Timestamp::from(creation_time),
pk_algo, mpis, secret)
}
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 7f0e5196..c272078d 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -1887,8 +1887,6 @@ mod test {
// This test is relatively long running in debug mode. Split it
// up.
fn detached_verifier_read_size(l: usize) {
- use crate::conversions::Time;
-
struct Test<'a> {
sig: &'a [u8],
content: &'a [u8],
@@ -1905,7 +1903,8 @@ mod test {
sig: crate::tests::message(
"emmelie-dorothea-dina-samantha-awina-detached-signature-of-100MB-of-zeros.sig"),
content: &vec![ 0; 100 * 1024 * 1024 ][..],
- reference: time::SystemTime::from_pgp(1572602018),
+ reference:
+ crate::types::Timestamp::try_from(1572602018).unwrap().into(),
},
];