MCPcopy Create free account
hub / github.com/apache/cloudstack / _negotiatePlainAuth

Method _negotiatePlainAuth

systemvm/agent/noVNC/core/rfb.js:1910–1930  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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; }

Callers 1

Calls 5

encodeUTF8Function · 0.90
dispatchEventMethod · 0.80
sQpush32Method · 0.80
sQpushStringMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected