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
0f2ac00f
Commit
0f2ac00f
authored
Aug 29, 2011
by
Gernot Tenchio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websockets: use 32bit Xor in webSocketsDecodeHybi()
parent
b16e8c2a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
websockets.c
libvncserver/websockets.c
+10
-5
No files found.
libvncserver/websockets.c
View file @
0f2ac00f
...
...
@@ -626,11 +626,12 @@ static int
webSocketsDecodeHybi
(
rfbClientPtr
cl
,
char
*
dst
,
int
len
)
{
char
*
buf
,
*
payload
;
uint32_t
*
payload32
;
int
ret
=
-
1
,
result
=
-
1
;
int
total
=
0
;
ws_mask_t
mask
;
ws_header_t
*
header
;
int
i
,
j
;
int
i
;
unsigned
char
opcode
;
ws_ctx_t
*
wsctx
=
(
ws_ctx_t
*
)
cl
->
wsctx
;
int
flength
,
fin
,
fhlen
;
...
...
@@ -714,10 +715,14 @@ webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len)
buf
[
ret
]
=
'\0'
;
}
/* process 1 frame */
for
(
i
=
0
;
i
<
flength
;
i
++
)
{
j
=
i
%
4
;
payload
[
i
]
^=
mask
.
c
[
j
];
/* process 1 frame (32 bit op) */
payload32
=
(
uint32_t
*
)
payload
;
for
(
i
=
0
;
i
<
flength
/
4
;
i
++
)
{
payload32
[
i
]
^=
mask
.
u
;
}
/* process the remaining bytes (if any) */
for
(
i
*=
4
;
i
<
flength
;
i
++
)
{
payload
[
i
]
^=
mask
.
c
[
i
%
4
];
}
switch
(
opcode
)
{
...
...
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