From b8fda8ea6a41cf48807f52fd9cf97cf91d3fcbb4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 30 Apr 2017 02:04:11 +0100 Subject: [PATCH 1/3] update to the latest base64 --- Cargo.toml | 2 +- src/error.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3a8c073ea80236ea5cbd39a24b6349bf18a69b93..66090bc1780ede651079319ec7911c776d38f6e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ gitlab = { repository = "lumi/xmpp-rs" } [dependencies] xml-rs = "0.3.6" openssl = "0.9.7" -base64 = "0.4.0" +base64 = "0.5.2" minidom = "0.2.0" jid = "0.2.0" sasl = "0.3.0" diff --git a/src/error.rs b/src/error.rs index 036fbe90fa8e24837922dfca1a63b1b4ac89477a..f27e94ed70af2556c07bc3e085208a1adb103155 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,7 +14,7 @@ use xml::writer::Error as EmitterError; use minidom::Error as MinidomError; -use base64::Base64Error; +use base64::DecodeError; use components::sasl_error::SaslError; @@ -27,7 +27,7 @@ pub enum Error { HandshakeError(HandshakeError), OpenSslErrorStack(ErrorStack), MinidomError(MinidomError), - Base64Error(Base64Error), + Base64Error(DecodeError), SaslError(Option), XmppSaslError(SaslError), FormatError(FormatError), @@ -71,8 +71,8 @@ impl From for Error { } } -impl From for Error { - fn from(err: Base64Error) -> Error { +impl From for Error { + fn from(err: DecodeError) -> Error { Error::Base64Error(err) } } From 31f78b9f5f3a8f0d1839c64104abd132bfee07ee Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 30 Apr 2017 02:07:12 +0100 Subject: [PATCH 2/3] update to the latest xml-rs and minidom --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 66090bc1780ede651079319ec7911c776d38f6e7..ac855fb2cd6b489e7747654080e3954a136cc4e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,10 @@ license = "LGPL-3.0+" gitlab = { repository = "lumi/xmpp-rs" } [dependencies] -xml-rs = "0.3.6" +xml-rs = "0.4.1" openssl = "0.9.7" base64 = "0.5.2" -minidom = "0.2.0" +minidom = "0.3.0" jid = "0.2.0" sasl = "0.3.0" sha-1 = "0.3.2" From 78509e25b17ba3b90950cd0893c8767df78bb935 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 4 May 2017 20:21:14 +0100 Subject: [PATCH 3/3] 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 ac855fb2cd6b489e7747654080e3954a136cc4e4..3f7be42ae53d2faf879f63e3aef241cc1efa1c2c 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 6ac357e8d0df6bc5c4bc421db503ad746f5a3594..63131564ba412375cdffd6d799e4fb1efe3a969a 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 d67c3ccf51469dc6e622ea3ddad8ce6a945be3aa..8e36cf7437e742125481b050688418d94dd01cd1 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 {