Properly filter list of auth schemes

We do _not_ support scheme 1 through 16, only 1, 2, and 16 (and 22).
This commit is contained in:
Samuel Mannehed 2016-08-29 15:00:24 +02:00
parent a7127fee73
commit d5bbe50eb5
1 changed files with 11 additions and 2 deletions

View File

@ -739,8 +739,17 @@
var types = this._sock.rQshiftBytes(num_types); var types = this._sock.rQshiftBytes(num_types);
Util.Debug("Server security types: " + types); Util.Debug("Server security types: " + types);
for (var i = 0; i < types.length; i++) { for (var i = 0; i < types.length; i++) {
if (types[i] > this._rfb_auth_scheme && (types[i] <= 16 || types[i] == 22)) { switch (types[i]) {
this._rfb_auth_scheme = types[i]; case 1: // None
case 2: // VNC Authentication
case 16: // Tight
case 22: // XVP
if (types[i] > this._rfb_auth_scheme) {
this._rfb_auth_scheme = types[i];
}
break;
default:
break;
} }
} }