diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2010-08-11 11:58:49 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2010-08-11 11:58:49 +0000 |
| commit | 94db8f6b7ba81028c2e4fd09ba7c6fb384d524f4 (patch) | |
| tree | 5e294d3014806ba1825294e1b2d4934e4c9df507 /qpid/python | |
| parent | f2842be127cb06bbb9c43583bd32229334a7fb02 (diff) | |
| download | qpid-python-94db8f6b7ba81028c2e4fd09ba7c6fb384d524f4.tar.gz | |
fix error reporting for negotiation failure in sasl stub
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@984386 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/qpid/messaging/driver.py | 5 | ||||
| -rw-r--r-- | qpid/python/qpid/sasl.py | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py index 567871b96f..30cc2eb34d 100644 --- a/qpid/python/qpid/messaging/driver.py +++ b/qpid/python/qpid/messaging/driver.py @@ -691,7 +691,10 @@ class Engine: mechs = [m for m in start.mechanisms if m in permitted] else: mechs = start.mechanisms - mech, initial = self._sasl.start(" ".join(mechs)) + try: + mech, initial = self._sasl.start(" ".join(mechs)) + except sasl.SASLError, e: + raise AuthenticationFailure(text=str(e)) self.write_op(ConnectionStartOk(client_properties=CLIENT_PROPERTIES, mechanism=mech, response=initial)) diff --git a/qpid/python/qpid/sasl.py b/qpid/python/qpid/sasl.py index d4c15bd923..fed6deac20 100644 --- a/qpid/python/qpid/sasl.py +++ b/qpid/python/qpid/sasl.py @@ -89,6 +89,8 @@ class PlainClient: return "PLAIN", "\0%s\0%s" % (self.attrs.get("username"), self.attrs.get("password")) elif "ANONYMOUS" in mechs: return "ANONYMOUS", "%s@%s" % (self.attrs.get("username"), socket.gethostname()) + else: + raise SASLError("sasl negotiation failed: no mechanism agreed") def step(self, challenge): pass |
