Commit 8e3cc1ea authored by Julien Muchembled's avatar Julien Muchembled

Clarify description of protocol between nodes

parent 9be8cf80
......@@ -372,7 +372,7 @@ class BaseTunnelManager(object):
self._makeTunnel(peer, msg)
else:
return ';'.join(self._address.itervalues())
elif not code: # ver
elif not code: # network version
if peer:
try:
if msg == self._version:
......@@ -402,7 +402,7 @@ class BaseTunnelManager(object):
else:
if code == 3 and tunnel_killer.state == 'locked': # response
self._kill(peer)
elif code == 4:
elif code == 4: # node information
if not msg:
return version.version
elif code == 5:
......
# -*- coding: utf-8 -*-
import calendar, hashlib, hmac, logging, os, struct, subprocess, threading, time
from collections import deque
from datetime import datetime
from OpenSSL import crypto
from . import utils
......@@ -164,12 +163,12 @@ class Peer(object):
hello0: 0, A
1, fingerprint(B), A
hello: 2, X = E(B)(secret), S(A)(X)
!hello: #, ver, type, value, HMAC(secret)(payload)
└──── payload ────┘
hello: 2, X = encrypt(B, secret), sign(A, X)
!hello: #, type, value, hmac(secret, payload)
└── payload ──┘
new secret > old secret
(concat timestamp with random bits)
(timestamp + random bits)
Reject messages with # smaller or equal than previously processed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment