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]
name = "tuic"
version = "5.0.0-pre-alpha5"
version = "5.0.0-pre-alpha6"
authors = ["EAimTY <ea.imty@gmail.com>"]
description = "Delicately-TUICed 0-RTT proxy protocol"
categories = ["network-programming"]

View File

@ -17,7 +17,7 @@ impl Authenticate<side::Tx> {
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<side::Rx> {
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())

View File

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