From 521bf6e7d776e0c1b6454021c9f401ae2806cecf Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 26 Dec 2020 20:11:23 +0100 Subject: [PATCH] tokio-xmpp: Bump sasl to 0.5 --- tokio-xmpp/Cargo.toml | 2 +- tokio-xmpp/src/client/auth.rs | 2 +- tokio-xmpp/src/error.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tokio-xmpp/Cargo.toml b/tokio-xmpp/Cargo.toml index 6ab11d8d10b1ddca228f00f16060f6cbd71bd0d0..021070b19daf2bed7fb223f5700f585aaed95708 100644 --- a/tokio-xmpp/Cargo.toml +++ b/tokio-xmpp/Cargo.toml @@ -17,7 +17,7 @@ futures = "0.3" idna = "0.2" log = "0.4" native-tls = "0.2" -sasl = "0.4" +sasl = "0.5" tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] } tokio-util = { version = "0.6", features = ["codec"] } tokio-stream = { version = "0.1", features = [] } diff --git a/tokio-xmpp/src/client/auth.rs b/tokio-xmpp/src/client/auth.rs index 165f0559a26a09d3b8cfd1716e676532cd1afe70..a5560a9c765adbb2973b7059276313dc44771183 100644 --- a/tokio-xmpp/src/client/auth.rs +++ b/tokio-xmpp/src/client/auth.rs @@ -29,7 +29,7 @@ pub async fn auth( for local_mech in local_mechs { let mut mechanism = local_mech(); if remote_mechs.contains(mechanism.name()) { - let initial = mechanism.initial().map_err(AuthError::Sasl)?; + let initial = mechanism.initial(); let mechanism_name = XMPPMechanism::from_str(mechanism.name()).map_err(ProtocolError::Parsers)?; diff --git a/tokio-xmpp/src/error.rs b/tokio-xmpp/src/error.rs index efde29ecddfbcdd5bdcb748d7a113dde2096874f..7a03037ec7a100f638731099e667fe0d1772230b 100644 --- a/tokio-xmpp/src/error.rs +++ b/tokio-xmpp/src/error.rs @@ -1,4 +1,5 @@ use native_tls::Error as TlsError; +use sasl::client::MechanismError as SaslMechanismError; use std::borrow::Cow; use std::error::Error as StdError; use std::fmt; @@ -199,7 +200,7 @@ pub enum AuthError { /// No matching SASL mechanism available NoMechanism, /// Local SASL implementation error - Sasl(String), + Sasl(SaslMechanismError), /// Failure from server Fail(SaslDefinedCondition), /// Component authentication failure