Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
re6stnet
Commits
0fc6e204
Commit
0fc6e204
authored
Nov 16, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more migration
parent
66f2c73b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
79 deletions
+137
-79
demo/demo
demo/demo
+127
-73
re6st/plib.py
re6st/plib.py
+1
-1
re6st/registry.py
re6st/registry.py
+2
-2
re6st/tunnel.py
re6st/tunnel.py
+2
-0
re6st/x509.py
re6st/x509.py
+5
-3
No files found.
demo/demo
View file @
0fc6e204
This diff is collapsed.
Click to expand it.
re6st/plib.py
View file @
0fc6e204
...
@@ -85,7 +85,7 @@ def router(ip, ip4, rt6, hello_interval, log_path, state_path, pidfile,
...
@@ -85,7 +85,7 @@ def router(ip, ip4, rt6, hello_interval, log_path, state_path, pidfile,
if
hmac_sign
:
if
hmac_sign
:
def
key
(
cmd
,
id
:
str
,
value
):
def
key
(
cmd
,
id
:
str
,
value
):
cmd
+=
'-C'
,
(
'key type blake2s128 id %s value %s'
%
cmd
+=
'-C'
,
(
'key type blake2s128 id %s value %s'
%
(
id
,
binascii
.
hexlify
(
value
)))
(
id
,
binascii
.
hexlify
(
value
)
.
decode
()
))
key
(
cmd
,
'sign'
,
hmac_sign
)
key
(
cmd
,
'sign'
,
hmac_sign
)
default
+=
' key sign'
default
+=
' key sign'
if
hmac_accept
is
not
None
:
if
hmac_accept
is
not
None
:
...
...
re6st/registry.py
View file @
0fc6e204
...
@@ -814,12 +814,12 @@ class RegistryClient(object):
...
@@ -814,12 +814,12 @@ class RegistryClient(object):
def
__getattr__
(
self
,
name
):
def
__getattr__
(
self
,
name
):
getcallargs
=
getattr
(
RegistryServer
,
name
).
getcallargs
getcallargs
=
getattr
(
RegistryServer
,
name
).
getcallargs
def
rpc
(
*
args
,
**
kw
):
def
rpc
(
*
args
,
**
kw
)
->
bytes
:
kw
=
getcallargs
(
*
args
,
**
kw
)
kw
=
getcallargs
(
*
args
,
**
kw
)
query
=
'/'
+
name
query
=
'/'
+
name
if
kw
:
if
kw
:
if
any
(
type
(
v
)
is
not
str
for
v
in
kw
.
values
()):
if
any
(
type
(
v
)
is
not
str
for
v
in
kw
.
values
()):
raise
TypeError
raise
TypeError
(
kw
)
query
+=
'?'
+
urlencode
(
kw
)
query
+=
'?'
+
urlencode
(
kw
)
url
=
self
.
_path
+
query
url
=
self
.
_path
+
query
client_prefix
=
kw
.
get
(
'cn'
)
client_prefix
=
kw
.
get
(
'cn'
)
...
...
re6st/tunnel.py
View file @
0fc6e204
...
@@ -344,6 +344,8 @@ class BaseTunnelManager(object):
...
@@ -344,6 +344,8 @@ class BaseTunnelManager(object):
peer
.
hello0Sent
()
peer
.
hello0Sent
()
def
_sendto
(
self
,
to
,
msg
,
peer
=
None
):
def
_sendto
(
self
,
to
,
msg
,
peer
=
None
):
if
type
(
msg
)
is
str
:
msg
=
msg
.
encode
()
try
:
try
:
r
=
self
.
sock
.
sendto
(
peer
.
encode
(
msg
)
if
peer
else
msg
,
to
)
r
=
self
.
sock
.
sendto
(
peer
.
encode
(
msg
)
if
peer
else
msg
,
to
)
except
socket
.
error
as
e
:
except
socket
.
error
as
e
:
...
...
re6st/x509.py
View file @
0fc6e204
...
@@ -266,7 +266,7 @@ class Peer(object):
...
@@ -266,7 +266,7 @@ class Peer(object):
seqno_struct
=
struct
.
Struct
(
"!L"
)
seqno_struct
=
struct
.
Struct
(
"!L"
)
def
decode
(
self
,
msg
,
_unpack
=
seqno_struct
.
unpack
)
:
def
decode
(
self
,
msg
:
bytes
,
_unpack
=
seqno_struct
.
unpack
)
->
str
:
seqno
,
=
_unpack
(
msg
[:
4
])
seqno
,
=
_unpack
(
msg
[:
4
])
if
seqno
<=
2
:
if
seqno
<=
2
:
msg
=
msg
[
4
:]
msg
=
msg
[
4
:]
...
@@ -280,10 +280,12 @@ class Peer(object):
...
@@ -280,10 +280,12 @@ class Peer(object):
if
self
.
_hmac
(
msg
[:
i
])
==
msg
[
i
:]
and
self
.
_i
<
seqno
:
if
self
.
_hmac
(
msg
[:
i
])
==
msg
[
i
:]
and
self
.
_i
<
seqno
:
self
.
_last
=
None
self
.
_last
=
None
self
.
_i
=
seqno
self
.
_i
=
seqno
return
msg
[
4
:
i
]
return
msg
[
4
:
i
]
.
decode
()
def
encode
(
self
,
msg
,
_pack
=
seqno_struct
.
pack
)
:
def
encode
(
self
,
msg
:
str
|
bytes
,
_pack
=
seqno_struct
.
pack
)
->
bytes
:
self
.
_j
+=
1
self
.
_j
+=
1
if
type
(
msg
)
is
str
:
msg
=
msg
.
encode
()
msg
=
_pack
(
self
.
_j
)
+
msg
msg
=
_pack
(
self
.
_j
)
+
msg
return
msg
+
self
.
_hmac
(
msg
)
return
msg
+
self
.
_hmac
(
msg
)
...
...
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