Merge branch 'update-dependencies' into 'master'

Update dependencies

See merge request !6
This commit is contained in:
lumi 2017-05-05 01:04:04 +00:00
commit f3b9984ff2
4 changed files with 15 additions and 17 deletions

View file

@ -15,12 +15,12 @@ license = "LGPL-3.0+"
gitlab = { repository = "lumi/xmpp-rs" } gitlab = { repository = "lumi/xmpp-rs" }
[dependencies] [dependencies]
xml-rs = "0.3.6" xml-rs = "0.4.1"
openssl = "0.9.7" openssl = "0.9.7"
base64 = "0.4.0" base64 = "0.5.2"
minidom = "0.2.0" minidom = "0.3.0"
jid = "0.2.0" jid = "0.2.0"
sasl = "0.3.0" sasl = "0.4.0"
sha-1 = "0.3.2" sha-1 = "0.3.2"
[features] [features]

View file

@ -5,12 +5,10 @@ use ns;
use plugin::{Plugin, PluginProxyBinding}; use plugin::{Plugin, PluginProxyBinding};
use event::AbstractEvent; use event::AbstractEvent;
use connection::{Connection, C2S}; use connection::{Connection, C2S};
use sasl::{ Mechanism as SaslMechanism use sasl::client::Mechanism as SaslMechanism;
, Credentials as SaslCredentials use sasl::client::mechanisms::{Plain, Scram};
, Secret as SaslSecret use sasl::common::{Credentials as SaslCredentials, Identity, Secret, ChannelBinding};
, ChannelBinding use sasl::common::scram::{Sha1, Sha256};
};
use sasl::mechanisms::{Plain, Scram, Sha1, Sha256};
use components::sasl_error::SaslError; use components::sasl_error::SaslError;
use util::FromElement; use util::FromElement;
@ -64,8 +62,8 @@ impl ClientBuilder {
/// Sets the password to use. /// Sets the password to use.
pub fn password<P: Into<String>>(mut self, password: P) -> ClientBuilder { pub fn password<P: Into<String>>(mut self, password: P) -> ClientBuilder {
self.credentials = SaslCredentials { self.credentials = SaslCredentials {
username: Some(self.jid.node.clone().expect("JID has no node")), identity: Identity::Username(self.jid.node.clone().expect("JID has no node")),
secret: SaslSecret::Password(password.into()), secret: Secret::password_plain(password),
channel_binding: ChannelBinding::None, channel_binding: ChannelBinding::None,
}; };
self self

View file

@ -14,7 +14,7 @@ use xml::writer::Error as EmitterError;
use minidom::Error as MinidomError; use minidom::Error as MinidomError;
use base64::Base64Error; use base64::DecodeError;
use components::sasl_error::SaslError; use components::sasl_error::SaslError;
@ -27,7 +27,7 @@ pub enum Error {
HandshakeError(HandshakeError<TcpStream>), HandshakeError(HandshakeError<TcpStream>),
OpenSslErrorStack(ErrorStack), OpenSslErrorStack(ErrorStack),
MinidomError(MinidomError), MinidomError(MinidomError),
Base64Error(Base64Error), Base64Error(DecodeError),
SaslError(Option<String>), SaslError(Option<String>),
XmppSaslError(SaslError), XmppSaslError(SaslError),
FormatError(FormatError), FormatError(FormatError),
@ -71,8 +71,8 @@ impl From<MinidomError> for Error {
} }
} }
impl From<Base64Error> for Error { impl From<DecodeError> for Error {
fn from(err: Base64Error) -> Error { fn from(err: DecodeError) -> Error {
Error::Base64Error(err) Error::Base64Error(err)
} }
} }

View file

@ -20,7 +20,7 @@ use error::Error;
#[allow(unused_imports)] #[allow(unused_imports)]
use openssl::ssl::{SslMethod, Ssl, SslContextBuilder, SslStream, SSL_VERIFY_NONE, SslConnectorBuilder}; 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. /// A trait which transports are required to implement.
pub trait Transport { pub trait Transport {