aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorBrian P. Hinz <bphinz@users.sf.net>2016-01-17 10:57:51 -0500
committerBrian P. Hinz <bphinz@users.sf.net>2016-01-17 10:57:51 -0500
commit43147c38f9a08e687b9a0d7c9ede44eb058907f9 (patch)
treeb8f938db1a9b3b97847874630940eae151567d8c /java
parenta6a52a414902fbebede9c98c446753eedda91987 (diff)
downloadtigervnc-43147c38f9a08e687b9a0d7c9ede44eb058907f9.tar.gz
tigervnc-43147c38f9a08e687b9a0d7c9ede44eb058907f9.zip
Add workaround for Vino's VeNCrypt implementation to Java viewer
Implemented Pierre's workaround (1f8aba3) to java viewer.
Diffstat (limited to 'java')
-rw-r--r--java/com/tigervnc/rfb/Security.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/java/com/tigervnc/rfb/Security.java b/java/com/tigervnc/rfb/Security.java
index d841c632..a68ae3e9 100644
--- a/java/com/tigervnc/rfb/Security.java
+++ b/java/com/tigervnc/rfb/Security.java
@@ -1,6 +1,6 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright (C) 2010 TigerVNC Team
- * Copyright (C) 2011 Brian P. Hinz
+ * Copyright (C) 2011-2015 Brian P. Hinz
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -76,7 +76,19 @@ public class Security {
{
List<Integer> result = new ArrayList<Integer>();
- result.add(secTypeVeNCrypt);
+ /* Partial workaround for Vino's stupid behaviour. It doesn't allow
+ * the basic authentication types as part of the VeNCrypt handshake,
+ * making it impossible for a client to do opportunistic encryption.
+ * At least make it possible to connect when encryption is explicitly
+ * disabled. */
+ for (Iterator<Integer> i = enabledSecTypes.iterator(); i.hasNext(); ) {
+ int refType = (Integer)i.next();
+ if (refType >= 0x100) {
+ result.add(secTypeVeNCrypt);
+ break;
+ }
+ }
+
for (Iterator<Integer> i = enabledSecTypes.iterator(); i.hasNext(); ) {
int refType = (Integer)i.next();
if (refType < 0x100)