summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-08-18 15:01:52 +0200
committerPierre Ossman <ossman@cendio.se>2022-08-18 16:26:27 +0200
commit795494ade1bab6a14fd45e02dbaba52301df65f1 (patch)
tree18c83e04857cb64e88046ca573cee96c6a9e69c1 /tests
parente1174e813b617062c77491c01130c38b45f15311 (diff)
downloadnovnc-795494ade1bab6a14fd45e02dbaba52301df65f1.tar.gz
Prefer security types in the server's order
This is how TigerVNC has been behaving for years and has worked well there, so let's follow them.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.rfb.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/test.rfb.js b/tests/test.rfb.js
index e7d6040..0e46ff4 100644
--- a/tests/test.rfb.js
+++ b/tests/test.rfb.js
@@ -1135,18 +1135,10 @@ describe('Remote Frame Buffer Protocol Client', function () {
client._sock._websocket._getSentData();
});
- it('should prefer no authentication is possible', function () {
- const authSchemes = [2, 1, 3];
+ it('should respect server preference order', function () {
+ const authSchemes = [ 6, 79, 30, 188, 16, 6, 1 ];
client._sock._websocket._receiveData(new Uint8Array(authSchemes));
- expect(client._rfbAuthScheme).to.equal(1);
- expect(client._sock).to.have.sent(new Uint8Array([1]));
- });
-
- it('should choose for the most prefered scheme possible', function () {
- const authSchemes = [2, 22, 16];
- client._sock._websocket._receiveData(new Uint8Array(authSchemes));
- expect(client._rfbAuthScheme).to.equal(22);
- expect(client._sock).to.have.sent(new Uint8Array([22]));
+ expect(client._sock).to.have.sent(new Uint8Array([30]));
});
it('should fail if there are no supported schemes', function () {