Fix TIGHT negotiation with zero sub-auth types

According to the RFB protocol, when in TIGHT auth negotation,
if the client receives a sub-auth count of zero, it should proceed
as if the `None` sub-auth type had already been selected (and not
send a message selecting that type).

Closes #564
This commit is contained in:
Dmitry Sankevich 2015-12-16 15:35:23 +06:00 committed by Solly Ross
parent f9a0404f51
commit 33e1462999
1 changed files with 5 additions and 0 deletions

View File

@ -815,6 +815,11 @@
// second pass, do the sub-auth negotiation // second pass, do the sub-auth negotiation
if (this._sock.rQwait("sub auth count", 4)) { return false; } if (this._sock.rQwait("sub auth count", 4)) { return false; }
var subAuthCount = this._sock.rQshift32(); var subAuthCount = this._sock.rQshift32();
if (subAuthCount === 0) { // empty sub-auth list received means 'no auth' subtype selected
this._updateState('SecurityResult');
return true;
}
if (this._sock.rQwait("sub auth capabilities", 16 * subAuthCount, 4)) { return false; } if (this._sock.rQwait("sub auth capabilities", 16 * subAuthCount, 4)) { return false; }
var clientSupportedTypes = { var clientSupportedTypes = {