Commit 570b8e90 authored by runge's avatar runge

update viewer jars and ss script

parent af44bff5
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# ss_vncviewer: wrapper for vncviewer to use an stunnel SSL tunnel # ss_vncviewer: wrapper for vncviewer to use an stunnel SSL tunnel
# or an SSH tunnel. # or an SSH tunnel.
# #
# Copyright (c) 2006 by Karl J. Runge <runge@karlrunge.com> # Copyright (c) 2006-2007 by Karl J. Runge <runge@karlrunge.com>
# #
# You must have stunnel(8) installed on the system and in your PATH # You must have stunnel(8) installed on the system and in your PATH
# (however, see the -ssh option below, in which case you will need ssh(1) # (however, see the -ssh option below, in which case you will need ssh(1)
...@@ -112,7 +112,9 @@ VNCVIEWERCMD=${VNCVIEWERCMD:-vncviewer} ...@@ -112,7 +112,9 @@ VNCVIEWERCMD=${VNCVIEWERCMD:-vncviewer}
# Same for STUNNEL, e.g. set it to /path/to/stunnel or stunnel4, etc. # Same for STUNNEL, e.g. set it to /path/to/stunnel or stunnel4, etc.
# #
#set -xv if [ "X$SS_DEBUG" != "X" ]; then
set -xv
fi
PATH=$PATH:/usr/sbin:/usr/local/sbin:/dist/sbin; export PATH PATH=$PATH:/usr/sbin:/usr/local/sbin:/dist/sbin; export PATH
...@@ -146,6 +148,10 @@ showcert="" ...@@ -146,6 +148,10 @@ showcert=""
reverse="" reverse=""
if [ "X$1" = "X-viewerflavor" ]; then if [ "X$1" = "X-viewerflavor" ]; then
if echo "$VNCVIEWERCMD" | egrep -i '^(xmessage|sleep )' > /dev/null; then
echo "unknown"
exit 0
fi
if echo "$VNCVIEWERCMD" | grep -i chicken.of > /dev/null; then if echo "$VNCVIEWERCMD" | grep -i chicken.of > /dev/null; then
echo "cotvnc" echo "cotvnc"
exit 0 exit 0
...@@ -167,6 +173,12 @@ if [ "X$1" = "X-viewerflavor" ]; then ...@@ -167,6 +173,12 @@ if [ "X$1" = "X-viewerflavor" ]; then
exit 0 exit 0
fi fi
if [ "X$SS_VNCVIEWER_NO_MAXCONN" != "X" ]; then
STUNNEL_EXTRA_OPTS=`echo "$STUNNEL_EXTRA_OPTS" | sed -e 's/maxconn/#maxconn/'`
elif echo "$VNCVIEWERCMD" | egrep -i '^(xmessage|sleep )' > /dev/null; then
STUNNEL_EXTRA_OPTS=`echo "$STUNNEL_EXTRA_OPTS" | sed -e 's/maxconn/#maxconn/'`
fi
# grab our cmdline options: # grab our cmdline options:
while [ "X$1" != "X" ] while [ "X$1" != "X" ]
do do
...@@ -215,10 +227,6 @@ else ...@@ -215,10 +227,6 @@ else
fi fi
if [ "X$reverse" != "X" ]; then if [ "X$reverse" != "X" ]; then
ssh_sleep=1800 ssh_sleep=1800
if [ "X$use_ssh" = "X1" ]; then
VNCVIEWER_LISTEN_LOCALHOST=1
export VNCVIEWER_LISTEN_LOCALHOST
fi
if [ "X$proxy" != "X" ]; then if [ "X$proxy" != "X" ]; then
if [ "X$use_ssh" = "X" -a "X$use_sshssl" = "X" ]; then if [ "X$use_ssh" = "X" -a "X$use_sshssl" = "X" ]; then
echo "" echo ""
...@@ -256,6 +264,15 @@ if echo "$orig" | grep '^vnc://' > /dev/null; then ...@@ -256,6 +264,15 @@ if echo "$orig" | grep '^vnc://' > /dev/null; then
direct_connect=1 direct_connect=1
elif echo "$orig" | grep '^vncs://' > /dev/null; then elif echo "$orig" | grep '^vncs://' > /dev/null; then
orig=`echo "$orig" | sed -e 's,vncs://,,'` orig=`echo "$orig" | sed -e 's,vncs://,,'`
elif echo "$orig" | grep '^vncssl://' > /dev/null; then
orig=`echo "$orig" | sed -e 's,vncssl://,,'`
elif echo "$orig" | grep '^vncssh://' > /dev/null; then
orig=`echo "$orig" | sed -e 's,vncssh://,,'`
use_ssh=1
fi
if [ "X$reverse" != "X" -a "X$direct_connect" = "X" ]; then
VNCVIEWER_LISTEN_LOCALHOST=1
export VNCVIEWER_LISTEN_LOCALHOST
fi fi
# play around with host:display port: # play around with host:display port:
...@@ -264,6 +281,8 @@ if echo "$orig" | grep ':' > /dev/null; then ...@@ -264,6 +281,8 @@ if echo "$orig" | grep ':' > /dev/null; then
else else
if [ "X$reverse" = "X" ]; then if [ "X$reverse" = "X" ]; then
orig="$orig:0" orig="$orig:0"
elif [ "X$orig" = "X" ]; then
orig=":0"
fi fi
fi fi
...@@ -295,11 +314,32 @@ fi ...@@ -295,11 +314,32 @@ fi
date_sec=`date +%S` date_sec=`date +%S`
if echo "$VNCVIEWERCMD" | grep '^sleep[ ][ ]*[0-9][0-9]*' > /dev/null; then
if [ "X$SS_VNCVIEWER_LISTEN_PORT" = "X" ]; then
p=`echo "$VNCVIEWERCMD" | awk '{print $3}'`
if [ "X$p" != "X" ]; then
SS_VNCVIEWER_LISTEN_PORT=$p
fi
fi
p2=`echo "$VNCVIEWERCMD" | awk '{print $2}'`
VNCVIEWERCMD="eval sleep $p2; echo Local "
elif echo "$VNCVIEWERCMD" | grep '^xmessage[ ][ ]*[0-9][0-9]*' > /dev/null; then
if [ "X$SS_VNCVIEWER_LISTEN_PORT" = "X" ]; then
p=`echo "$VNCVIEWERCMD" | awk '{print $2}'`
SS_VNCVIEWER_LISTEN_PORT=$p
fi
fi
findfree() { findfree() {
try0=$1 try0=$1
try=$try0 try=$try0
use0="" use0=""
if [ "X$SS_VNCVIEWER_LISTEN_PORT" != "X" ]; then
echo "$SS_VNCVIEWER_LISTEN_PORT"
return
fi
while [ $try -lt 6000 ] while [ $try -lt 6000 ]
do do
if [ "X$inuse" = "X" ]; then if [ "X$inuse" = "X" ]; then
...@@ -763,10 +803,10 @@ if [ "X$direct_connect" != "X" ]; then ...@@ -763,10 +803,10 @@ if [ "X$direct_connect" != "X" ]; then
echo "" echo ""
echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode." echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode."
echo "" echo ""
echo "$VNCVIEWERCMD" "$@" -listen $N echo "$VNCVIEWERCMD" "$@" -listen $disp
trap "final" 0 2 15 trap "final" 0 2 15
echo "" echo ""
$VNCVIEWERCMD "$@" -listen $N $VNCVIEWERCMD "$@" -listen $disp
fi fi
exit $? exit $?
fi fi
......
...@@ -73,8 +73,8 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto ...@@ -73,8 +73,8 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0'); serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0');
diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSLSocketToMe.java diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSLSocketToMe.java
--- vnc_javasrc.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500 --- vnc_javasrc.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500
+++ vnc_javasrc/SSLSocketToMe.java 2007-02-21 23:27:10.000000000 -0500 +++ vnc_javasrc/SSLSocketToMe.java 2007-03-31 23:33:21.000000000 -0400
@@ -0,0 +1,1366 @@ @@ -0,0 +1,1371 @@
+/* +/*
+ * SSLSocketToMe.java: add SSL encryption to Java VNC Viewer. + * SSLSocketToMe.java: add SSL encryption to Java VNC Viewer.
+ * + *
...@@ -470,6 +470,13 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL ...@@ -470,6 +470,13 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL
+ public void check_for_proxy() { + public void check_for_proxy() {
+ +
+ boolean result = false; + boolean result = false;
+
+ trusturlCerts = null;
+ proxy_in_use = false;
+ if (viewer.ignoreProxy) {
+ return;
+ }
+
+ String ustr = "https://" + host + ":"; + String ustr = "https://" + host + ":";
+ if (viewer.httpsPort != null) { + if (viewer.httpsPort != null) {
+ ustr += viewer.httpsPort; + ustr += viewer.httpsPort;
...@@ -479,8 +486,6 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL ...@@ -479,8 +486,6 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL
+ ustr += viewer.urlPrefix + "/check.https.proxy.connection"; + ustr += viewer.urlPrefix + "/check.https.proxy.connection";
+ dbg("ustr is: " + ustr); + dbg("ustr is: " + ustr);
+ +
+ trusturlCerts = null;
+ proxy_in_use = false;
+ +
+ try { + try {
+ URL url = new URL(ustr); + URL url = new URL(ustr);
...@@ -1443,8 +1448,8 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL ...@@ -1443,8 +1448,8 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL
+} +}
diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncViewer.java diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncViewer.java
--- vnc_javasrc.orig/VncViewer.java 2004-03-04 08:34:25.000000000 -0500 --- vnc_javasrc.orig/VncViewer.java 2004-03-04 08:34:25.000000000 -0500
+++ vnc_javasrc/VncViewer.java 2007-02-21 23:24:37.000000000 -0500 +++ vnc_javasrc/VncViewer.java 2007-03-31 23:35:26.000000000 -0400
@@ -88,6 +88,16 @@ @@ -88,6 +88,17 @@
int deferCursorUpdates; int deferCursorUpdates;
int deferUpdateRequests; int deferUpdateRequests;
...@@ -1455,13 +1460,14 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView ...@@ -1455,13 +1460,14 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
+ String httpsPort; + String httpsPort;
+ String oneTimeKey; + String oneTimeKey;
+ boolean forceProxy; + boolean forceProxy;
+ boolean ignoreProxy;
+ boolean trustAllVncCerts; + boolean trustAllVncCerts;
+ boolean trustUrlVncCert; + boolean trustUrlVncCert;
+ +
// Reference to this applet for inter-applet communication. // Reference to this applet for inter-applet communication.
public static java.applet.Applet refApplet; public static java.applet.Applet refApplet;
@@ -626,6 +636,63 @@ @@ -626,6 +637,68 @@
// SocketFactory. // SocketFactory.
socketFactory = readParameter("SocketFactory", false); socketFactory = readParameter("SocketFactory", false);
...@@ -1510,17 +1516,22 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView ...@@ -1510,17 +1516,22 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncView
+ forceProxy = false; + forceProxy = false;
+ str = readParameter("forceProxy", false); + str = readParameter("forceProxy", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {
+ forceProxy = true; + forceProxy = true;
+ }
+ ignoreProxy = false;
+ str = readParameter("ignoreProxy", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) {
+ ignoreProxy = true;
+ } + }
+ trustAllVncCerts = false; + trustAllVncCerts = false;
+ str = readParameter("trustAllVncCerts", false); + str = readParameter("trustAllVncCerts", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {
+ trustAllVncCerts = true; + trustAllVncCerts = true;
+ } + }
+ trustUrlVncCert = false; + trustUrlVncCert = false;
+ str = readParameter("trustUrlVncCert", false); + str = readParameter("trustUrlVncCert", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) { + if (str != null && str.equalsIgnoreCase("Yes")) {
+ trustUrlVncCert = true; + trustUrlVncCert = true;
+ } + }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment