Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path build and onioned messages #2216

Merged
merged 10 commits into from Nov 27, 2023
Merged

Conversation

tewinget
Copy link
Collaborator

@tewinget tewinget commented Oct 23, 2023

WIP

depends #2213

llarp/link/link_manager.cpp Outdated Show resolved Hide resolved
llarp/link/link_manager.hpp Show resolved Hide resolved
llarp/path/abstracthophandler.hpp Outdated Show resolved Hide resolved
llarp/path/path.cpp Outdated Show resolved Hide resolved
llarp/path/path_context.hpp Outdated Show resolved Hide resolved
llarp/service/endpoint.cpp Outdated Show resolved Hide resolved
llarp/service/endpoint.cpp Outdated Show resolved Hide resolved
llarp/service/endpoint.cpp Show resolved Hide resolved
llarp/service/endpoint.cpp Show resolved Hide resolved
llarp/service/endpoint.hpp Show resolved Hide resolved
there are a few TODOs which merit further discussion
- control messages can be sent along a path
- the path owner onion-encrypts the "inner" message for each hop in the
  path
- relays on the path will onion the payload in both directions, such
  that the terminal relay will get the plaintext "inner" message and the
  client will get the plaintext "response" to that.
- control messages have (mostly, see below) been changed to be invokable
  either over a path or directly to a relay, as appropriate.

TODO:
  - exit messages need looked at, so they have not yet been changed for
    this
  - path transfer messages (traffic from client to client over 2 paths
    with a shared "pivot") are not yet implemented
It seems RC refactor will obviate the need for a "get individual RC"
method, so this comments out some usage of that to sidestep build
errors, rather than correcting them in a way that will just be wasted.
llarp/messages/common.hpp Outdated Show resolved Hide resolved
llarp/crypto/crypto.cpp Show resolved Hide resolved
llarp/path/path.cpp Show resolved Hide resolved
llarp/path/transit_hop.cpp Show resolved Hide resolved
@tewinget tewinget marked this pull request as ready for review November 7, 2023 21:32
tewinget and others added 4 commits November 8, 2023 15:12
change path control message inner message response to take just a
string, which will be a bt-encoded response with an early key for
status.  If there is a timeout we pass a bt dict that only has that as
the status, else the response we de-onioned should have either an OK
status or some other error.

change messages to use new status key

correctly call Path::EnterState on path build response
Lots of code was using 32-byte nonces for xchacha20 symmetric
encryption, but this just means 8 extra bytes per packet wasted as
chacha is only using the first 24 bytes of that nonce anyway.

Changing this resulted in a lot of dead/dying code breaking, so this
commit also removes a lot of that (and comments a couple places with
TODO instead)

Also nounce -> nonce where it came up.
It's unnecessary abstraction that barely simplifies anything, and is now
only used in one single place anyway, which is easily replaced with a
(unabstracted) lambda.
llarp/link/link_manager.cpp Outdated Show resolved Hide resolved
llarp/crypto/crypto.hpp Show resolved Hide resolved
@dr7ana dr7ana merged commit e58e847 into oxen-io:quic-wip Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants