Skip to content

Commit

Permalink
Fix to interactively gather credentials for Mac OS X.
Browse files Browse the repository at this point in the history
Changelog update.
Version v5.0.9, buildcode 115090.
  • Loading branch information
iiordanov committed Apr 10, 2022
1 parent daf7e46 commit 1bb69c9
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 42 deletions.
4 changes: 2 additions & 2 deletions CustomVnc-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.CUSTOM_VNC_APP_PACKAGE_NAME"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-permission tools:node="removeAll" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
4 changes: 2 additions & 2 deletions Opaque-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.undatech.opaque"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-feature android:name="android.hardware.usb.host" />
<uses-sdk android:minSdkVersion="12" />
Expand Down
4 changes: 2 additions & 2 deletions aRDP-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.aRDP"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-permission tools:node="removeAll" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
4 changes: 2 additions & 2 deletions aSPICE-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.aSPICE"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-feature android:name="android.hardware.usb.host" />
<uses-sdk android:minSdkVersion="12" />
Expand Down
4 changes: 2 additions & 2 deletions bVNC-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.bVNC"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-permission tools:node="removeAll" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
2 changes: 2 additions & 0 deletions bVNC/CHANGELOG-bVNC
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
v5.0.9
- Fix to interactively gather credentials for Mac OS X
v5.0.8
- Security library upgrade
- Thumbnail bugfix
Expand Down
43 changes: 19 additions & 24 deletions bVNC/src/main/java/com/iiordanov/bVNC/RfbProto.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@

