Add support for Unix Tight auth
This commit is contained in:
parent
5b453ed4a8
commit
1c9826140a
26
core/rfb.js
26
core/rfb.js
|
@ -976,6 +976,23 @@ export default class RFB extends EventTargetMixin {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_negotiate_tight_unix_auth() {
|
||||||
|
if (this._rfb_credentials.username === undefined ||
|
||||||
|
this._rfb_credentials.password === undefined) {
|
||||||
|
this.dispatchEvent(new CustomEvent(
|
||||||
|
"credentialsrequired",
|
||||||
|
{ detail: { types: ["username", "password"] } }));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._sock.send([0, 0, 0, this._rfb_credentials.username.length]);
|
||||||
|
this._sock.send([0, 0, 0, this._rfb_credentials.password.length]);
|
||||||
|
this._sock.send_string(this._rfb_credentials.username);
|
||||||
|
this._sock.send_string(this._rfb_credentials.password);
|
||||||
|
this._rfb_init_state = "SecurityResult";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
_negotiate_tight_tunnels(numTunnels) {
|
_negotiate_tight_tunnels(numTunnels) {
|
||||||
const clientSupportedTunnelTypes = {
|
const clientSupportedTunnelTypes = {
|
||||||
0: { vendor: 'TGHT', signature: 'NOTUNNEL' }
|
0: { vendor: 'TGHT', signature: 'NOTUNNEL' }
|
||||||
|
@ -1043,7 +1060,8 @@ export default class RFB extends EventTargetMixin {
|
||||||
|
|
||||||
const clientSupportedTypes = {
|
const clientSupportedTypes = {
|
||||||
'STDVNOAUTH__': 1,
|
'STDVNOAUTH__': 1,
|
||||||
'STDVVNCAUTH_': 2
|
'STDVVNCAUTH_': 2,
|
||||||
|
'TGHTULGNAUTH': 129
|
||||||
};
|
};
|
||||||
|
|
||||||
const serverSupportedTypes = [];
|
const serverSupportedTypes = [];
|
||||||
|
@ -1068,6 +1086,9 @@ export default class RFB extends EventTargetMixin {
|
||||||
case 'STDVVNCAUTH_': // VNC auth
|
case 'STDVVNCAUTH_': // VNC auth
|
||||||
this._rfb_auth_scheme = 2;
|
this._rfb_auth_scheme = 2;
|
||||||
return this._init_msg();
|
return this._init_msg();
|
||||||
|
case 'TGHTULGNAUTH': // UNIX auth
|
||||||
|
this._rfb_auth_scheme = 129;
|
||||||
|
return this._init_msg();
|
||||||
default:
|
default:
|
||||||
return this._fail("Unsupported tiny auth scheme " +
|
return this._fail("Unsupported tiny auth scheme " +
|
||||||
"(scheme: " + authType + ")");
|
"(scheme: " + authType + ")");
|
||||||
|
@ -1097,6 +1118,9 @@ export default class RFB extends EventTargetMixin {
|
||||||
case 16: // TightVNC Security Type
|
case 16: // TightVNC Security Type
|
||||||
return this._negotiate_tight_auth();
|
return this._negotiate_tight_auth();
|
||||||
|
|
||||||
|
case 129: // TightVNC UNIX Security Type
|
||||||
|
return this._negotiate_tight_unix_auth();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return this._fail("Unsupported auth scheme (scheme: " +
|
return this._fail("Unsupported auth scheme (scheme: " +
|
||||||
this._rfb_auth_scheme + ")");
|
this._rfb_auth_scheme + ")");
|
||||||
|
|
Loading…
Reference in New Issue