if(NOT "${SRCDIR}" STREQUAL "${BINDIR}")
-add_custom_command(OUTPUT ${BINDIR}/${CLASSPATH}/tigervnc.png
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${SRCDIR}/${CLASSPATH}/tigervnc.png ${BINDIR}/${CLASSPATH}/tigervnc.png
- DEPENDS ${SRCDIR}/${CLASSPATH}/tigervnc.png)
-
-add_custom_command(OUTPUT ${BINDIR}/${CLASSPATH}/tigervnc.ico
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${SRCDIR}/${CLASSPATH}/tigervnc.ico ${BINDIR}/${CLASSPATH}/tigervnc.ico
- DEPENDS ${SRCDIR}/${CLASSPATH}/tigervnc.ico)
+set(ICONS
+tigervnc.ico
+tigervnc.png
+insecure.png
+secure.png)
+
+foreach(icon ${ICONS})
+ add_custom_command(OUTPUT ${BINDIR}/${CLASSPATH}/${icon}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${SRCDIR}/${CLASSPATH}/${icon} ${BINDIR}/${CLASSPATH}/${icon}
+ DEPENDS ${SRCDIR}/${CLASSPATH}/${icon})
+endforeach()
endif()
DEPENDS ${JAVA_CLASSES}
${SRCDIR}/${CLASSPATH}/MANIFEST.MF
${BINDIR}/${CLASSPATH}/timestamp
- ${BINDIR}/${CLASSPATH}/tigervnc.png
${BINDIR}/${CLASSPATH}/tigervnc.ico
+ ${BINDIR}/${CLASSPATH}/tigervnc.png
+ ${BINDIR}/${CLASSPATH}/insecure.png
+ ${BINDIR}/${CLASSPATH}/secure.png
COMMAND ${JAVA_ARCHIVE}
ARGS cfm VncViewer.jar
${SRCDIR}/${CLASSPATH}/MANIFEST.MF
com/jcraft/jsch/jcraft/*.class
com/jcraft/jsch/jce/*.class
com/jcraft/jsch/*.class
- com/tigervnc/vncviewer/tigervnc.png
+ com/tigervnc/vncviewer/*.png
com/tigervnc/vncviewer/tigervnc.ico
COMMAND ${CMAKE_COMMAND}
ARGS -DJava_PATH=${Java_PATH} -DJAR_FILE=${BINDIR}/VncViewer.jar
// Identities, to determine the unique(ish) name of the server.
public String getServerName() { return serverName; }
+ public boolean isSecure() { return csecurity != null ? csecurity.isSecure() : false; }
+
public static final int RFBSTATE_UNINITIALISED = 0;
public static final int RFBSTATE_PROTOCOL_VERSION = 1;
public static final int RFBSTATE_SECURITY_TYPES = 2;
abstract public boolean processMsg(CConnection cc);
abstract public int getType();
abstract public String description();
+ public boolean isSecure() { return false; }
/*
* Use variable directly instead of dumb get/set methods.
StringBuffer username = new StringBuffer();
- upg.getUserPasswd(username, null);
+ upg.getUserPasswd(cc.isSecure(), username, null);
// Return the response to the server
os.writeU32(username.length());
StringBuffer username = new StringBuffer();
StringBuffer password = new StringBuffer();
- upg.getUserPasswd(username, password);
+ upg.getUserPasswd(cc.isSecure(), username, password);
// Return the response to the server
os.writeU32(username.length());
return res;
}
+ public boolean isSecure()
+ {
+ if (state0 != null && state0.isSecure())
+ return true;
+ if (state == 1 && state1 != null && state1.isSecure())
+ return true;
+ return false;
+ }
+
public final int getType() { return type; }
public final String description() { return name; }
public final int getType() { return anon ? Security.secTypeTLSNone : Security.secTypeX509None; }
public final String description()
{ return anon ? "TLS Encryption without VncAuth" : "X509 Encryption without VncAuth"; }
+ public boolean isSecure() { return !anon; }
protected CConnection client;
return "VeNCrypt";
}
+ public final boolean isSecure()
+ {
+ if (csecurity != null && csecurity.isSecure())
+ return true;
+ return false;
+ }
public static StringParameter secTypesStr;
byte[] challenge = new byte[vncAuthChallengeSize];
is.readBytes(challenge, 0, vncAuthChallengeSize);
StringBuffer passwd = new StringBuffer();
- upg.getUserPasswd(null, passwd);
+ upg.getUserPasswd(cc.isSecure(), null, passwd);
// Calculate the correct response
byte[] key = new byte[8];
package com.tigervnc.rfb;
public interface UserPasswdGetter {
- public void getUserPasswd(StringBuffer user, StringBuffer password);
+ public void getUserPasswd(boolean secure, StringBuffer user, StringBuffer password);
}
}
}
- public final void getUserPasswd(StringBuffer user, StringBuffer password)
+ public final void getUserPasswd(boolean secure, StringBuffer user, StringBuffer password)
{
String passwordFileStr = passwordFile.getValue();
}
JDialog win;
+ JLabel banner;
JTextField username = null;
JPasswordField passwd = null;
JLayer icon;
JPanel msg = new JPanel(null);
msg.setSize(410, 145);
- y = 10;
+ banner = new JLabel();
+ banner.setBounds(0, 0, msg.getPreferredSize().width, 20);
+ banner.setHorizontalAlignment(JLabel.CENTER);
+ banner.setOpaque(true);
+
+ if (secure) {
+ banner.setText("This connection is secure");
+ banner.setBackground(Color.GREEN);
+ ImageIcon secure_icon =
+ new ImageIcon(VncViewer.class.getResource("secure.png"));
+ banner.setIcon(secure_icon);
+ } else {
+ banner.setText("This connection is not secure");
+ banner.setBackground(Color.RED);
+ ImageIcon insecure_icon =
+ new ImageIcon(VncViewer.class.getResource("insecure.png"));
+ banner.setIcon(insecure_icon);
+ }
+ msg.add(banner);
+
+ y = 20 + 10;
JButton iconb = new JButton("?");
iconb.setVerticalAlignment(JLabel.CENTER);