CamiloGarciaLaRotta / Cebolla

:left_right_arrow: Simplified Onion Routing Network App
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Establishment fails for subsequent users #33

Closed DestructiveReasoning closed 6 years ago

DestructiveReasoning commented 6 years ago

When testing the onion network with multiple users communicating through the same onion nodes, the establishment process fails for nodes after the first one. The onion router in the middle of the path seems to have trouble decrypting, getting a unicode decode error.

DestructiveReasoning commented 6 years ago

Starting progress in multiUserEstabFail-33

DestructiveReasoning commented 6 years ago

Commit 593f54d resolves the issue.

I must have gotten confused when implementing the crypto, because OnionNodeSecurityEnforcers are needed in the two_way_transfer function (in router/onion_router.py) for peeling layers of symmetric encryption during the establishment process, and they are needed in forward_transfer and backward_transfer for peeling layers while routing data messages. For some reason, I had created a global OnionNodeSecurityEnforcer to keep it consistent in the three functions mentioned, however that is obviously flawed, because it disrupts everything when a router is on multiple paths. Each thread within onion_router must have its own independent OnionNodeSecurityEnforcer, which has been known for a while. Stupid mistake on my part.