not taking ownership of KeyingMaterialExporter
This commit is contained in:
parent
e5d3c50c2d
commit
645550dd95
@ -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"]
|
||||
|
@ -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())
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user