()
| 2113 | } |
| 2114 | |
| 2115 | _handleSecurityResult() { |
| 2116 | if (this._sock.rQwait('VNC auth response ', 4)) { return false; } |
| 2117 | |
| 2118 | const status = this._sock.rQshift32(); |
| 2119 | |
| 2120 | if (status === 0) { // OK |
| 2121 | this._rfbInitState = 'ClientInitialisation'; |
| 2122 | Log.Debug('Authentication OK'); |
| 2123 | return true; |
| 2124 | } else { |
| 2125 | if (this._rfbVersion >= 3.8) { |
| 2126 | this._rfbInitState = "SecurityReason"; |
| 2127 | this._securityContext = "security result"; |
| 2128 | this._securityStatus = status; |
| 2129 | return true; |
| 2130 | } else { |
| 2131 | this.dispatchEvent(new CustomEvent( |
| 2132 | "securityfailure", |
| 2133 | { detail: { status: status } })); |
| 2134 | |
| 2135 | return this._fail("Security handshake failed"); |
| 2136 | } |
| 2137 | } |
| 2138 | } |
| 2139 | |
| 2140 | _negotiateServerInit() { |
| 2141 | if (this._sock.rQwait("server initialization", 24)) { return false; } |
no test coverage detected