From bbe98132c7e16f51c44e65138584430238734372 Mon Sep 17 00:00:00 2001 From: Dennis Kaarsemaker Date: Wed, 15 Feb 2017 18:05:50 +0100 Subject: Fix bug in handling multiple interactive queries If repeated interaction is needed, check_auth_interactive_response returns an InteractiveQuery object. Unfortunately a bug caused it not to be recognized, causing autheintication to fail. This fixes said bug by properly looking at the type of the returned object. --- paramiko/auth_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py index 38b23729..cab27a88 100644 --- a/paramiko/auth_handler.py +++ b/paramiko/auth_handler.py @@ -597,7 +597,7 @@ class AuthHandler (object): for i in range(n): responses.append(m.get_text()) result = self.transport.server_object.check_auth_interactive_response(responses) - if isinstance(type(result), InteractiveQuery): + if isinstance(result, InteractiveQuery): # make interactive query instead of response self._interactive_query(result) return -- cgit v1.2.3 From c798ef5dd3b2647f765716b943fe42615d5508dd Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 19 Feb 2017 11:38:57 -0800 Subject: Changelog re #895, closes #895 --- sites/www/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index a64ef608..36ef443f 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :bug:`895` Fix a bug in server-mode concerning multiple interactive auth + steps (which were incorrectly responded to). Thanks to Dennis Kaarsemaker for + catch & patch. * :support:`866 backported` (also :issue:`838`) Remove an old test-related file we don't support, and add PyPy to Travis-CI config. Thanks to Pierce Lopez for the final patch and Pedro Rodrigues for an earlier edition. -- cgit v1.2.3 From 56c09ba0be8db847598646674d2068ab4c64c050 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 20 Feb 2017 10:32:44 -0800 Subject: Nuke old commented out line --- paramiko/message.py | 1 - 1 file changed, 1 deletion(-) diff --git a/paramiko/message.py b/paramiko/message.py index bf4c6b95..9cc23712 100644 --- a/paramiko/message.py +++ b/paramiko/message.py @@ -184,7 +184,6 @@ class Message (object): @rtype: string """ return u(self.get_bytes(self.get_int())) - #return self.get_bytes(self.get_size()) def get_binary(self): """ -- cgit v1.2.3 From 1d8f803f8d4d860c968682a527273760bec04778 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 20 Feb 2017 11:03:29 -0800 Subject: Not sure how these snuck back in --- paramiko/message.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/paramiko/message.py b/paramiko/message.py index 9cc23712..36d0cbcd 100644 --- a/paramiko/message.py +++ b/paramiko/message.py @@ -144,9 +144,6 @@ class Message (object): def get_int(self): """ Fetch an int from the stream. - - @return: a 32-bit unsigned integer. - @rtype: int """ return struct.unpack('>I', self.get_bytes(4))[0] @@ -179,9 +176,6 @@ class Message (object): Fetch a string from the stream. This could be a byte string and may contain unprintable characters. (It's not unheard of for a string to contain another byte-stream Message.) - - @return: a string. - @rtype: string """ return u(self.get_bytes(self.get_int())) @@ -190,9 +184,6 @@ class Message (object): Fetch a string from the stream. This could be a byte string and may contain unprintable characters. (It's not unheard of for a string to contain another byte-stream Message.) - - @return: a string. - @rtype: string """ return self.get_bytes(self.get_int()) -- cgit v1.2.3 From d6c5edf810a35e0441892c12161a3aeffe7eb1b4 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 20 Feb 2017 11:03:45 -0800 Subject: Correct get_text() docstring --- paramiko/message.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paramiko/message.py b/paramiko/message.py index 36d0cbcd..c69916aa 100644 --- a/paramiko/message.py +++ b/paramiko/message.py @@ -173,9 +173,7 @@ class Message (object): def get_text(self): """ - Fetch a string from the stream. This could be a byte string and may - contain unprintable characters. (It's not unheard of for a string to - contain another byte-stream Message.) + Fetch a Unicode string from the stream. """ return u(self.get_bytes(self.get_int())) -- cgit v1.2.3 From a54326cae2bc837d496fadcaf7957531f11ff6f7 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 20 Feb 2017 11:04:22 -0800 Subject: Also make this self-referential because jeez --- paramiko/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paramiko/message.py b/paramiko/message.py index c69916aa..05c1dd4c 100644 --- a/paramiko/message.py +++ b/paramiko/message.py @@ -175,7 +175,7 @@ class Message (object): """ Fetch a Unicode string from the stream. """ - return u(self.get_bytes(self.get_int())) + return u(self.get_string()) def get_binary(self): """ -- cgit v1.2.3