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;
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;
}
}
}
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
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)) {
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)
{
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