[X2Go-Commits] pyhoca-gui.git - build-main (branch) updated: 0.4.0.8-7-g7256699

X2Go dev team git-admin at x2go.org
Wed Jan 8 15:22:03 CET 2014


The branch, build-main has been updated
       via  7256699ba90dca0b6001e19a0ac6576660a9e4ff (commit)
      from  6706416c0874f361a68d67072f3abb76fb733cbe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog           |    2 ++
 pyhoca/wxgui/logon.py      |   19 +++++++++++++++----
 pyhoca/wxgui/passphrase.py |   43 ++++++++++++++++++++++++++-----------------
 3 files changed, 43 insertions(+), 21 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 2bf268e..0ef6293 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ pyhoca-gui (0.4.0.9-0~x2go1) UNRELEASED; urgency=low
     - Add support for encrypted/locked/passphrase-protected SSH private key
       files.
     - Only show notifications if there really is something to show.
+    - Support encrypted on SSH proxy whith password authentication on X2Go
+      Server.
   * /debian/copyright:
     + Update file. Add entry for file icon2exe.py.
 
diff --git a/pyhoca/wxgui/logon.py b/pyhoca/wxgui/logon.py
index 83e9cb5..c287339 100644
--- a/pyhoca/wxgui/logon.py
+++ b/pyhoca/wxgui/logon.py
@@ -42,7 +42,7 @@ import wx
 import os
 
 # PyHoca-GUI modules
-# ... NONE ...
+import passphrase
 
 if os.environ.has_key('DESKTOP_SESSION'):
     WINDOW_MANAGER = os.environ['DESKTOP_SESSION']
@@ -283,9 +283,9 @@ class PyHocaGUI_DialogBoxPassword(wx.Dialog):
         wx.BeginBusyCursor()
         session_uuid = self._PyHocaGUI._X2GoClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0]
         try:
