Skip to content

Commit

Permalink
Abstract resuming the authentication
Browse files Browse the repository at this point in the history
We now do this in multiple places, so make sure things are handled the
same way in all cases.
  • Loading branch information
CendioOssman committed Aug 18, 2022
1 parent 8a7089c commit 05d68e1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/rfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ export default class RFB extends EventTargetMixin {

sendCredentials(creds) {
this._rfbCredentials = creds;
setTimeout(this._initMsg.bind(this), 0);
this._resumeAuthentication();
}

sendCtrlAltDel() {
Expand Down Expand Up @@ -1661,7 +1661,7 @@ export default class RFB extends EventTargetMixin {
this._rfbCredentials.ardCredentials = encrypted;
this._rfbCredentials.ardPublicKey = clientPublicKey;

setTimeout(this._initMsg.bind(this), 0);
this._resumeAuthentication();
}

_negotiateTightUnixAuth() {
Expand Down Expand Up @@ -2052,6 +2052,14 @@ export default class RFB extends EventTargetMixin {
}
}

// Resume authentication handshake after it was paused for some
// reason, e.g. waiting for a password from the user
_resumeAuthentication() {
// We use setTimeout() so it's run in its own context, just like
// it originally did via the WebSocket's event handler
setTimeout(this._initMsg.bind(this), 0);
}

_handleSetColourMapMsg() {
Log.Debug("SetColorMapEntries");

Expand Down

0 comments on commit 05d68e1

Please sign in to comment.