{
case SecTypeNone:
case SecTypeVncAuth:
+ case SecTypePlain:
writeInt(secTypes[i]);
return secTypes[i];
}
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.
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);
}