You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2010/08/11 13:58:50 UTC

svn commit: r984386 - in /qpid/trunk/qpid/python/qpid: messaging/driver.py sasl.py

Author: rhs
Date: Wed Aug 11 11:58:49 2010
New Revision: 984386

URL: http://svn.apache.org/viewvc?rev=984386&view=rev
Log:
fix error reporting for negotiation failure in sasl stub

Modified:
    qpid/trunk/qpid/python/qpid/messaging/driver.py
    qpid/trunk/qpid/python/qpid/sasl.py

Modified: qpid/trunk/qpid/python/qpid/messaging/driver.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/messaging/driver.py?rev=984386&r1=984385&r2=984386&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/messaging/driver.py (original)
+++ qpid/trunk/qpid/python/qpid/messaging/driver.py Wed Aug 11 11:58:49 2010
@@ -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))
 

Modified: qpid/trunk/qpid/python/qpid/sasl.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/sasl.py?rev=984386&r1=984385&r2=984386&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/sasl.py (original)
+++ qpid/trunk/qpid/python/qpid/sasl.py Wed Aug 11 11:58:49 2010
@@ -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



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org