()
| 1908 | } |
| 1909 | |
| 1910 | _negotiatePlainAuth() { |
| 1911 | if (this._rfbCredentials.username === undefined || |
| 1912 | this._rfbCredentials.password === undefined) { |
| 1913 | this.dispatchEvent(new CustomEvent( |
| 1914 | "credentialsrequired", |
| 1915 | { detail: { types: ["username", "password"] } })); |
| 1916 | return false; |
| 1917 | } |
| 1918 | |
| 1919 | const user = encodeUTF8(this._rfbCredentials.username); |
| 1920 | const pass = encodeUTF8(this._rfbCredentials.password); |
| 1921 | |
| 1922 | this._sock.sQpush32(user.length); |
| 1923 | this._sock.sQpush32(pass.length); |
| 1924 | this._sock.sQpushString(user); |
| 1925 | this._sock.sQpushString(pass); |
| 1926 | this._sock.flush(); |
| 1927 | |
| 1928 | this._rfbInitState = "SecurityResult"; |
| 1929 | return true; |
| 1930 | } |
| 1931 | |
| 1932 | _negotiateStdVNCAuth() { |
| 1933 | if (this._sock.rQwait("auth challenge", 16)) { return false; } |
no test coverage detected