Closed stze closed 8 years ago
Before merging, the nonce should be adjusted.
If there is no more reason to not merge this into master, please merge. Waiting for the client and synchronzing seems irrelevant or the wrong approach to me, because every developer is able to switch between branches.
I'm unable to connect two clients at the same time to the core properly. The crypto tunnel message of the second client is considered invalid.
I get "sb: establishing crypto tunnel failed"
on the server side. I tested a few combinations and it seems like the first attempt to connect is always successful and every attempt afterwards is never successful
The error occurs in crypto.c:133
/* check if box can be opened (authentication) */
if (crypto_box_open_afternm(allzeroboxed, allzeroboxed, 96, nonce,
clientshortserverlong))
goto fail;
The error can be reproduced using this script (modify & clone to test with two connecting plugins):
from splonecli import Plugin, RemoteFunction
@RemoteFunction
def foo():
pass
plug = Plugin(
"<api_key>",
"foo",
"bar",
"some",
"thing",
debug=True)
plug.connect("127.0.0.1", 6666)
plug.register()
plug.listen()
I've fixed the problem. There was one memzero
too much :wink:
This PR introduces a crypto stack implementation based on tweetnacl library.