]> source.dussan.org Git - tigervnc.git/commitdiff
Removes VeNCrypt-checkbox from the security page in the WinVNC options. Fixes bug...
authorSamuel Mannehed <samuel@cendio.se>
Wed, 12 Feb 2014 10:10:19 +0000 (10:10 +0000)
committerSamuel Mannehed <samuel@cendio.se>
Wed, 12 Feb 2014 10:10:19 +0000 (10:10 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5159 3789f03b-4d11-0410-bbf8-ca57d06f2519

win/rfb_win32/SecurityPage.cxx
win/rfb_win32/resource.h
win/vncconfig/vncconfig.rc

index 151572706b8c0f8092dfafe60cb39ee15ce213bf..f0c21afb2a4fcdf501bf08e21e5f4c5c639afc45 100644 (file)
@@ -50,17 +50,16 @@ SecurityPage::initDialog()
   list<U8> secTypes;
   list<U8>::iterator i;
 
-  enableVeNCryptFeatures(false);
+  if (isItemChecked(IDC_ENC_X509))
+    enableX509Dialogs();
+  else
+    disableX509Dialogs();
 
   secTypes = security->GetEnabledSecTypes();
 
   /* Process non-VeNCrypt sectypes */
   for (i = secTypes.begin(); i != secTypes.end(); i++) {
     switch (*i) {
-    case secTypeVeNCrypt:
-      enableVeNCryptFeatures(true);
-      setItemChecked(IDC_VENCRYPT, true);
-      break;
     case secTypeNone:
       enableAuthMethod(IDC_ENC_NONE, IDC_AUTH_NONE);
       break;
@@ -76,34 +75,32 @@ SecurityPage::initDialog()
   secTypesExt = security->GetEnabledExtSecTypes();
 
   /* Process VeNCrypt subtypes */
-  if (isItemChecked(IDC_VENCRYPT)) {
-    for (iext = secTypesExt.begin(); iext != secTypesExt.end(); iext++) {
-      switch (*iext) {
-      case secTypePlain:
-       enableAuthMethod(IDC_ENC_NONE, IDC_AUTH_PLAIN);
-       break;
-      case secTypeTLSNone:
-       enableAuthMethod(IDC_ENC_TLS, IDC_AUTH_NONE);
-       break;
-      case secTypeTLSVnc:
-       enableAuthMethod(IDC_ENC_TLS, IDC_AUTH_VNC);
-       break;
-      case secTypeTLSPlain:
-       enableAuthMethod(IDC_ENC_TLS, IDC_AUTH_PLAIN);
-       break;
-      case secTypeX509None:
-       enableAuthMethod(IDC_ENC_X509, IDC_AUTH_NONE);
-        enableX509Dialogs();
-       break;
-      case secTypeX509Vnc:
-       enableAuthMethod(IDC_ENC_X509, IDC_AUTH_VNC);
-        enableX509Dialogs();
-       break;
-      case secTypeX509Plain:
-       enableAuthMethod(IDC_ENC_X509, IDC_AUTH_PLAIN);
-        enableX509Dialogs();
-       break;
-      }
+  for (iext = secTypesExt.begin(); iext != secTypesExt.end(); iext++) {
+    switch (*iext) {
+    case secTypePlain:
+      enableAuthMethod(IDC_ENC_NONE, IDC_AUTH_PLAIN);
+      break;
+    case secTypeTLSNone:
+      enableAuthMethod(IDC_ENC_TLS, IDC_AUTH_NONE);
+      break;
+    case secTypeTLSVnc:
+      enableAuthMethod(IDC_ENC_TLS, IDC_AUTH_VNC);
+      break;
+    case secTypeTLSPlain:
+      enableAuthMethod(IDC_ENC_TLS, IDC_AUTH_PLAIN);
+      break;
+    case secTypeX509None:
+      enableAuthMethod(IDC_ENC_X509, IDC_AUTH_NONE);
+      enableX509Dialogs();
+      break;
+    case secTypeX509Vnc:
+      enableAuthMethod(IDC_ENC_X509, IDC_AUTH_VNC);
+      enableX509Dialogs();
+      break;
+    case secTypeX509Plain:
+      enableAuthMethod(IDC_ENC_X509, IDC_AUTH_PLAIN);
+      enableX509Dialogs();
+      break;
     }
   }
 }
@@ -111,9 +108,7 @@ SecurityPage::initDialog()
 bool
 SecurityPage::onCommand(int id, int cmd)
 {
-  if (id == IDC_VENCRYPT) {
-    enableVeNCryptFeatures(isItemChecked(IDC_VENCRYPT));
-  } else if (id == IDC_ENC_X509) {
+  if (id == IDC_ENC_X509) {
     if (isItemChecked(IDC_ENC_X509))
       enableX509Dialogs();
     else
@@ -130,44 +125,42 @@ SecurityPage::onOk() {
   list<U32> secTypes;
 
   /* Keep same priorities as in common/rfb/SecurityClient::secTypes */
-  if (isItemChecked(IDC_VENCRYPT)) {
-    secTypes.push_back(secTypeVeNCrypt);
+  secTypes.push_back(secTypeVeNCrypt);
 
 #ifdef HAVE_GNUTLS
-    /* X509Plain */
-    if (authMethodEnabled(IDC_ENC_X509, IDC_AUTH_PLAIN)) {
-      loadX509Certs(x509_loaded);
-      secTypes.push_back(secTypeX509Plain);
-    }
+  /* X509Plain */
+  if (authMethodEnabled(IDC_ENC_X509, IDC_AUTH_PLAIN)) {
+    loadX509Certs(x509_loaded);
+    secTypes.push_back(secTypeX509Plain);
+  }
 
-    /* TLSPlain */
-    if (authMethodEnabled(IDC_ENC_TLS, IDC_AUTH_PLAIN))
-      secTypes.push_back(secTypeTLSPlain);
+  /* TLSPlain */
+  if (authMethodEnabled(IDC_ENC_TLS, IDC_AUTH_PLAIN))
+    secTypes.push_back(secTypeTLSPlain);
 
-    /* X509Vnc */
-    if (authMethodEnabled(IDC_ENC_X509, IDC_AUTH_VNC)) {
-      loadX509Certs(x509_loaded);
-      loadVncPasswd(vnc_loaded);
-      secTypes.push_back(secTypeX509Vnc);
-    }
+  /* X509Vnc */
+  if (authMethodEnabled(IDC_ENC_X509, IDC_AUTH_VNC)) {
+    loadX509Certs(x509_loaded);
+    loadVncPasswd(vnc_loaded);
+    secTypes.push_back(secTypeX509Vnc);
+  }
 
-    /* TLSVnc */
-    if (authMethodEnabled(IDC_ENC_TLS, IDC_AUTH_VNC)) {
-      loadVncPasswd(vnc_loaded);
-      secTypes.push_back(secTypeTLSVnc);
-    }
+  /* TLSVnc */
+  if (authMethodEnabled(IDC_ENC_TLS, IDC_AUTH_VNC)) {
+    loadVncPasswd(vnc_loaded);
+    secTypes.push_back(secTypeTLSVnc);
+  }
 
-    /* X509None */
-    if (authMethodEnabled(IDC_ENC_X509, IDC_AUTH_NONE)) {
-      loadX509Certs(x509_loaded);
-      secTypes.push_back(secTypeX509None);
-    }
+  /* X509None */
+  if (authMethodEnabled(IDC_ENC_X509, IDC_AUTH_NONE)) {
+    loadX509Certs(x509_loaded);
+    secTypes.push_back(secTypeX509None);
+  }
 
-    /* TLSNone */
-    if (authMethodEnabled(IDC_ENC_TLS, IDC_AUTH_NONE))
-      secTypes.push_back(secTypeTLSNone);
+  /* TLSNone */
+  if (authMethodEnabled(IDC_ENC_TLS, IDC_AUTH_NONE))
+    secTypes.push_back(secTypeTLSNone);
 #endif
-  }
 
   /* VncAuth */
   if (authMethodEnabled(IDC_ENC_NONE, IDC_AUTH_VNC)) {
@@ -184,21 +177,6 @@ SecurityPage::onOk() {
   return true;
 }
 
-inline void
-SecurityPage::enableVeNCryptFeatures(bool enable)
-{
-  if (enable) {
-    enableItem(IDC_ENC_TLS, true);
-    enableItem(IDC_ENC_X509, true);
-    enableItem(IDC_AUTH_PLAIN, true);
-  } else {
-    disableFeature(IDC_ENC_TLS);
-    disableFeature(IDC_ENC_X509);
-    disableFeature(IDC_AUTH_PLAIN);
-    disableX509Dialogs();
-  }
-}
-
 inline void
 SecurityPage::disableFeature(int id)
 {
index aedfbda0b7713468ea981ab57187533472d5931d..652deb21dc85665db43894a0e44eba320c22e30a 100644 (file)
@@ -27,7 +27,6 @@
 
 #define IDD_SECURITY           117
 
-#define IDC_VENCRYPT           1200
 #define IDC_ENC_NONE           1201
 #define IDC_ENC_TLS            1202
 #define IDC_ENC_X509           1203
index 5ca892a8123b352c0adb24634d0d103fd52e0f5c..b49d744053f7d132d9dbe42f4ea1100ffca96ac6 100644 (file)
@@ -71,35 +71,32 @@ STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Security"
 FONT 8, "MS Sans Serif"
 BEGIN
-    CONTROL            "Extended encryption and authentication methods (VeNCrypt)",
-                       IDC_VENCRYPT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
-                       7,10,200,15
-    GROUPBOX           "Session encryption", IDC_STATIC, 7,25,120,60
+    GROUPBOX           "Session encryption", IDC_STATIC, 7,10,120,60
     CONTROL            "None", IDC_ENC_NONE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
-                       10,35,50,15
+                       10,20,50,15
     CONTROL            "Anonymous TLS", IDC_ENC_TLS, "Button",
-                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,50,80,15
+                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,35,80,15
     CONTROL            "TLS with X.509 certificates", IDC_ENC_X509, "Button",
-                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,65,110,15
-    GROUPBOX           "X.509 certificates", IDC_STATIC, 7,90,185,30
-    PUSHBUTTON         "Load X.509 Certificate", IDC_LOAD_CERT, 10,100,80,15
-    PUSHBUTTON         "Load X.509 Certificate key", IDC_LOAD_CERTKEY, 90,100,100,15
-    GROUPBOX           "Authentication", IDC_STATIC, 7,125,170,60
+                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,50,110,15
+    GROUPBOX           "X.509 certificates", IDC_STATIC, 7,75,185,30
+    PUSHBUTTON         "Load X.509 Certificate", IDC_LOAD_CERT, 10,85,80,15
+    PUSHBUTTON         "Load X.509 Certificate key", IDC_LOAD_CERTKEY, 90,85,100,15
+    GROUPBOX           "Authentication", IDC_STATIC, 7,110,170,60
     CONTROL            "None", IDC_AUTH_NONE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
-                       10,135,50,15
+                       10,120,50,15
     CONTROL            "Standard VNC", IDC_AUTH_VNC, "Button",
-                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,150,80,15
-    PUSHBUTTON         "Configure", IDC_AUTH_VNC_PASSWD, 100,150,61,15
+                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,135,80,15
+    PUSHBUTTON         "Configure", IDC_AUTH_VNC_PASSWD, 100,135,61,15
 /*
     CONTROL            "Plaintext", IDC_AUTH_PLAIN, "Button",
-                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,165,70,15
+                       BS_AUTOCHECKBOX | WS_TABSTOP, 10,150,70,15
 */
     CONTROL            "Prompt local user to accept connections",
                        IDC_QUERY_CONNECT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
-                       7,185,181,15
+                       7,170,181,15
     CONTROL            "Only prompt when there is a user logged on",
                        IDC_QUERY_LOGGED_ON, "Button", BS_AUTOCHECKBOX | 
-                       WS_TABSTOP,20,200,166,15
+                       WS_TABSTOP,20,185,166,15
 END
 
 IDD_CONNECTIONS DIALOG DISCARDABLE  0, 0, 218, 198