Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
vncproxy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b14033ba
authored
Jun 26, 2022
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mod. of requirements + _mask fix
parent
3d8f6266
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
proxy.py
+4
-2
requirements/base.txt
+1
-1
websockets.py
+3
-2
No files found.
proxy.py
View file @
b14033ba
...
...
@@ -78,9 +78,11 @@ class ProxyClientFactory(protocol.ReconnectingClientFactory):
class
VNCWebSocketHandler
(
Protocol
):
src
=
None
def
makeConnection
(
self
,
transport
):
try
:
settings
.
configure
()
if
not
settings
.
configured
:
settings
.
configure
()
value
=
signing
.
loads
(
transport
.
request
.
args
[
b
'd'
][
0
]
.
decode
(),
key
=
PROXY_SECRET
,
max_age
=
KEY_MAX_AGE
)
try
:
...
...
@@ -93,7 +95,7 @@ class VNCWebSocketHandler(Protocol):
except
Exception
as
e
:
src
=
getattr
(
self
,
'src'
,
None
)
logger
.
warning
(
'Server(
%
s): bad connection, key=
%
s err=
%
s'
,
src
,
transport
.
request
.
args
[
'd'
][
0
],
e
)
src
,
transport
.
request
.
args
[
b
'd'
][
0
],
e
)
transport
.
loseConnection
()
return
logger
.
info
(
"Server(
%
s): new connection, host=
%
s, port=
%
s"
,
...
...
requirements/base.txt
View file @
b14033ba
cryptography==36.0.1
Django==3.2.3
Twisted==
16.6
.0
Twisted==
22.4
.0
pyOpenSSL==21.0.0
service-identity
websockets.py
View file @
b14033ba
...
...
@@ -12,6 +12,7 @@ factory.
@since: 13.2
"""
import
six
import
base64
import
struct
from
hashlib
import
sha1
...
...
@@ -108,7 +109,7 @@ def _mask(buf, key):
buf
=
list
(
buf
)
for
i
,
char
in
enumerate
(
buf
):
buf
[
i
]
=
chr
(
char
^
key
[
i
%
4
])
return
""
.
join
(
buf
)
return
six
.
b
(
""
.
join
(
buf
)
)
def
_makeFrame
(
buf
,
opcode
,
fin
,
mask
=
None
):
...
...
@@ -163,7 +164,7 @@ def _parseFrames(frameBuffer, needMask=True):
removing the parsed content from it.
@param frameBuffer: A buffer of bytes.
@type frameBuffer: C{list}
@type frameBuffer: C{list}
--- NO C(bytes) !!!!!
@param needMask: If C{True}, refuse any frame which is not masked.
@type needMask: C{bool}
...
...
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