1
0

not taking ownership of KeyingMaterialExporter

This commit is contained in:
EAimTY 2023-02-05 22:02:50 +09:00
parent e5d3c50c2d
commit 645550dd95
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "tuic" name = "tuic"
version = "5.0.0-pre-alpha5" version = "5.0.0-pre-alpha6"
authors = ["EAimTY <ea.imty@gmail.com>"] authors = ["EAimTY <ea.imty@gmail.com>"]
description = "Delicately-TUICed 0-RTT proxy protocol" description = "Delicately-TUICed 0-RTT proxy protocol"
categories = ["network-programming"] categories = ["network-programming"]

View File

@ -17,7 +17,7 @@ impl Authenticate<side::Tx> {
pub(super) fn new( pub(super) fn new(
uuid: Uuid, uuid: Uuid,
password: impl AsRef<[u8]>, password: impl AsRef<[u8]>,
exporter: impl KeyingMaterialExporter, exporter: &impl KeyingMaterialExporter,
) -> Self { ) -> Self {
Self { Self {
inner: Side::Tx(Tx { inner: Side::Tx(Tx {
@ -75,7 +75,7 @@ impl Authenticate<side::Rx> {
pub fn is_valid( pub fn is_valid(
&self, &self,
password: impl AsRef<[u8]>, password: impl AsRef<[u8]>,
exporter: impl KeyingMaterialExporter, exporter: &impl KeyingMaterialExporter,
) -> bool { ) -> bool {
let Side::Rx(rx) = &self.inner else { unreachable!() }; let Side::Rx(rx) = &self.inner else { unreachable!() };
rx.token == exporter.export_keying_material(rx.uuid.as_ref(), password.as_ref()) rx.token == exporter.export_keying_material(rx.uuid.as_ref(), password.as_ref())

View File

@ -62,7 +62,7 @@ where
&self, &self,
uuid: Uuid, uuid: Uuid,
password: impl AsRef<[u8]>, password: impl AsRef<[u8]>,
exporter: impl KeyingMaterialExporter, exporter: &impl KeyingMaterialExporter,
) -> Authenticate<side::Tx> { ) -> Authenticate<side::Tx> {
Authenticate::<side::Tx>::new(uuid, password, exporter) Authenticate::<side::Tx>::new(uuid, password, exporter)
} }