Wait for challenge before asking for password

Fixes #928.
This commit is contained in:
Samuel Mannehed 2017-10-16 15:39:10 +02:00
parent b573d985e8
commit abfe5b7a37
1 changed files with 2 additions and 2 deletions

View File

@ -836,13 +836,13 @@ RFB.prototype = {
},
_negotiate_std_vnc_auth: function () {
if (this._sock.rQwait("auth challenge", 16)) { return false; }
if (this._rfb_password.length === 0) {
this._onPasswordRequired(this);
return false;
}
if (this._sock.rQwait("auth challenge", 16)) { return false; }
// TODO(directxman12): make genDES not require an Array
var challenge = Array.prototype.slice.call(this._sock.rQshiftBytes(16));
var response = RFB.genDES(this._rfb_password, challenge);