-            self._PyHocaGUI._X2GoClient__connect_session(session_uuid, 
-                                                         username=username, 
-                                                         password=password, 
+            self._PyHocaGUI._X2GoClient__connect_session(session_uuid,
+                                                         username=username,
+                                                         password=password,
                                                          force_password_auth=force_password_auth,
                                                          add_to_known_hosts=self._PyHocaGUI.add_to_known_hosts,
                                                          sshproxy_user=sshproxy_user,
@@ -312,6 +312,17 @@ class PyHocaGUI_DialogBoxPassword(wx.Dialog):
                     _sp.write_user_config = True
                     _sp.write()
 
+        except x2go.X2GoSSHProxyPasswordRequiredException:
+            key_filename = None
+            try:
+                if not self._PyHocaGUI._X2GoClient__get_session(session_uuid).sshproxy_params['sshproxy_look_for_keys']:
+                    key_filename = self._PyHocaGUI._X2GoClient__get_session(session_uuid).sshproxy_params['sshproxy_key_filename']
+            except KeyError:
+                pass
+            self._pyhoca_logger('SSH private key file (for SSH proxy) is encrypted and requires a passphrase', loglevel=x2go.log.loglevel_INFO, )
+            _passphrase_window = passphrase.PyHocaGUI_DialogBoxPassphrase(self._PyHocaGUI, self.current_profile_name, caller=self, password=password, sshproxy_auth=True, key_filename=key_filename)
+            self._PyHocaGUI._logon_windows[self.current_profile_name] = _passphrase_window
+
         except x2go.AuthenticationException:
             if self.sshproxy_auth and (not self.sshproxy_started):
                 try: wx.EndBusyCursor()
diff --git a/pyhoca/wxgui/passphrase.py b/pyhoca/wxgui/passphrase.py
index c81dc55..497f9d0 100644
--- a/pyhoca/wxgui/passphrase.py
+++ b/pyhoca/wxgui/passphrase.py
@@ -55,7 +55,7 @@ class PyHocaGUI_DialogBoxPassphrase(wx.Dialog):
     SSH key passphrase window for L{PyHocaGUI}.
 
     """
-    def __init__(self, _PyHocaGUI, profile_name, caller=None, sshproxy_auth=False, sshproxy_passphrase='', key_filename=None):
+    def __init__(self, _PyHocaGUI, profile_name, caller=None, password='', sshproxy_auth=False, sshproxy_passphrase='', key_filename=''):
         """\
         Passphrase window (constructor)
 
@@ -81,12 +81,13 @@ class PyHocaGUI_DialogBoxPassphrase(wx.Dialog):
 
         self._PyHocaGUI._sub_windows.append(self)
 
-        self.passphrase = None
+        self.passphrase = ''
+        self.password = password
         self.key_filename = key_filename
         self.sshproxy_auth = sshproxy_auth
         self.sshproxy_passphrase = sshproxy_passphrase
 
-        if self.key_filename is not None:
+        if self.key_filename:
             keyfilenameLbl = wx.StaticText(self, wx.ID_ANY, _(u'Unlock SSH private key (%s)...') % key_filename)
         else:
             keyfilenameLbl = wx.StaticText(self, wx.ID_ANY, _(u'Unlock auto-discovered SSH private key...'))
@@ -167,7 +168,13 @@ class PyHocaGUI_DialogBoxPassphrase(wx.Dialog):
         @type evt: C{obj}
 
         """
-        if self.sshproxy_auth:
+        force_password_auth = False
+        sshproxy_force_password_auth = False
+        if self.sshproxy_auth and self.password:
+            passphrase = self.password
+            sshproxy_passphrase = self.passphraseTxt.GetValue()
+            force_password_auth = True
+        elif self.sshproxy_auth:
             passphrase = sshproxy_passphrase = self.passphraseTxt.GetValue()
         else:
             passphrase = self.passphraseTxt.GetValue()
@@ -179,18 +186,13 @@ class PyHocaGUI_DialogBoxPassphrase(wx.Dialog):
         session_uuid = self._PyHocaGUI._X2GoClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0]
 
         try:
-            if self.sshproxy_auth:
-                self._PyHocaGUI._X2GoClient__connect_session(session_uuid,
-                                                             password=passphrase,
-                                                             sshproxy_password=sshproxy_passphrase,
-                                                             add_to_known_hosts=self._PyHocaGUI.add_to_known_hosts,
-                                                            )
-            else:
-                self._PyHocaGUI._X2GoClient__connect_session(session_uuid,
-                                                             password=passphrase,
-                                                             sshproxy_password=sshproxy_passphrase,
-                                                             add_to_known_hosts=self._PyHocaGUI.add_to_known_hosts,
-                                                            )
+            self._PyHocaGUI._X2GoClient__connect_session(session_uuid,
+                                                         password=passphrase,
+                                                         sshproxy_password=sshproxy_passphrase,
+                                                         force_password_auth=force_password_auth,
+                                                         sshproxy_force_password_auth=sshproxy_force_password_auth,
+                                                         add_to_known_hosts=self._PyHocaGUI.add_to_known_hosts,
+                                                        )
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name,
                                              title=_(u'%s - connect') % self.current_profile_name,
                                              text=_(u'Authentication has been successful.'),
@@ -198,7 +200,7 @@ class PyHocaGUI_DialogBoxPassphrase(wx.Dialog):
 
         except x2go.PasswordRequiredException:
             if self.sshproxy_auth:
-                key_filename = None
+                key_filename = ''
                 try:
                     if not self._PyHocaGUI._X2GoClient__get_session(session_uuid).control_params['look_for_keys']:
                         key_filename = self._PyHocaGUI._X2GoClient__get_session(session_uuid).control_params['key_filename']
@@ -229,6 +231,13 @@ class PyHocaGUI_DialogBoxPassphrase(wx.Dialog):
                                              icon='auth_failed')
             connect_failed = True
 
+        except x2go.X2GoSSHProxyAuthenticationException:
+            self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name,
+                                             title=_(u'%s - connect failure') % self.current_profile_name,
+                                             text=_(u'Authentication to the SSH proxy server failed!'),
+                                             icon='auth_failed')
+            connect_failed = True
+
         except gevent.socket.error, e:
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name,
                                              title=_(u'%s - socket error') % self.current_profile_name,


hooks/post-receive
-- 
pyhoca-gui.git (Python X2Go Client (wxPython GUI))

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "pyhoca-gui.git" (Python X2Go Client (wxPython GUI)).




More information about the x2go-commits mailing list