mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
AuthGraph: drop now-unused StdClock am: 20c6549f34
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2845875 Change-Id: I16e83641c7c1c9195fbd2f7b081cbe704d4d0d13 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user