@novnc/novnc 1.3.0-gfc5bb6d → 1.4.0-beta-gb76358e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AUTHORS CHANGED
@@ -1,9 +1,9 @@
1
1
  maintainers:
2
- - Joel Martin (@kanaka)
3
- - Solly Ross (@directxman12)
4
2
  - Samuel Mannehed for Cendio AB (@samhed)
5
3
  - Pierre Ossman for Cendio AB (@CendioOssman)
6
4
  maintainersEmeritus:
5
+ - Joel Martin (@kanaka)
6
+ - Solly Ross (@directxman12)
7
7
  - @astrand
8
8
  contributors:
9
9
  # There are a bunch of people that should be here.
package/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- noVNC is Copyright (C) 2019 The noVNC Authors
1
+ noVNC is Copyright (C) 2022 The noVNC Authors
2
2
  (./AUTHORS)
3
3
 
4
4
  The noVNC core library files are licensed under the MPL 2.0 (Mozilla
package/README.md CHANGED
@@ -65,10 +65,14 @@ Please tweet [@noVNC](http://www.twitter.com/noVNC) if you do.
65
65
  ### Features
66
66
 
67
67
  * Supports all modern browsers including mobile (iOS, Android)
68
- * Supported VNC encodings: raw, copyrect, rre, hextile, tight, tightPNG
68
+ * Supported authentication methods: none, classical VNC, RealVNC's
69
+ RSA-AES, Tight, VeNCrypt Plain, XVP, Apple's Diffie-Hellman,
70
+ UltraVNC's MSLogonII
71
+ * Supported VNC encodings: raw, copyrect, rre, hextile, tight, tightPNG,
72
+ ZRLE, JPEG
69
73
  * Supports scaling, clipping and resizing the desktop
70
74
  * Local cursor rendering
71
- * Clipboard copy/paste
75
+ * Clipboard copy/paste with full Unicode support
72
76
  * Translations
73
77
  * Touch gestures for emulating common mouse actions
74
78
  * Licensed mainly under the [MPL 2.0](http://www.mozilla.org/MPL/2.0/), see
@@ -203,11 +207,13 @@ See [AUTHORS](AUTHORS) for a (full-ish) list of authors. If you're not on
203
207
  that list and you think you should be, feel free to send a PR to fix that.
204
208
 
205
209
  * Core team:
206
- * [Joel Martin](https://github.com/kanaka)
207
210
  * [Samuel Mannehed](https://github.com/samhed) (Cendio)
208
- * [Solly Ross](https://github.com/DirectXMan12) (Red Hat / OpenStack)
209
211
  * [Pierre Ossman](https://github.com/CendioOssman) (Cendio)
210
212
 
213
+ * Previous core contributors:
214
+ * [Joel Martin](https://github.com/kanaka) (Project founder)
215
+ * [Solly Ross](https://github.com/DirectXMan12) (Red Hat / OpenStack)
216
+
211
217
  * Notable contributions:
212
218
  * UI and Icons : Pierre Ossman, Chris Gordon
213
219
  * Original Logo : Michael Sersen
package/core/des.js CHANGED
@@ -81,7 +81,7 @@
81
81
  const PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3,
82
82
  25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39,
83
83
  50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ],
84
- totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28];
84
+ totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28];
85
85
 
86
86
  const z = 0x0;
87
87
  let a,b,c,d,e,f;
package/core/rfb.js CHANGED
@@ -62,6 +62,7 @@ const securityTypeTight = 16;
62
62
  const securityTypeVeNCrypt = 19;
63
63
  const securityTypeXVP = 22;
64
64
  const securityTypeARD = 30;
65
+ const securityTypeMSLogonII = 113;
65
66
 
66
67
  // Special Tight security types
67
68
  const securityTypeUnixLogon = 129;
@@ -286,6 +287,7 @@ export default class RFB extends EventTargetMixin {
286
287
 
287
288
  this._viewOnly = false;
288
289
  this._clipViewport = false;
290
+ this._clippingViewport = false;
289
291
  this._scaleViewport = false;
290
292
  this._resizeSession = false;
291
293
 
@@ -317,6 +319,16 @@ export default class RFB extends EventTargetMixin {
317
319
 
318
320
  get capabilities() { return this._capabilities; }
319
321
 
322
+ get clippingViewport() { return this._clippingViewport; }
323
+ _setClippingViewport(on) {
324
+ if (on === this._clippingViewport) {
325
+ return;
326
+ }
327
+ this._clippingViewport = on;
328
+ this.dispatchEvent(new CustomEvent("clippingviewport",
329
+ { detail: this._clippingViewport }));
330
+ }
331
+
320
332
  get touchButton() { return 0; }
321
333
  set touchButton(button) { Log.Warn("Using old API!"); }
322
334
 
@@ -748,6 +760,10 @@ export default class RFB extends EventTargetMixin {
748
760
  const size = this._screenSize();
749
761
  this._display.viewportChangeSize(size.w, size.h);
750
762
  this._fixScrollbars();
763
+ this._setClippingViewport(size.w < this._display.width ||
764
+ size.h < this._display.height);
765
+ } else {
766
+ this._setClippingViewport(false);
751
767
  }
752
768
 
753
769
  // When changing clipping we might show or hide scrollbars.
@@ -1392,6 +1408,7 @@ export default class RFB extends EventTargetMixin {
1392
1408
  securityTypeVeNCrypt,
1393
1409
  securityTypeXVP,
1394
1410
  securityTypeARD,
1411
+ securityTypeMSLogonII,
1395
1412
  securityTypePlain,
1396
1413
  ];
1397
1414
 
@@ -1903,6 +1920,62 @@ export default class RFB extends EventTargetMixin {
1903
1920
  return false;
1904
1921
  }
1905
1922
 
1923
+ _negotiateMSLogonIIAuth() {
1924
+ if (this._sock.rQwait("mslogonii dh param", 24)) { return false; }
1925
+
1926
+ if (this._rfbCredentials.username === undefined ||
1927
+ this._rfbCredentials.password === undefined) {
1928
+ this.dispatchEvent(new CustomEvent(
1929
+ "credentialsrequired",
1930
+ { detail: { types: ["username", "password"] } }));
1931
+ return false;
1932
+ }
1933
+
1934
+ const g = this._sock.rQshiftBytes(8);
1935
+ const p = this._sock.rQshiftBytes(8);
1936
+ const A = this._sock.rQshiftBytes(8);
1937
+ const b = window.crypto.getRandomValues(new Uint8Array(8));
1938
+ const B = new Uint8Array(this._modPow(g, b, p));
1939
+ const secret = new Uint8Array(this._modPow(A, b, p));
1940
+
1941
+ const des = new DES(secret);
1942
+ const username = encodeUTF8(this._rfbCredentials.username).substring(0, 255);
1943
+ const password = encodeUTF8(this._rfbCredentials.password).substring(0, 63);
1944
+ const usernameBytes = new Uint8Array(256);
1945
+ const passwordBytes = new Uint8Array(64);
1946
+ window.crypto.getRandomValues(usernameBytes);
1947
+ window.crypto.getRandomValues(passwordBytes);
1948
+ for (let i = 0; i < username.length; i++) {
1949
+ usernameBytes[i] = username.charCodeAt(i);
1950
+ }
1951
+ usernameBytes[username.length] = 0;
1952
+ for (let i = 0; i < password.length; i++) {
1953
+ passwordBytes[i] = password.charCodeAt(i);
1954
+ }
1955
+ passwordBytes[password.length] = 0;
1956
+ let x = new Uint8Array(secret);
1957
+ for (let i = 0; i < 32; i++) {
1958
+ for (let j = 0; j < 8; j++) {
1959
+ x[j] ^= usernameBytes[i * 8 + j];
1960
+ }
1961
+ x = des.enc8(x);
1962
+ usernameBytes.set(x, i * 8);
1963
+ }
1964
+ x = new Uint8Array(secret);
1965
+ for (let i = 0; i < 8; i++) {
1966
+ for (let j = 0; j < 8; j++) {
1967
+ x[j] ^= passwordBytes[i * 8 + j];
1968
+ }
1969
+ x = des.enc8(x);
1970
+ passwordBytes.set(x, i * 8);
1971
+ }
1972
+ this._sock.send(B);
1973
+ this._sock.send(usernameBytes);
1974
+ this._sock.send(passwordBytes);
1975
+ this._rfbInitState = "SecurityResult";
1976
+ return true;
1977
+ }
1978
+
1906
1979
  _negotiateAuthentication() {
1907
1980
  switch (this._rfbAuthScheme) {
1908
1981
  case securityTypeNone:
@@ -1933,6 +2006,9 @@ export default class RFB extends EventTargetMixin {
1933
2006
  case securityTypeRA2ne:
1934
2007
  return this._negotiateRA2neAuth();
1935
2008
 
2009
+ case securityTypeMSLogonII:
2010
+ return this._negotiateMSLogonIIAuth();
2011
+
1936
2012
  default:
1937
2013
  return this._fail("Unsupported auth scheme (scheme: " +
1938
2014
  this._rfbAuthScheme + ")");
@@ -77,27 +77,76 @@ export const hasScrollbarGutter = _hasScrollbarGutter;
77
77
  * It's better to use feature detection than platform detection.
78
78
  */
79
79
 
80
+ /* OS */
81
+
80
82
  export function isMac() {
81
- return navigator && !!(/mac/i).exec(navigator.platform);
83
+ return !!(/mac/i).exec(navigator.platform);
82
84
  }
83
85
 
84
86
  export function isWindows() {
85
- return navigator && !!(/win/i).exec(navigator.platform);
87
+ return !!(/win/i).exec(navigator.platform);
86
88
  }
87
89
 
88
90
  export function isIOS() {
89
- return navigator &&
90
- (!!(/ipad/i).exec(navigator.platform) ||
91
+ return (!!(/ipad/i).exec(navigator.platform) ||
91
92
  !!(/iphone/i).exec(navigator.platform) ||
92
93
  !!(/ipod/i).exec(navigator.platform));
93
94
  }
94
95
 
96
+ export function isAndroid() {
97
+ /* Android sets navigator.platform to Linux :/ */
98
+ return !!navigator.userAgent.match('Android ');
99
+ }
100
+
101
+ export function isChromeOS() {
102
+ /* ChromeOS sets navigator.platform to Linux :/ */
103
+ return !!navigator.userAgent.match(' CrOS ');
104
+ }
105
+
106
+ /* Browser */
107
+
95
108
  export function isSafari() {
96
- return navigator && (navigator.userAgent.indexOf('Safari') !== -1 &&
97
- navigator.userAgent.indexOf('Chrome') === -1);
109
+ return !!navigator.userAgent.match('Safari/...') &&
110
+ !navigator.userAgent.match('Chrome/...') &&
111
+ !navigator.userAgent.match('Chromium/...') &&
112
+ !navigator.userAgent.match('Epiphany/...');
98
113
  }
99
114
 
100
115
  export function isFirefox() {
101
- return navigator && !!(/firefox/i).exec(navigator.userAgent);
116
+ return !!navigator.userAgent.match('Firefox/...') &&
117
+ !navigator.userAgent.match('Seamonkey/...');
118
+ }
119
+
120
+ export function isChrome() {
121
+ return !!navigator.userAgent.match('Chrome/...') &&
122
+ !navigator.userAgent.match('Chromium/...') &&
123
+ !navigator.userAgent.match('Edg/...') &&
124
+ !navigator.userAgent.match('OPR/...');
125
+ }
126
+
127
+ export function isChromium() {
128
+ return !!navigator.userAgent.match('Chromium/...');
102
129
  }
103
130
 
131
+ export function isOpera() {
132
+ return !!navigator.userAgent.match('OPR/...');
133
+ }
134
+
135
+ export function isEdge() {
136
+ return !!navigator.userAgent.match('Edg/...');
137
+ }
138
+
139
+ /* Engine */
140
+
141
+ export function isGecko() {
142
+ return !!navigator.userAgent.match('Gecko/...');
143
+ }
144
+
145
+ export function isWebKit() {
146
+ return !!navigator.userAgent.match('AppleWebKit/...') &&
147
+ !navigator.userAgent.match('Chrome/...');
148
+ }
149
+
150
+ export function isBlink() {
151
+ return !!navigator.userAgent.match('Chrome/...');
152
+ }
@@ -18,6 +18,10 @@ export default class Cursor {
18
18
  this._canvas.style.position = 'fixed';
19
19
  this._canvas.style.zIndex = '65535';
20
20
  this._canvas.style.pointerEvents = 'none';
21
+ // Safari on iOS can select the cursor image
22
+ // https://bugs.webkit.org/show_bug.cgi?id=249223
23
+ this._canvas.style.userSelect = 'none';
24
+ this._canvas.style.WebkitUserSelect = 'none';
21
25
  // Can't use "display" because of Firefox bug #1445997
22
26
  this._canvas.style.visibility = 'hidden';
23
27
  }