-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add Support for Encrypted/Authenticated Listeners #2129
base: dev
Are you sure you want to change the base?
Conversation
2ca7d4c
to
db24984
Compare
db24984
to
374a197
Compare
- created option to add encrypted listeners with paired pubkeys in unordered_map, plus access verification - pubkeys stored in unordered set, changed lambda for listen_curve - pubkeys are comma-delimited and paired with bind address in config file
463d83f
to
802ad46
Compare
e8c1b77
to
15e7caa
Compare
- error logging update to newer log::warning
15e7caa
to
29180a3
Compare
This is going to need some deeper changes in lokinet to make it work w.r.t. to lokinet-side "server" pubkey, so for right now let's put this on hold until we can come back to it (likely after some other refactors are merged). Some notes on what is required to make this work follow. The main issue is where we specify the OMQ listener keypair: right now, we default-construct the What we need here is two pieces:
This gets complicated, though, because we have to re-create the OxenMQ instance after we get this keypair and give it the new keypair we got from oxend. In storage server, we solve this problem by using two OxenMQ instances: we create a temporary one during instantiation that only has one job: connecting to oxend and getting the keys. This basically blocks startup until it succeeds, at which point we destroy that object and reconstruct a new OxenMQ using the just-fetched private key. Lokinet likely needs to do something similar, but currently that is difficult because of how the OxenMQ instance is embedded in the Router instance (and this is the instance that we use to get the keys from oxend). Likely a solution here is going to require us setting up a temporary OxenMQ instance to extract the keys very early in the startup (before we construct the router god object) and passing those keys into Router construction so that the OxenMQ instance that Router owns can get constructed with the keys.
This file-backed private key we then feed into the Router construction (similar to the snode case) so that it creates the OxenMQ instance with this key. |
An alternative here would be to update OxenMQ to support a per-socket key in the |
User can specify encrypted listener addresses and comma-delimited public keys to be accepted by exposed encrypted listener. Keys must be attached to a listener address.
Example:
bind_curve=tcp://0.0.0.0:1234|pubkeyA,pubkeyB
bind_curve=tcp://0.0.0.0:5678|pubkeyC,pubkeyD
In the given example above, port 1234 is only accessible by whitelisted pubkeys A and B, while 5678 is accessible by C and D.
Fixes: #2122