From 78509e25b17ba3b90950cd0893c8767df78bb935 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 4 May 2017 20:21:14 +0100 Subject: [PATCH] update to the latest sasl --- Cargo.toml | 2 +- src/client.rs | 14 ++++++-------- src/transport.rs | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ac855fb2..3f7be42a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ openssl = "0.9.7" base64 = "0.5.2" minidom = "0.3.0" jid = "0.2.0" -sasl = "0.3.0" +sasl = "0.4.0" sha-1 = "0.3.2" [features] diff --git a/src/client.rs b/src/client.rs index 6ac357e8..63131564 100644 --- a/src/client.rs +++ b/src/client.rs @@ -5,12 +5,10 @@ use ns; use plugin::{Plugin, PluginProxyBinding}; use event::AbstractEvent; use connection::{Connection, C2S}; -use sasl::{ Mechanism as SaslMechanism - , Credentials as SaslCredentials - , Secret as SaslSecret - , ChannelBinding - }; -use sasl::mechanisms::{Plain, Scram, Sha1, Sha256}; +use sasl::client::Mechanism as SaslMechanism; +use sasl::client::mechanisms::{Plain, Scram}; +use sasl::common::{Credentials as SaslCredentials, Identity, Secret, ChannelBinding}; +use sasl::common::scram::{Sha1, Sha256}; use components::sasl_error::SaslError; use util::FromElement; @@ -64,8 +62,8 @@ impl ClientBuilder { /// Sets the password to use. pub fn password>(mut self, password: P) -> ClientBuilder { self.credentials = SaslCredentials { - username: Some(self.jid.node.clone().expect("JID has no node")), - secret: SaslSecret::Password(password.into()), + identity: Identity::Username(self.jid.node.clone().expect("JID has no node")), + secret: Secret::password_plain(password), channel_binding: ChannelBinding::None, }; self diff --git a/src/transport.rs b/src/transport.rs index d67c3ccf..8e36cf74 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -20,7 +20,7 @@ use error::Error; #[allow(unused_imports)] use openssl::ssl::{SslMethod, Ssl, SslContextBuilder, SslStream, SSL_VERIFY_NONE, SslConnectorBuilder}; -use sasl::ChannelBinding; +use sasl::common::ChannelBinding; /// A trait which transports are required to implement. pub trait Transport {