tokio-xmpp: Bump sasl to 0.5

This commit is contained in:
Emmanuel Gil Peyrot 2020-12-26 20:11:23 +01:00
parent 059321f89a
commit 521bf6e7d7
3 changed files with 4 additions and 3 deletions

View file

@ -17,7 +17,7 @@ futures = "0.3"
idna = "0.2" idna = "0.2"
log = "0.4" log = "0.4"
native-tls = "0.2" native-tls = "0.2"
sasl = "0.4" sasl = "0.5"
tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] } tokio = { version = "1", features = ["net", "rt", "rt-multi-thread", "macros"] }
tokio-util = { version = "0.6", features = ["codec"] } tokio-util = { version = "0.6", features = ["codec"] }
tokio-stream = { version = "0.1", features = [] } tokio-stream = { version = "0.1", features = [] }

View file

@ -29,7 +29,7 @@ pub async fn auth<S: AsyncRead + AsyncWrite + Unpin>(
for local_mech in local_mechs { for local_mech in local_mechs {
let mut mechanism = local_mech(); let mut mechanism = local_mech();
if remote_mechs.contains(mechanism.name()) { if remote_mechs.contains(mechanism.name()) {
let initial = mechanism.initial().map_err(AuthError::Sasl)?; let initial = mechanism.initial();
let mechanism_name = let mechanism_name =
XMPPMechanism::from_str(mechanism.name()).map_err(ProtocolError::Parsers)?; XMPPMechanism::from_str(mechanism.name()).map_err(ProtocolError::Parsers)?;

View file

@ -1,4 +1,5 @@
use native_tls::Error as TlsError; use native_tls::Error as TlsError;
use sasl::client::MechanismError as SaslMechanismError;
use std::borrow::Cow; use std::borrow::Cow;
use std::error::Error as StdError; use std::error::Error as StdError;
use std::fmt; use std::fmt;
@ -199,7 +200,7 @@ pub enum AuthError {
/// No matching SASL mechanism available /// No matching SASL mechanism available
NoMechanism, NoMechanism,
/// Local SASL implementation error /// Local SASL implementation error
Sasl(String), Sasl(SaslMechanismError),
/// Failure from server /// Failure from server
Fail(SaslDefinedCondition), Fail(SaslDefinedCondition),
/// Component authentication failure /// Component authentication failure