diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2012-01-07 18:41:53 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2012-01-07 18:41:53 +0400 |
commit | 82413cafaa664e412cd165f61e070c54fa0c8776 (patch) | |
tree | 86422357c3dccecc56d91d5991e77c8cf2b87d6a /src/common/xmpp | |
parent | 71e6f991e0dc729ffffe2f25496a3d89c7e34207 (diff) |
[Pablo Mazzini] ask passphrase to user when using non-sasl authentication
Diffstat (limited to 'src/common/xmpp')
-rw-r--r-- | src/common/xmpp/auth_nb.py | 13 |
1 files changed, 12 insertions, 1 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) |