diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2012-04-13 00:07:30 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2012-04-13 00:07:30 +0400 |
commit | 0c36f50196c2a0220fbe27f49b06425f576360e6 (patch) | |
tree | 3a40e855bbd72489e7e6c6ac3834f637837cd35e /src/common/xmpp | |
parent | 66df7c30ca8a655a078708d3dbd0623e292a69dd (diff) | |
parent | 73899b95d3ac90ed094a2a9f7e70417c36b25d2b (diff) |
merge from trunk
Diffstat (limited to 'src/common/xmpp')
-rw-r--r-- | src/common/xmpp/auth_nb.py | 13 | ||||
-rw-r--r-- | src/common/xmpp/client_nb.py | 1 | ||||
-rw-r--r-- | src/common/xmpp/protocol.py | 1 | ||||
-rw-r--r-- | src/common/xmpp/smacks.py | 2 | ||||
-rw-r--r-- | src/common/xmpp/stringprepare.py | 2 | ||||
-rw-r--r-- | src/common/xmpp/tls_nb.py | 2 |
6 files changed, 17 insertions, 4 deletions
diff --git a/src/common/xmpp/auth_nb.py b/src/common/xmpp/auth_nb.py index 1063ed9a7..10d65abed 100644 --- a/src/common/xmpp/auth_nb.py +++ b/src/common/xmpp/auth_nb.py @@ -577,8 +577,19 @@ class NonBlockingNonSASL(PlugIn): else: log.warn("Secure methods unsupported, performing plain text \ authentication") - query.setTagData('password', self.password) self._method = 'plain' + self._owner._caller.get_password(self._on_password, self._method) + return + resp = self.owner.Dispatcher.SendAndWaitForResponse(iq, + func=self._on_auth) + + def _on_password(self, password): + self.password = '' if password is None else password + iq=Iq('set', NS_AUTH) + query = iq.getTag('query') + query.setTagData('username', self.user) + query.setTagData('resource', self.resource) + query.setTagData('password', self.password) resp = self.owner.Dispatcher.SendAndWaitForResponse(iq, func=self._on_auth) diff --git a/src/common/xmpp/client_nb.py b/src/common/xmpp/client_nb.py index 608be0fa6..97d5ec567 100644 --- a/src/common/xmpp/client_nb.py +++ b/src/common/xmpp/client_nb.py @@ -530,6 +530,7 @@ class NonBlockingClient: sm.set_owner(self) self.Dispatcher.sm = sm nb_bind.PlugIn(self) + self.on_auth(self, 'sasl') return nb_bind.PlugIn(self) diff --git a/src/common/xmpp/protocol.py b/src/common/xmpp/protocol.py index 60a17d256..e0bd794a3 100644 --- a/src/common/xmpp/protocol.py +++ b/src/common/xmpp/protocol.py @@ -41,6 +41,7 @@ NS_ARCHIVE_MANAGE = NS_ARCHIVE + ':manage' # XEP-0136 NS_ARCHIVE_MANUAL = NS_ARCHIVE + ':manual' # XEP-0136 NS_ARCHIVE_PREF = NS_ARCHIVE + ':pref' NS_ATOM = 'http://www.w3.org/2005/Atom' +NS_ATTENTION = 'urn:xmpp:attention:0' # XEP-0224 NS_AUTH = 'jabber:iq:auth' NS_AVATAR = 'http://www.xmpp.org/extensions/xep-0084.html#ns-metadata' NS_BIND = 'urn:ietf:params:xml:ns:xmpp-bind' diff --git a/src/common/xmpp/smacks.py b/src/common/xmpp/smacks.py index e59b5d1b8..d82785ac4 100644 --- a/src/common/xmpp/smacks.py +++ b/src/common/xmpp/smacks.py @@ -103,6 +103,7 @@ class Smacks(): self.uqueue.pop(0) if stanza.getName() == 'resumed': + self.enabled = True self.resuming = True self.con.set_oldst() if self.uqueue != []: @@ -114,6 +115,7 @@ class Smacks(): # Ask for service discovery, etc.. if stanza.getTag('item-not-found'): self.resuming = False + self.enabled = False # we need to bind a resource self._owner.NonBlockingBind.resuming = False self._owner._on_auth_bind(None) diff --git a/src/common/xmpp/stringprepare.py b/src/common/xmpp/stringprepare.py index 657895c84..5e3d343b5 100644 --- a/src/common/xmpp/stringprepare.py +++ b/src/common/xmpp/stringprepare.py @@ -2,7 +2,7 @@ ## src/common/xmpp/stringprepare.py ## ## Copyright (C) 2001-2005 Twisted Matrix Laboratories -## Copyright (C) 2005-2011 Yann Leboulanger <asterix AT lagaule.org> +## Copyright (C) 2005-2012 Yann Leboulanger <asterix AT lagaule.org> ## Copyright (C) 2006 Stefan Bethge <stefan AT lanpartei.de> ## Copyright (C) 2007 Jean-Marie Traissard <jim AT lapin.org> ## diff --git a/src/common/xmpp/tls_nb.py b/src/common/xmpp/tls_nb.py index cc8393d52..575960fca 100644 --- a/src/common/xmpp/tls_nb.py +++ b/src/common/xmpp/tls_nb.py @@ -451,8 +451,6 @@ class NonBlockingTLS(PlugIn): try: self._owner.ssl_fingerprint_sha1 = cert.digest('sha1') self._owner.ssl_certificate = cert - if errnum == 0: - return True self._owner.ssl_errnum = errnum self._owner.ssl_cert_pem = OpenSSL.crypto.dump_certificate( OpenSSL.crypto.FILETYPE_PEM, cert) |