From 33e1462999d78bafff55be9723a90c6498d2d9e8 Mon Sep 17 00:00:00 2001 From: Dmitry Sankevich Date: Wed, 16 Dec 2015 15:35:23 +0600 Subject: [PATCH] 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 --- core/rfb.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/rfb.js b/core/rfb.js index 7af87407..0718c89d 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -815,6 +815,11 @@ // second pass, do the sub-auth negotiation if (this._sock.rQwait("sub auth count", 4)) { return false; } 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; } var clientSupportedTypes = {