Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
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
libvncserver
Commits
2f9836d8
Commit
2f9836d8
authored
Sep 14, 2009
by
Vic Lee
Committed by
Johannes Schindelin
Sep 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug for logging unsupported security types
Signed-off-by:
Vic Lee
<
llyzs@163.com
>
parent
4e1aba74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
rfbproto.c
libvncclient/rfbproto.c
+26
-6
No files found.
libvncclient/rfbproto.c
View file @
2f9836d8
...
@@ -531,7 +531,8 @@ InitialiseRFBConnection(rfbClient* client)
...
@@ -531,7 +531,8 @@ InitialiseRFBConnection(rfbClient* client)
uint8_t
count
=
0
;
uint8_t
count
=
0
;
uint8_t
loop
=
0
;
uint8_t
loop
=
0
;
uint8_t
flag
=
0
;
uint8_t
flag
=
0
;
uint8_t
tAuth
=
0
;
uint8_t
tAuth
[
256
];
char
buf1
[
500
],
buf2
[
10
];
if
(
!
ReadFromRFBServer
(
client
,
(
char
*
)
&
count
,
1
))
return
FALSE
;
if
(
!
ReadFromRFBServer
(
client
,
(
char
*
)
&
count
,
1
))
return
FALSE
;
...
@@ -549,23 +550,42 @@ InitialiseRFBConnection(rfbClient* client)
...
@@ -549,23 +550,42 @@ InitialiseRFBConnection(rfbClient* client)
free
(
reason
);
free
(
reason
);
return
FALSE
;
return
FALSE
;
}
}
if
(
count
>
sizeof
(
tAuth
))
{
rfbClientLog
(
"%d security types are too many; maximum is %d
\n
"
,
count
,
sizeof
(
tAuth
));
return
FALSE
;
}
rfbClientLog
(
"We have %d security types to read
\n
"
,
count
);
rfbClientLog
(
"We have %d security types to read
\n
"
,
count
);
authScheme
=
0
;
/* now, we have a list of available security types to read ( uint8_t[] ) */
/* now, we have a list of available security types to read ( uint8_t[] ) */
for
(
loop
=
0
;
loop
<
count
;
loop
++
)
for
(
loop
=
0
;
loop
<
count
;
loop
++
)
{
{
if
(
!
ReadFromRFBServer
(
client
,
(
char
*
)
&
tAuth
,
1
))
return
FALSE
;
if
(
!
ReadFromRFBServer
(
client
,
(
char
*
)
&
tAuth
[
loop
]
,
1
))
return
FALSE
;
rfbClientLog
(
"%d) Received security type %d
\n
"
,
loop
,
tAuth
);
rfbClientLog
(
"%d) Received security type %d
\n
"
,
loop
,
tAuth
[
loop
]
);
if
((
flag
==
0
)
&&
((
tAuth
==
rfbVncAuth
)
||
(
tAuth
==
rfbNoAuth
)))
if
((
flag
==
0
)
&&
((
tAuth
[
loop
]
==
rfbVncAuth
)
||
(
tAuth
[
loop
]
==
rfbNoAuth
)))
{
{
flag
++
;
flag
++
;
authScheme
=
tAuth
;
authScheme
=
tAuth
[
loop
]
;
rfbClientLog
(
"Selecting security type %d (%d/%d in the list)
\n
"
,
authScheme
,
loop
,
count
);
rfbClientLog
(
"Selecting security type %d (%d/%d in the list)
\n
"
,
authScheme
,
loop
,
count
);
/* send back a single byte indicating which security type to use */
/* send back a single byte indicating which security type to use */
if
(
!
WriteToRFBServer
(
client
,
(
char
*
)
&
tAuth
,
1
))
return
FALSE
;
if
(
!
WriteToRFBServer
(
client
,
(
char
*
)
&
tAuth
[
loop
]
,
1
))
return
FALSE
;
}
}
}
}
if
(
authScheme
==
0
)
{
memset
(
buf1
,
0
,
sizeof
(
buf1
));
for
(
loop
=
0
;
loop
<
count
;
loop
++
)
{
if
(
strlen
(
buf1
)
>=
sizeof
(
buf1
)
-
1
)
break
;
snprintf
(
buf2
,
sizeof
(
buf2
),
(
loop
>
0
?
", %d"
:
"%d"
),
(
int
)
tAuth
[
loop
]);
strncat
(
buf1
,
buf2
,
sizeof
(
buf1
)
-
strlen
(
buf1
)
-
1
);
}
rfbClientLog
(
"Unknown authentication scheme from VNC server: %s
\n
"
,
buf1
);
return
FALSE
;
}
}
}
else
else
{
{
...
...
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