From 20c6549f348dd42af2fc8e52b131c91038dcfd98 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Thu, 23 Nov 2023 15:49:54 +0000 Subject: [PATCH] AuthGraph: drop now-unused StdClock Test: build Bug: 291228560 Change-Id: Ie4bd2c7ebca1ceae07012f406c2dcbb5efbd915d --- security/authgraph/default/src/lib.rs | 29 +-------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/security/authgraph/default/src/lib.rs b/security/authgraph/default/src/lib.rs index 43d037c5ff..14741aafee 100644 --- a/security/authgraph/default/src/lib.rs +++ b/security/authgraph/default/src/lib.rs @@ -18,38 +18,11 @@ use authgraph_boringssl as boring; use authgraph_core::{ - error, - key::MillisecondsSinceEpoch, - keyexchange, + error, keyexchange, ta::{AuthGraphTa, Role}, - traits, }; use authgraph_hal::channel::SerializedChannel; use std::sync::{Arc, Mutex}; -use std::time::Instant; - -/// Monotonic clock with an epoch that starts at the point of construction. -/// (This makes it unsuitable for use outside of testing, because the epoch -/// will not match that of any other component.) -pub struct StdClock(Instant); - -impl Default for StdClock { - fn default() -> Self { - Self(Instant::now()) - } -} - -impl traits::MonotonicClock for StdClock { - fn now(&self) -> MillisecondsSinceEpoch { - let millis: i64 = self - .0 - .elapsed() - .as_millis() - .try_into() - .expect("failed to fit timestamp in i64"); - MillisecondsSinceEpoch(millis) - } -} /// Implementation of the AuthGraph TA that runs locally in-process (and which is therefore /// insecure).