Revision: 4193
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4193&view=rev
Author:   atkac
Date:     2010-11-11 14:06:42 +0000 (Thu, 11 Nov 2010)

Log Message:
-----------
[Development] java: Implement Plain Security type. (Martin Koegler)

Modified Paths:
--------------
    trunk/java/src/com/tigervnc/vncviewer/RfbProto.java
    trunk/java/src/com/tigervnc/vncviewer/VncViewer.java

Modified: trunk/java/src/com/tigervnc/vncviewer/RfbProto.java
===================================================================
--- trunk/java/src/com/tigervnc/vncviewer/RfbProto.java 2010-11-11 13:25:14 UTC 
(rev 4192)
+++ trunk/java/src/com/tigervnc/vncviewer/RfbProto.java 2010-11-11 14:06:42 UTC 
(rev 4193)
@@ -430,6 +430,7 @@
                {
                case SecTypeNone:
                case SecTypeVncAuth:
+               case SecTypePlain:
                    writeInt(secTypes[i]);
                    return secTypes[i];
                }
@@ -475,6 +476,17 @@
     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.

Modified: trunk/java/src/com/tigervnc/vncviewer/VncViewer.java
===================================================================
--- trunk/java/src/com/tigervnc/vncviewer/VncViewer.java        2010-11-11 
13:25:14 UTC (rev 4192)
+++ trunk/java/src/com/tigervnc/vncviewer/VncViewer.java        2010-11-11 
14:06:42 UTC (rev 4193)
@@ -384,6 +384,14 @@
            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);
        }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to