]> source.dussan.org Git - tigervnc.git/commitdiff
initial support for ClientRedirect and VeNCrypt sub-type Ident in java viewer
authorBrian Hinz <bphinz@users.sourceforge.net>
Fri, 10 Jun 2011 00:44:05 +0000 (00:44 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Fri, 10 Jun 2011 00:44:05 +0000 (00:44 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4489 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tigervnc/rfb/CConnection.java
java/src/com/tigervnc/rfb/CMsgHandler.java
java/src/com/tigervnc/rfb/CMsgReaderV3.java
java/src/com/tigervnc/rfb/CMsgWriter.java
java/src/com/tigervnc/rfb/CSecurityIdent.java [new file with mode: 0644]
java/src/com/tigervnc/rfb/ConnParams.java
java/src/com/tigervnc/rfb/Encodings.java
java/src/com/tigervnc/rfb/Security.java
java/src/com/tigervnc/rfb/SecurityClient.java
java/src/com/tigervnc/vncviewer/CConn.java
java/src/com/tigervnc/vncviewer/OptionsDialog.java

index 5acae52b4dc56fc21c133fd798bce84b99157641..2a7ecfcce7c3b417c3d0a501ecca5947ab8c4564 100644 (file)
@@ -256,17 +256,6 @@ abstract public class CConnection extends CMsgHandler {
     nSecTypes = 0;
   }
 
-  // addSecType() should be called once for each security type which the
-  // client supports.  The order in which they're added is such that the
-  // first one is most preferred.
-/*
-  public void addSecType(int secType) {
-    if (nSecTypes == maxSecTypes)
-      throw new Exception("too many security types");
-    secTypes.set(nSecTypes++,secType);
-  }
-*/
-
   // setShared sets the value of the shared flag which will be sent to the
   // server upon initialisation.
   public void setShared(boolean s) { shared = s; }
index 11d2681575122cd5ec2a0c91cedcf3ad300a51f9..81fd2a1b456c231aada7f0b7695a4fa87ed1dfa7 100644 (file)
@@ -61,6 +61,9 @@ public class CMsgHandler {
     cp.setName(name);
   }
 
+  public void clientRedirect(int port, String host, 
+                             String x509subject) {}
+
   public void setCursor(int width, int height, Point hotspot,
                         int[] data, byte[] mask) {}
   public void serverInit() {}
index 308d60d1a71e07e7f40f7b33814d4c30f0572e1e..6d9e254b4d66d332aa01a1dcc6b1d031dfe2e3d8 100644 (file)
@@ -80,6 +80,9 @@ public class CMsgReaderV3 extends CMsgReader {
       case Encodings.pseudoEncodingLastRect:
         nUpdateRectsLeft = 1;     // this rectangle is the last one
         break;
+      case Encodings.pseudoEncodingClientRedirect:
+        readClientRedirect(x, y, w, h);
+        break;
       default:
         readRect(new Rect(x, y, x+w, y+h), encoding);
         break;
@@ -133,6 +136,19 @@ public class CMsgReaderV3 extends CMsgReader {
     handler.setExtendedDesktopSize(x, y, w, h, layout);
   }
 
+  void readClientRedirect(int x, int y, int w, int h) 
+  {
+    int port = is.readU16();
+    String host = is.readString();
+    String x509subject = is.readString();
+
+    if (x != 0 || y != 0 || w != 0 || h != 0) {
+      vlog.error("Ignoring ClientRedirect rect with non-zero position/size");
+    } else {
+      handler.clientRedirect(port, host, x509subject);
+    }
+  }
+
   int nUpdateRectsLeft;
 
   static LogWriter vlog = new LogWriter("CMsgReaderV3");
index 7abbc09c88af92e12cd8b666ba9a64e2d0e679e2..7cafddde17097daf9e311a8f9d6b6f269b29aa79 100644 (file)
@@ -57,6 +57,8 @@ abstract public class CMsgWriter {
       encodings[nEncodings++] = Encodings.pseudoEncodingExtendedDesktopSize;
     if (cp.supportsDesktopRename)
       encodings[nEncodings++] = Encodings.pseudoEncodingDesktopName;
+    if (cp.supportsClientRedirect)
+      encodings[nEncodings++] = Encodings.pseudoEncodingClientRedirect;
     if (Decoder.supported(preferredEncoding)) {
       encodings[nEncodings++] = preferredEncoding;
     }
diff --git a/java/src/com/tigervnc/rfb/CSecurityIdent.java b/java/src/com/tigervnc/rfb/CSecurityIdent.java
new file mode 100644 (file)
index 0000000..6523e41
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ */
+
+package com.tigervnc.rfb;
+
+import java.io.IOException;
+
+import com.tigervnc.rdr.*;
+import com.tigervnc.vncviewer.*;
+
+public class CSecurityIdent extends CSecurity {
+
+  public CSecurityIdent() { }
+
+  public boolean processMsg(CConnection cc) {
+    InStream is = cc.getInStream();
+    OutStream os = cc.getOutStream();
+
+    StringBuffer username = new StringBuffer();
+
+    CConn.upg.getUserPasswd(username, null);
+
+    // Return the response to the server
+    os.writeU32(username.length());
+    try {
+      byte[] utf8str = username.toString().getBytes("UTF8");
+      os.writeBytes(utf8str, 0, username.length());
+    } catch(java.io.UnsupportedEncodingException e) {
+      e.printStackTrace();
+    }
+    os.flush();
+    return true;
+  }
+
+  public int getType() { return Security.secTypeIdent; }
+
+  java.net.Socket sock;
+  UserPasswdGetter upg;
+
+  static LogWriter vlog = new LogWriter("Ident");
+  public String description() { return "No Encryption"; }
+
+}
index 16c6ff4857fb427c8ef567f1af382b04f8cac707..c5e50d51d6cbbe663152e3a795c86b242f9dea9f 100644 (file)
@@ -29,7 +29,7 @@ public class ConnParams {
     supportsLocalCursor = false; supportsLocalXCursor = false;
     supportsDesktopResize = false; supportsExtendedDesktopSize = false;
     supportsDesktopRename = false; supportsLastRect = false;
-    supportsSetDesktopSize = false;
+    supportsSetDesktopSize = false; supportsClientRedirect = false;
     customCompressLevel = false; compressLevel = 6;
     noJpeg = false; qualityLevel = -1; 
     name_ = null; nEncodings_ = 0; encodings_ = null;
@@ -134,6 +134,8 @@ public class ConnParams {
         supportsLocalCursor = true;
       else if (encodings[i] == Encodings.pseudoEncodingDesktopSize)
         supportsDesktopResize = true;
+      else if (encodings[i] == Encodings.pseudoEncodingClientRedirect)
+        supportsClientRedirect = true;
       else if (encodings[i] >= Encodings.pseudoEncodingCompressLevel0 &&
           encodings[i] <= Encodings.pseudoEncodingCompressLevel9) {
         customCompressLevel = true;
@@ -154,6 +156,7 @@ public class ConnParams {
   public boolean supportsDesktopResize;
   public boolean supportsExtendedDesktopSize;
   public boolean supportsDesktopRename;
+  public boolean supportsClientRedirect;
   public boolean supportsLastRect;
 
   public boolean supportsSetDesktopSize;
index 215178dcf3e62f6d38ed6185852bb7dc9bb32f0b..493d54880cb50329728bac217bba8784763d06f9 100644 (file)
@@ -35,6 +35,7 @@ public class Encodings {
   public static final int pseudoEncodingDesktopSize = -223;
   public static final int pseudoEncodingExtendedDesktopSize = -308;
   public static final int pseudoEncodingDesktopName = -307;
+  public static final int pseudoEncodingClientRedirect = -311;
 
   // TightVNC-specific
   public static final int pseudoEncodingLastRect = -224;
index 95a66c3dad677dfb419ab01ea2bcc8332285e718..379851d8b48b82e64f42ec9f37cff0228bef015c 100644 (file)
@@ -39,7 +39,6 @@ public class Security {
   public static final int secTypeUltra     = 17;
   public static final int secTypeTLS       = 18;
   public static final int secTypeVeNCrypt  = 19;
-  public static final int secTypeManaged   = 20;
 
   /* VeNCrypt subtypes */
   public static final int secTypePlain     = 256;
@@ -49,6 +48,9 @@ public class Security {
   public static final int secTypeX509None  = 260;
   public static final int secTypeX509Vnc   = 261;
   public static final int secTypeX509Plain = 262;
+  public static final int secTypeIdent     = 265;
+  public static final int secTypeTLSIdent  = 266;
+  public static final int secTypeX509Ident = 267;
 
   // result types
 
@@ -131,16 +133,18 @@ public class Security {
     //if (name.equalsIgnoreCase("ultra"))          return secTypeUltra;
     //if (name.equalsIgnoreCase("TLS"))              return secTypeTLS;
     if (name.equalsIgnoreCase("VeNCrypt"))  return secTypeVeNCrypt;
-    if (name.equalsIgnoreCase("Managed"))        return secTypeManaged;
 
     /* VeNCrypt subtypes */
     if (name.equalsIgnoreCase("Plain"))            return secTypePlain;
+    if (name.equalsIgnoreCase("Ident"))            return secTypeIdent;
     if (name.equalsIgnoreCase("TLSNone"))        return secTypeTLSNone;
     if (name.equalsIgnoreCase("TLSVnc"))         return secTypeTLSVnc;
     if (name.equalsIgnoreCase("TLSPlain"))     return secTypeTLSPlain;
+    if (name.equalsIgnoreCase("TLSIdent"))     return secTypeTLSIdent;
     if (name.equalsIgnoreCase("X509None"))     return secTypeX509None;
     if (name.equalsIgnoreCase("X509Vnc"))        return secTypeX509Vnc;
     if (name.equalsIgnoreCase("X509Plain")) return secTypeX509Plain;
+    if (name.equalsIgnoreCase("X509Ident")) return secTypeX509Ident;
 
     return secTypeInvalid;
   }
@@ -157,16 +161,18 @@ public class Security {
     //case secTypeUltra:      return "Ultra";
     //case secTypeTLS:        return "TLS";
     case secTypeVeNCrypt:   return "VeNCrypt";
-    case secTypeManaged:    return "Managed";
 
     /* VeNCrypt subtypes */
     case secTypePlain:      return "Plain";
+    case secTypeIdent:      return "Ident";
     case secTypeTLSNone:    return "TLSNone";
     case secTypeTLSVnc:     return "TLSVnc";
     case secTypeTLSPlain:   return "TLSPlain";
+    case secTypeTLSIdent:   return "TLSIdent";
     case secTypeX509None:   return "X509None";
     case secTypeX509Vnc:    return "X509Vnc";
     case secTypeX509Plain:  return "X509Plain";
+    case secTypeX509Ident:  return "X509Ident";
     default:                return "[unknown secType]";
     }
   }
index 90c35d81344edb22a8b43869ca9e6a9f467472a6..a8abd9e1431998ef1bf88cf7d227e61b7de27a31 100644 (file)
 
 package com.tigervnc.rfb;
 
+import com.tigervnc.vncviewer.CConn;
+
 public class SecurityClient extends Security {
 
   public SecurityClient() { super(secTypes); }
 
   public CSecurity GetCSecurity(int secType)
   {
-    //assert (CSecurity::upg != NULL); /* (upg == NULL) means bug in the viewer */
-    //assert (CSecurityTLS::msg != NULL);
+    assert (CConn.upg != null); /* (upg == null) means bug in the viewer */
+    assert (msg != null);
   
     if (!IsSupported(secType))
       throw new Exception("Security type not supported");
   
     switch (secType) {
-    case Security.secTypeManaged: return (new CSecurityManaged());
     case Security.secTypeNone: return (new CSecurityNone());
     case Security.secTypeVncAuth: return (new CSecurityVncAuth());
     case Security.secTypeVeNCrypt: return (new CSecurityVeNCrypt(this));
     case Security.secTypePlain: return (new CSecurityPlain());
+    case Security.secTypeIdent: return (new CSecurityIdent());
     case Security.secTypeTLSNone:
       return (new CSecurityStack(secTypeTLSNone, "TLS with no password",
                              new CSecurityTLS(true), null));
@@ -46,15 +48,21 @@ public class SecurityClient extends Security {
     case Security.secTypeTLSPlain:
       return (new CSecurityStack(secTypeTLSPlain, "TLS with Username/Password",
                              new CSecurityTLS(true), new CSecurityPlain()));
+    case Security.secTypeTLSIdent:
+      return (new CSecurityStack(secTypeTLSIdent, "TLS with username only",
+                             new CSecurityTLS(true), new CSecurityIdent()));
     case Security.secTypeX509None:
       return (new CSecurityStack(secTypeX509None, "X509 with no password",
                              new CSecurityTLS(false), null));
     case Security.secTypeX509Vnc:
-      return (new CSecurityStack(secTypeX509None, "X509 with VNCAuth",
+      return (new CSecurityStack(secTypeX509Vnc, "X509 with VNCAuth",
                              new CSecurityTLS(false), new CSecurityVncAuth()));
     case Security.secTypeX509Plain:
       return (new CSecurityStack(secTypeX509Plain, "X509 with Username/Password",
                              new CSecurityTLS(false), new CSecurityPlain()));
+    case Security.secTypeX509Ident:
+      return (new CSecurityStack(secTypeX509Ident, "X509 with username only",
+                             new CSecurityTLS(false), new CSecurityIdent()));
     default:
       throw new Exception("Security type not supported");
     }
@@ -72,6 +80,6 @@ public class SecurityClient extends Security {
   static StringParameter secTypes 
   = new StringParameter("SecurityTypes",
                         "Specify which security scheme to use (None, VncAuth)",
-                        "Managed,X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None");
+                        "Ident,TLSIdent,X509Ident,X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None");
 
 }
index 28b5d295087307ad96d08a6ef0e113f62fcf0d55..9224aa17dc94d117595014271e51295872038636 100644 (file)
@@ -282,6 +282,25 @@ public class CConn extends CConnection
     resizeFramebuffer();
   }\r
 \r
+  // clientRedirect() migrates the client to another host/port
+  public void clientRedirect(int port, String host, 
+                             String x509subject) {
+    try {
+      getSocket().close();
+      setServerPort(port);
+      sock = new java.net.Socket(host, port);
+      sock.setTcpNoDelay(true);
+      sock.setTrafficClass(0x10);
+      setSocket(sock);
+      vlog.info("Redirected to "+host+":"+port);
+      setStreams(new JavaInStream(sock.getInputStream()),
+                 new JavaOutStream(sock.getOutputStream()));
+      initialiseProtocol();
+    } catch (java.io.IOException e) {
+      e.printStackTrace();
+    }
+  }
+
   // setName() is called when the desktop name changes\r
   public void setName(String name) {\r
     super.setName(name);\r
@@ -404,6 +423,8 @@ public class CConn extends CConnection
 \r
   private void resizeFramebuffer()\r
   {\r
+    if ((cp.width == 0) && (cp.height == 0))\r
+      return;\r
     if (desktop == null)\r
       return;\r
     if ((desktop.width() == cp.width) && (desktop.height() == cp.height))\r
@@ -677,7 +698,7 @@ public class CConn extends CConnection
       options.encX509.setEnabled(false);\r
       options.ca.setEnabled(false);\r
       options.crl.setEnabled(false);\r
-      options.secManaged.setEnabled(false);\r
+      options.secIdent.setEnabled(false);\r
       options.secNone.setEnabled(false);\r
       options.secVnc.setEnabled(false);\r
       options.secPlain.setEnabled(false);\r
@@ -693,11 +714,6 @@ public class CConn extends CConnection
         case Security.secTypeVeNCrypt:\r
           options.secVeNCrypt.setSelected(true);\r
           break;\r
-        case Security.secTypeManaged:\r
-          options.encNone.setSelected(true);\r
-          options.secManaged.setSelected(true);\r
-          options.sendLocalUsername.setSelected(true);\r
-          break;\r
         case Security.secTypeNone:\r
           options.encNone.setSelected(true);\r
           options.secNone.setSelected(true);\r
@@ -719,6 +735,10 @@ public class CConn extends CConnection
             options.secPlain.setSelected(true);\r
             options.sendLocalUsername.setSelected(true);\r
             break;\r
+          case Security.secTypeIdent:\r
+            options.secIdent.setSelected(true);\r
+            options.sendLocalUsername.setSelected(true);\r
+            break;\r
           case Security.secTypeTLSNone:\r
             options.encTLS.setSelected(true);\r
             options.secNone.setSelected(true);\r
@@ -732,6 +752,11 @@ public class CConn extends CConnection
             options.secPlain.setSelected(true);\r
             options.sendLocalUsername.setSelected(true);\r
             break;\r
+          case Security.secTypeTLSIdent:\r
+            options.encTLS.setSelected(true);\r
+            options.secIdent.setSelected(true);\r
+            options.sendLocalUsername.setSelected(true);\r
+            break;\r
           case Security.secTypeX509None:\r
             options.encX509.setSelected(true);\r
             options.secNone.setSelected(true);\r
@@ -745,11 +770,16 @@ public class CConn extends CConnection
             options.secPlain.setSelected(true);\r
             options.sendLocalUsername.setSelected(true);\r
             break;\r
+          case Security.secTypeX509Ident:\r
+            options.encX509.setSelected(true);\r
+            options.secIdent.setSelected(true);\r
+            options.sendLocalUsername.setSelected(true);\r
+            break;\r
           }\r
         }\r
       }\r
       options.sendLocalUsername.setEnabled(options.secPlain.isSelected()||\r
-        options.secManaged.isSelected());\r
+        options.secIdent.isSelected());\r
     }\r
 \r
     options.fullScreen.setSelected(fullScreen);\r
@@ -823,19 +853,19 @@ public class CConn extends CConnection
     if (state() != RFBSTATE_NORMAL) {\r
       /* Process security types which don't use encryption */\r
       if (options.encNone.isSelected()) {\r
-        if (options.secManaged.isSelected())\r
-          Security.EnableSecType(Security.secTypeManaged);\r
         if (options.secNone.isSelected())\r
           Security.EnableSecType(Security.secTypeNone);\r
         if (options.secVnc.isSelected())\r
           Security.EnableSecType(Security.secTypeVncAuth);\r
         if (options.secPlain.isSelected())\r
           Security.EnableSecType(Security.secTypePlain);\r
+        if (options.secIdent.isSelected())\r
+          Security.EnableSecType(Security.secTypeIdent);\r
       } else {\r
-        Security.DisableSecType(Security.secTypeManaged);\r
         Security.DisableSecType(Security.secTypeNone);\r
         Security.DisableSecType(Security.secTypeVncAuth);\r
         Security.DisableSecType(Security.secTypePlain);\r
+        Security.DisableSecType(Security.secTypeIdent);\r
       }\r
 \r
       /* Process security types which use TLS encryption */\r
@@ -846,10 +876,13 @@ public class CConn extends CConnection
           Security.EnableSecType(Security.secTypeTLSVnc);\r
         if (options.secPlain.isSelected())\r
           Security.EnableSecType(Security.secTypeTLSPlain);\r
+        if (options.secIdent.isSelected())\r
+          Security.EnableSecType(Security.secTypeTLSIdent);\r
       } else {\r
         Security.DisableSecType(Security.secTypeTLSNone);\r
         Security.DisableSecType(Security.secTypeTLSVnc);\r
         Security.DisableSecType(Security.secTypeTLSPlain);\r
+        Security.DisableSecType(Security.secTypeTLSIdent);\r
       }\r
   \r
       /* Process security types which use X509 encryption */\r
@@ -860,10 +893,13 @@ public class CConn extends CConnection
           Security.EnableSecType(Security.secTypeX509Vnc);\r
         if (options.secPlain.isSelected())\r
           Security.EnableSecType(Security.secTypeX509Plain);\r
+        if (options.secIdent.isSelected())\r
+          Security.EnableSecType(Security.secTypeX509Ident);\r
       } else {\r
         Security.DisableSecType(Security.secTypeX509None);\r
         Security.DisableSecType(Security.secTypeX509Vnc);\r
         Security.DisableSecType(Security.secTypeX509Plain);\r
+        Security.DisableSecType(Security.secTypeX509Ident);\r
       }\r
   \r
       /* Process *None security types */\r
@@ -908,6 +944,20 @@ public class CConn extends CConnection
         Security.DisableSecType(Security.secTypeX509Plain);\r
       }\r
   \r
+      /* Process *Ident security types */\r
+      if (options.secIdent.isSelected()) {\r
+        if (options.encNone.isSelected())\r
+          Security.EnableSecType(Security.secTypeIdent);\r
+        if (options.encTLS.isSelected())\r
+          Security.EnableSecType(Security.secTypeTLSIdent);\r
+        if (options.encX509.isSelected())\r
+          Security.EnableSecType(Security.secTypeX509Ident);\r
+      } else {\r
+        Security.DisableSecType(Security.secTypeIdent);\r
+        Security.DisableSecType(Security.secTypeTLSIdent);\r
+        Security.DisableSecType(Security.secTypeX509Ident);\r
+      }\r
+  \r
       CSecurityTLS.x509ca.setParam(options.ca.getText());\r
       CSecurityTLS.x509crl.setParam(options.crl.getText());\r
     }\r
index b38c00c5eacb7206b02443813c8ea4444942bfe6..98198158e8094de716771761e21e3232d7629ed6 100644 (file)
@@ -49,7 +49,7 @@ class OptionsDialog extends Dialog implements
   JCheckBox viewOnly, acceptClipboard, sendClipboard;\r
   JCheckBox fullScreen, shared, useLocalCursor, fastCopyRect;\r
   JCheckBox secVeNCrypt, encNone, encTLS, encX509;\r
-  JCheckBox secNone, secVnc, secPlain, secManaged, sendLocalUsername;\r
+  JCheckBox secNone, secVnc, secPlain, secIdent, sendLocalUsername;\r
   JButton okButton, cancelButton;\r
   JButton ca, crl;\r
   JButton defSaveButton;\r
@@ -206,7 +206,7 @@ class OptionsDialog extends Dialog implements
     secNone = addCheckbox("None", null, authPanel);\r
     secVnc = addCheckbox("Standard VNC", null, authPanel);\r
     secPlain = addJCheckBox("Plaintext", null, authPanel, new GridBagConstraints(0,2,1,1,1,1,GridBagConstraints.LINE_START,GridBagConstraints.NONE,new Insets(0,0,0,5),0,0));\r
-    secManaged = addJCheckBox("Managed", null, authPanel, new GridBagConstraints(0,3,1,1,1,1,GridBagConstraints.LINE_START,GridBagConstraints.NONE,new Insets(0,0,0,5),0,0));\r
+    secIdent = addJCheckBox("Ident", null, authPanel, new GridBagConstraints(0,3,1,1,1,1,GridBagConstraints.LINE_START,GridBagConstraints.NONE,new Insets(0,0,0,5),0,0));\r
     sendLocalUsername = new JCheckBox("Send Local Username");\r
     sendLocalUsername.addItemListener(this);\r
     addGBComponent(sendLocalUsername, authPanel, 1, 2, 1, 2, 0, 0, 2, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(0,20,0,0));\r
@@ -266,7 +266,7 @@ class OptionsDialog extends Dialog implements
     compressLevel.setEnabled(customCompressLevel.isSelected());\r
     qualityLevel.setEnabled(noJpeg.isSelected());\r
     sendLocalUsername.setEnabled(secVeNCrypt.isEnabled()&&\r
-      (secPlain.isSelected()||secManaged.isSelected()));\r
+      (secPlain.isSelected()||secIdent.isSelected()));\r
   }\r
 \r
   JRadioButton addRadioCheckbox(String str, ButtonGroup group, JPanel panel) {\r
@@ -365,15 +365,15 @@ class OptionsDialog extends Dialog implements
       encX509.setEnabled(secVeNCrypt.isSelected());\r
       ca.setEnabled(secVeNCrypt.isSelected());\r
       crl.setEnabled(secVeNCrypt.isSelected());\r
-      secManaged.setEnabled(secVeNCrypt.isSelected());\r
+      secIdent.setEnabled(secVeNCrypt.isSelected());\r
       secNone.setEnabled(secVeNCrypt.isSelected());\r
       secVnc.setEnabled(secVeNCrypt.isSelected());\r
       secPlain.setEnabled(secVeNCrypt.isSelected());\r
       sendLocalUsername.setEnabled(secVeNCrypt.isSelected());\r
     }\r
-    if (s instanceof JCheckBox && (JCheckBox)s == secManaged ||\r
+    if (s instanceof JCheckBox && (JCheckBox)s == secIdent ||\r
         s instanceof JCheckBox && (JCheckBox)s == secPlain) {\r
-      sendLocalUsername.setEnabled(secManaged.isSelected()||secPlain.isSelected());\r
+      sendLocalUsername.setEnabled(secIdent.isSelected()||secPlain.isSelected());\r
     }\r
   }\r
 \r