import com.undatech.opaque.input.RemoteKeyboard;
import com.iiordanov.bVNC.input.RemoteVncKeyboard;
import com.iiordanov.bVNC.*;
import com.iiordanov.freebVNC.*;
import com.iiordanov.aRDP.*;
import com.iiordanov.freeaRDP.*;
import com.iiordanov.aSPICE.*;
import com.iiordanov.freeaSPICE.*;
import com.iiordanov.CustomClientPackage.*;
import com.undatech.opaque.RfbConnectable;
import com.undatech.opaque.util.GeneralUtils;
import com.undatech.remoteClientUi.*;
Expand Down Expand Up @@ -471,11 +464,11 @@ void initializeAndAuthenticate(String host, int port, String us, String pw,
writeVersionMsg();
Log.i(TAG, "Using RFB protocol version " + clientMajor + "." + clientMinor);

int bitPref = 0;
boolean userNameSupplied = false;
if (us.length() > 0)
bitPref |= 1;
Log.d("debug", "bitPref = " + bitPref);
int secType = negotiateSecurity(bitPref, connType);
userNameSupplied = true;
Log.d(TAG, "userNameSupplied: " + userNameSupplied);
int secType = negotiateSecurity(userNameSupplied, connType);
int authType;
if (secType == RfbProto.SecTypeTight) {
Log.i(TAG, "secType == RfbProto.SecTypeTight");
Expand All @@ -488,7 +481,7 @@ void initializeAndAuthenticate(String host, int port, String us, String pw,
} else if (secType == RfbProto.SecTypeTLS) {
Log.i(TAG, "secType == RfbProto.SecTypeTLS");
authenticateTLS();
authType = negotiateSecurity(bitPref, 0);
authType = negotiateSecurity(userNameSupplied, 0);
} else if (secType == RfbProto.SecTypeUltra34 ||
secType == RfbProto.SecTypeUltraVnc2) {
Log.i(TAG, "secType == RfbProto.SecTypeUltra34 or SecTypeUltraVnc2");
Expand All @@ -497,9 +490,7 @@ void initializeAndAuthenticate(String host, int port, String us, String pw,
Log.i(TAG, "secType == RfbProto.SecTypeArd");
RFBSecurityARD ardAuth = new RFBSecurityARD(us, pw);
ardAuth.perform(this);
if (is.readInt() == 1) {
throw new Exception("Error from VNC server: " + readString());
}
readSecurityResult("ARD Authentication");
return;
} else {
authType = secType;
Expand Down Expand Up @@ -610,19 +601,19 @@ synchronized void writeVersionMsg() throws IOException {
// Negotiate the authentication scheme.
//

int negotiateSecurity(int bitPref, int connType) throws Exception {
int negotiateSecurity(boolean userNameSupplied, int connType) throws Exception {
if (clientMinor >= 7) {
return selectSecurityType(bitPref, connType);
return selectSecurityType(userNameSupplied, connType);
} else {
return readSecurityType(bitPref);
return readSecurityType(userNameSupplied);
}
}

//
// Read security type from the server (protocol version 3.3).
//

int readSecurityType(int bitPref) throws Exception {
int readSecurityType(boolean userNameSupplied) throws Exception {
int secType = is.readInt();

switch (secType) {
Expand All @@ -634,8 +625,9 @@ int readSecurityType(int bitPref) throws Exception {
return secType;
case SecTypeUltra34:
case SecTypeUltraVnc2:
if ((bitPref & 1) == 1)
if (userNameSupplied) {
return secType;
}
throw new RfbUsernameRequiredException("Username required.");
default:
throw new Exception("Unknown security type from RFB server: " + secType);
Expand All @@ -646,7 +638,7 @@ int readSecurityType(int bitPref) throws Exception {
// Select security type from the server's list (protocol versions 3.7/3.8).
//

int selectSecurityType(int bitPref, int connType) throws Exception {
int selectSecurityType(boolean userNameSupplied, int connType) throws Exception {
android.util.Log.i(TAG, "(Re)Selecting security type.");

int secType = SecTypeInvalid;
Expand Down Expand Up @@ -702,9 +694,12 @@ int selectSecurityType(int bitPref, int connType) throws Exception {
break;
}

if ((bitPref & 1) != 0 && secTypes[i] == SecTypeArd) {
secType = secTypes[i];
break;
if (secTypes[i] == SecTypeArd) {
if (userNameSupplied) {
secType = secTypes[i];
break;
}
throw new RfbUsernameRequiredException("Username required.");
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions bVNC/src/main/java/com/iiordanov/bVNC/dialogs/GetTextFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
textBox2 = (EditText) v.findViewById(R.id.textBox2);
textBox3 = (EditText) v.findViewById(R.id.textBox3);
hideText(textBox3);
textBox3.requestFocus();
if (t1 == null || t1.length() == 0) {
textBox.requestFocus();
} else {
textBox3.requestFocus();
}
checkboxKeepPassword = v.findViewById(R.id.checkboxKeepPassword);
buttonConfirm = (Button) v.findViewById(R.id.buttonConfirm);
buttonCancel = (Button) v.findViewById(R.id.buttonCancel);
Expand All @@ -212,7 +216,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
textBox = (EditText) v.findViewById(R.id.textBox);
textBox2 = (EditText) v.findViewById(R.id.textBox2);
hideText(textBox2);
textBox2.requestFocus();
if (t1 == null || t1.length() == 0) {
textBox.requestFocus();
} else {
textBox2.requestFocus();
}
checkboxKeepPassword = v.findViewById(R.id.checkboxKeepPassword);
buttonConfirm = (Button) v.findViewById(R.id.buttonConfirm);
buttonCancel = (Button) v.findViewById(R.id.buttonCancel);
Expand Down
4 changes: 2 additions & 2 deletions freeaRDP-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.freeaRDP"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-permission tools:node="removeAll" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
4 changes: 2 additions & 2 deletions freeaSPICE-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.freeaSPICE"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-permission tools:node="removeAll" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
4 changes: 2 additions & 2 deletions freebVNC-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.iiordanov.freebVNC"
android:installLocation="auto"
android:versionCode="115085"
android:versionName="v5.0.8">
android:versionCode="115090"
android:versionName="v5.0.9">

<uses-permission tools:node="removeAll" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down

0 comments on commit 1bb69c9

Please sign in to comment.