From 645550dd952370cf4f75b7445ec1b6d5c4473f5b Mon Sep 17 00:00:00 2001 From: EAimTY Date: Sun, 5 Feb 2023 22:02:50 +0900 Subject: [PATCH] not taking ownership of `KeyingMaterialExporter` --- tuic/Cargo.toml | 2 +- tuic/src/model/authenticate.rs | 4 ++-- tuic/src/model/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tuic/Cargo.toml b/tuic/Cargo.toml index 3ccc9c8..2b999b5 100644 --- a/tuic/Cargo.toml +++ b/tuic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuic" -version = "5.0.0-pre-alpha5" +version = "5.0.0-pre-alpha6" authors = ["EAimTY "] description = "Delicately-TUICed 0-RTT proxy protocol" categories = ["network-programming"] diff --git a/tuic/src/model/authenticate.rs b/tuic/src/model/authenticate.rs index 2c0f6a9..14d0ce6 100644 --- a/tuic/src/model/authenticate.rs +++ b/tuic/src/model/authenticate.rs @@ -17,7 +17,7 @@ impl Authenticate { pub(super) fn new( uuid: Uuid, password: impl AsRef<[u8]>, - exporter: impl KeyingMaterialExporter, + exporter: &impl KeyingMaterialExporter, ) -> Self { Self { inner: Side::Tx(Tx { @@ -75,7 +75,7 @@ impl Authenticate { pub fn is_valid( &self, password: impl AsRef<[u8]>, - exporter: impl KeyingMaterialExporter, + exporter: &impl KeyingMaterialExporter, ) -> bool { let Side::Rx(rx) = &self.inner else { unreachable!() }; rx.token == exporter.export_keying_material(rx.uuid.as_ref(), password.as_ref()) diff --git a/tuic/src/model/mod.rs b/tuic/src/model/mod.rs index e928d0c..e0db0c2 100644 --- a/tuic/src/model/mod.rs +++ b/tuic/src/model/mod.rs @@ -62,7 +62,7 @@ where &self, uuid: Uuid, password: impl AsRef<[u8]>, - exporter: impl KeyingMaterialExporter, + exporter: &impl KeyingMaterialExporter, ) -> Authenticate { Authenticate::::new(uuid, password, exporter) }