[go: nahoru, domu]

Skip to content

Commit

Permalink
Allow longer passwords in Plain authentication
Browse files Browse the repository at this point in the history
Some people have longer passwords than 256 characters (hooray for
password managers!). Server implementations also allow longer passwords:
TigerVNC allows up to 1024 characters.
  • Loading branch information
lhchavez committed Mar 4, 2021
1 parent 5a0cceb commit 1859315
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions core/rfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,18 @@ export default class RFB extends EventTargetMixin {
const user = encodeUTF8(this._rfbCredentials.username);
const pass = encodeUTF8(this._rfbCredentials.password);

// XXX we assume lengths are <= 255 (should not be an issue in the real world)
this._sock.send([0, 0, 0, user.length]);
this._sock.send([0, 0, 0, pass.length]);
this._sock.send([
(user.length >> 24) & 0xFF,
(user.length >> 16) & 0xFF,
(user.legnth >> 8) & 0xFF,
user.length & 0xFF
]);
this._sock.send([
(pass.length >> 24) & 0xFF,
(pass.length >> 16) & 0xFF,
(pass.legnth >> 8) & 0xFF,
pass.length & 0xFF
]);
this._sock.sendString(user);
this._sock.sendString(pass);

Expand Down

0 comments on commit 1859315

Please sign in to comment.