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
6bd995ec
Commit
6bd995ec
authored
Jun 05, 2006
by
steven_carr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better support for RFB >= 3.8 protocols
parent
a75a576e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
22 deletions
+43
-22
auth.c
libvncserver/auth.c
+43
-22
No files found.
libvncserver/auth.c
View file @
6bd995ec
...
@@ -119,6 +119,28 @@ rfbVncAuthSendChallenge(rfbClientPtr cl)
...
@@ -119,6 +119,28 @@ rfbVncAuthSendChallenge(rfbClientPtr cl)
cl
->
state
=
RFB_AUTHENTICATION
;
cl
->
state
=
RFB_AUTHENTICATION
;
}
}
/*
* Send the NO AUTHENTICATION. SCARR
*/
static
void
rfbVncAuthNone
(
rfbClientPtr
cl
)
{
uint32_t
authResult
;
if
(
cl
->
protocolMajorVersion
==
3
&&
cl
->
protocolMinorVersion
>
7
)
{
rfbLog
(
"rfbProcessClientSecurityType: returning securityResult for client rfb versin >= 3.8
\n
"
);
authResult
=
Swap32IfLE
(
rfbVncAuthOK
);
if
(
rfbWriteExact
(
cl
,
(
char
*
)
&
authResult
,
4
)
<
0
)
{
rfbLogPerror
(
"rfbAuthProcessClientMessage: write"
);
rfbCloseClient
(
cl
);
return
;
}
}
cl
->
state
=
RFB_INITIALISATION
;
return
;
}
/*
/*
* Advertise the supported security types (protocol 3.7). Here before sending
* Advertise the supported security types (protocol 3.7). Here before sending
...
@@ -129,12 +151,18 @@ rfbVncAuthSendChallenge(rfbClientPtr cl)
...
@@ -129,12 +151,18 @@ rfbVncAuthSendChallenge(rfbClientPtr cl)
* Different security types will be added by applications using this library.
* Different security types will be added by applications using this library.
*/
*/
static
rfbSecurityHandler
primaryVncSecurityHandler
=
{
static
rfbSecurityHandler
VncSecurityHandlerVncAuth
=
{
1
,
rfbSecTypeVncAuth
,
rfbVncAuthSendChallenge
,
rfbVncAuthSendChallenge
,
NULL
NULL
};
};
static
rfbSecurityHandler
VncSecurityHandlerNone
=
{
rfbSecTypeNone
,
rfbVncAuthNone
,
NULL
};
static
void
static
void
rfbSendSecurityTypeList
(
rfbClientPtr
cl
,
int
primaryType
)
rfbSendSecurityTypeList
(
rfbClientPtr
cl
,
int
primaryType
)
...
@@ -146,10 +174,15 @@ rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
...
@@ -146,10 +174,15 @@ rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
#define MAX_SECURITY_TYPES 255
#define MAX_SECURITY_TYPES 255
uint8_t
buffer
[
MAX_SECURITY_TYPES
+
1
];
uint8_t
buffer
[
MAX_SECURITY_TYPES
+
1
];
/* Fill in the list of security types in the client structure. */
if
(
primaryType
!=
rfbSecTypeInvalid
)
{
/* Fill in the list of security types in the client structure. (NOTE: Not really in the client structure) */
primaryVncSecurityHandler
.
type
=
primaryType
;
switch
(
primaryType
)
{
rfbRegisterSecurityHandler
(
&
primaryVncSecurityHandler
);
case
rfbSecTypeNone
:
rfbRegisterSecurityHandler
(
&
VncSecurityHandlerNone
);
break
;
case
rfbSecTypeVncAuth
:
rfbRegisterSecurityHandler
(
&
VncSecurityHandlerVncAuth
);
break
;
}
}
for
(
handler
=
securityHandlers
;
for
(
handler
=
securityHandlers
;
...
@@ -265,7 +298,6 @@ rfbProcessClientSecurityType(rfbClientPtr cl)
...
@@ -265,7 +298,6 @@ rfbProcessClientSecurityType(rfbClientPtr cl)
int
n
;
int
n
;
uint8_t
chosenType
;
uint8_t
chosenType
;
rfbSecurityHandler
*
handler
;
rfbSecurityHandler
*
handler
;
uint32_t
authResult
;
/* Read the security type. */
/* Read the security type. */
n
=
rfbReadExact
(
cl
,
(
char
*
)
&
chosenType
,
1
);
n
=
rfbReadExact
(
cl
,
(
char
*
)
&
chosenType
,
1
);
...
@@ -281,24 +313,13 @@ rfbProcessClientSecurityType(rfbClientPtr cl)
...
@@ -281,24 +313,13 @@ rfbProcessClientSecurityType(rfbClientPtr cl)
/* Make sure it was present in the list sent by the server. */
/* Make sure it was present in the list sent by the server. */
for
(
handler
=
securityHandlers
;
handler
;
handler
=
handler
->
next
)
{
for
(
handler
=
securityHandlers
;
handler
;
handler
=
handler
->
next
)
{
if
(
chosenType
==
handler
->
type
)
{
if
(
chosenType
==
handler
->
type
)
{
if
(
chosenType
==
rfbSecTypeNone
)
{
rfbLog
(
"rfbProcessClientSecurityType: executing handler for type %d
\n
"
,
chosenType
);
authResult
=
Swap32IfLE
(
rfbVncAuthOK
);
if
(
rfbWriteExact
(
cl
,
(
char
*
)
&
authResult
,
4
)
<
0
)
{
rfbLogPerror
(
"rfbAuthProcessClientMessage: write"
);
rfbCloseClient
(
cl
);
return
;
}
cl
->
state
=
RFB_INITIALISATION
;
return
;
}
else
{
handler
->
handler
(
cl
);
handler
->
handler
(
cl
);
return
;
return
;
}
}
}
}
}
rfbLog
(
"rfbProcessClientSecurityType: wrong security type
requested
\n
"
);
rfbLog
(
"rfbProcessClientSecurityType: wrong security type
(%d) requested
\n
"
,
chosenType
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
}
}
...
...
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