Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
67b24a90
Commit
67b24a90
authored
May 15, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support 3.7.
parent
56ec48be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
vnc.js
vnc.js
+24
-22
No files found.
vnc.js
View file @
67b24a90
...
...
@@ -125,8 +125,8 @@ mouse_arr : [],
init_msg
:
function
()
{
console
.
log
(
">> init_msg [RFB.state '"
+
RFB
.
state
+
"']"
);
var
RQ
=
RFB
.
RQ
,
verstr
,
strlen
,
reason
,
reason_len
,
s
erver_
version
,
types
,
num_types
,
challenge
,
response
,
var
RQ
=
RFB
.
RQ
,
strlen
,
reason
,
reason_len
,
s
version
,
c
version
,
types
,
num_types
,
challenge
,
response
,
bpp
,
depth
,
big_endian
,
true_color
,
name_length
;
//console.log("RQ (" + RQ.length + ") " + RQ);
...
...
@@ -138,27 +138,29 @@ init_msg: function () {
"Disconnected: incomplete protocol version"
);
return
;
}
server_version
=
RQ
.
shiftStr
(
12
).
substr
(
0
,
11
);
console
.
log
(
"Server ProtocolVersion: "
+
server_version
);
if
((
server_version
===
"RFB 003.003"
)
||
(
RFB
.
max_version
===
3.3
))
{
RFB
.
version
=
3.3
;
verstr
=
"RFB 003.003"
;
RFB
.
send_string
(
verstr
+
"
\n
"
);
RFB
.
updateState
(
'Security'
,
"Sent ProtocolVersion: "
+
verstr
);
}
else
if
(
server_version
===
"RFB 003.008"
)
{
RFB
.
version
=
3.8
;
verstr
=
"RFB 003.008"
;
RFB
.
send_string
(
verstr
+
"
\n
"
);
RFB
.
updateState
(
'Security'
,
"Sent ProtocolVersion: "
+
verstr
);
}
else
{
RFB
.
updateState
(
'failed'
,
"Invalid server version "
+
server_version
);
return
;
sversion
=
RQ
.
shiftStr
(
12
).
substr
(
4
,
7
);
console
.
log
(
"Server ProtocolVersion: "
+
sversion
);
switch
(
sversion
)
{
case
"003.003"
:
RFB
.
version
=
3.3
;
break
;
case
"003.007"
:
RFB
.
version
=
3.7
;
break
;
case
"003.008"
:
RFB
.
version
=
3.8
;
break
;
default
:
RFB
.
updateState
(
'failed'
,
"Invalid server version "
+
sversion
);
return
;
}
if
(
RFB
.
version
>
RFB
.
max_version
)
{
RFB
.
version
=
RFB
.
max_version
;
}
cversion
=
"00"
+
parseInt
(
RFB
.
version
,
10
)
+
".00"
+
((
RFB
.
version
*
10
)
%
10
);
RFB
.
send_string
(
"RFB "
+
cversion
+
"
\n
"
);
RFB
.
updateState
(
'Security'
,
"Sent ProtocolVersion: "
+
sversion
);
break
;
case
'Security'
:
if
(
RFB
.
version
===
3.8
)
{
if
(
RFB
.
version
>=
3.7
)
{
num_types
=
RQ
.
shift8
();
if
(
num_types
===
0
)
{
strlen
=
RQ
.
shift32
();
...
...
@@ -181,7 +183,7 @@ init_msg: function () {
RFB
.
auth_scheme
=
types
[
0
];
}
RFB
.
send_array
([
RFB
.
auth_scheme
]);
}
else
if
(
RFB
.
version
===
3.3
)
{
}
else
{
if
(
RQ
.
length
<
4
)
{
RFB
.
updateState
(
'failed'
,
"Invalid security frame"
);
return
;
...
...
@@ -244,11 +246,11 @@ init_msg: function () {
RFB
.
updateState
(
'ServerInitialisation'
,
"Authentication OK"
);
break
;
case
1
:
// failed
if
(
RFB
.
version
==
=
3.8
)
{
if
(
RFB
.
version
>
=
3.8
)
{
reason_len
=
RQ
.
shift32
();
reason
=
RQ
.
shiftStr
(
reason_len
);
RFB
.
updateState
(
'failed'
,
reason
);
}
else
if
(
RFB
.
version
===
3.3
)
{
}
else
{
RFB
.
updateState
(
'failed'
,
"Authentication failed"
);
}
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment