Signed-off-by: Martin Koegler <mkoeg...@auto.tuwien.ac.at>
---
 java/src/com/tigervnc/vncviewer/RfbProto.java  |   12 ++++++++++++
 java/src/com/tigervnc/vncviewer/VncViewer.java |    8 ++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/java/src/com/tigervnc/vncviewer/RfbProto.java 
b/java/src/com/tigervnc/vncviewer/RfbProto.java
index ab3c152..a0aade0 100644
--- a/java/src/com/tigervnc/vncviewer/RfbProto.java
+++ b/java/src/com/tigervnc/vncviewer/RfbProto.java
@@ -430,6 +430,7 @@ class RfbProto {
                {
                case SecTypeNone:
                case SecTypeVncAuth:
+               case SecTypePlain:
                    writeInt(secTypes[i]);
                    return secTypes[i];
                }
@@ -475,6 +476,17 @@ class RfbProto {
     readSecurityResult("VNC authentication");
   }
 
+    void authenticatePlain(String User, String Password) throws Exception {
+      byte[] user=User.getBytes();
+      byte[] password=Password.getBytes();
+      writeInt(user.length);
+      writeInt(password.length);
+      os.write(user);
+      os.write(password);
+
+      readSecurityResult("Plain authentication");
+    }
+
   //
   // Read security result.
   // Throws an exception on authentication failure.
diff --git a/java/src/com/tigervnc/vncviewer/VncViewer.java 
b/java/src/com/tigervnc/vncviewer/VncViewer.java
index 19541af..41f484f 100644
--- a/java/src/com/tigervnc/vncviewer/VncViewer.java
+++ b/java/src/com/tigervnc/vncviewer/VncViewer.java
@@ -384,6 +384,14 @@ public class VncViewer extends java.applet.Applet
            secType = rfb.authenticateVeNCrypt();
            doAuthentification(secType);
            break;
+       case RfbProto.SecTypePlain:
+           showConnectionStatus("Plain authentication");
+           {
+               String user = askUser();
+               String pw = askPassword();
+               rfb.authenticatePlain(user,pw);
+           }
+           break;
        default:
            throw new Exception("Unknown authentication scheme " + secType);
        }
-- 
1.5.6.5


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel

Reply via email to