Commit Graph

161 Commits

Author SHA1 Message Date
Jedrzej Stuczynski 68dac6266e Updated version numbers 2020-09-10 14:17:01 +01:00
Jędrzej Stuczyński 6aada422ec placeholder contact form url (#334)
* placeholder contact form url

* Gateway URL update

* Mixnode url update
2020-09-10 14:08:48 +01:00
Jędrzej Stuczyński 9efc195046 Explicit proxy runner + closing local connection if remote is over (#314)
* Updated built dependency

So that it wouldn't fail on nwindows

* Concurrent RW client-side

* Draft of a ProxyRunner

* Super experimental proxy runner for provider

Very much WIP

* Extracting shared code + cleanup

* Logging cleanup

* Removed redundant close request
2020-08-27 13:59:37 +01:00
Jędrzej Stuczyński d9d549fd0f Feature/reply surbs (#299)
* Changed identity keypair to use ed25519

* Encryption key is now x25519 based + compatibiltiy with sphinx

* Pathing and import fixes

* Moved all asymmetric keys to sub-module in crypto

* Extracted aes to separate module

* kdf module in crypto

* Ability to perform diffie hellman on encryption keys

* ecdsa on identity keys

* Extremely rough and incomplete registration handshake

* Authentication primitives

* Creating new random authenticationIV

* Wrapper type for the derived shared key

* Removed AuthToken in favour of using SharedKey for authentication

* Gateway identity keys

* Registration handshake without error mapping

* Gateway address in client config

* Added extra key for gateway presence

* Updated pemstore to work on borrows instead

* Gateway client trying to perform the handshake

* Gateway changes to allow for handshake and shared key

* Debug trait on sharedkey

* native client using updated gateway client

* Slightly updated gateway API

* Minor cleanup

* Fixed pemstore to correctly save multiple keypairs

* Gateway actually deriving shared key during handshake

* Gateway sending correct mid-handshake message

* Missing quotation mark in client config template

* Fixed template for correct shared key serialization

* Fixed gateway authentication

* Fixed tests

* Using correct gateway key when converting to sphinx node

* "get_all_clients" takes them from gateways as opposed to providers now

* cargo fmt

* Renamed pemstore methods

* Unused import

* Encryption of forward requests between client and gateway

* Updated sphinx dependency to use public revision

* Sending 'error' on handshake processing error

* Removed some dead code

* Dead code I forgot to remove before

* Extracted AckAes128Key into a struct

* Slight pemstore revamp allowing for symmetric key store

* ibid.

* PemStorableKey for SharedKey

* Introduced single location responsible for key management for client

* WIP

* Sphinx version update

* Stop using NodeAddressBytes for two distinct and confusing purposes

* Abstracting away SocketAddr from sphinx forwarding

* Passing the bool for reply surbs

* Attack plan for replies + encryption

* Comment + removed variable binding

* ReplySURB usage

* Topology import in nymsphinx

* Sphinx version update

* Changed 'Recipient' to contain client's encryption key

* Message preparation taking shape!

* reply surb also containing the encryption key

* Very initial message receiver

* Sphinx version update

* A possibly working way of receiving surbs

* Fixed incorrect field name in client config template

* camel casing all request arguments

* Renamed and moved `MessageMode` to more appropriate file

* Restored reconstruction tests

* Removed dead code from chunking

* Made rust examples compilable

* reply SURB key storage

* Replies as an InputMessage

* Forgotten commented code

* No retransmission processing for cover or replies

* Received reply processing

* Renamed client pathfinder to something more appropriate

* Made HasherOutputSize public

* Added key store path to config

* Reply surb attaching key digest when used

* Changes due to previous renaming

* Removed comment

* Fixed insert_encryption_key

* Assigning initial value of key store path

* Computing key digest with correct algorithm

* Initial and presumably temporary request serialization

* hacky way of introducing 'FragmentIdentifier' for replies

* Moved responsibility of reply encryption, padding, etc, to message preparer

* Optional recipient in try_get_valid_topology_ref

* Handling new reply surbs with acks and padding

* Updated go and python examples to include replies in text and binary cases

* Updated rust examples + binaryserverresponse

* Helpers in rust examples

* And updated JS example

* Moved shared key generation function to crypto crate

* Cover traffic encryption!

* hmac computation in crypto

* Updated aes imports due to new dependencies

* hkdf made more generic

* crypto cleanup + algorithms in params

* Clippy cleanup pass

* Generating encryption+mac shared keys between client and gateway

* MACs attached to forward requests to gateway

* Gateway messages encrypted and mac'd

* Lowered logging level

* compiler warning cleanup

* Some minor cleanup

* Generic stream cipher

* Generic shared key derivation + algorithm definitions

* Project-wide AES clean-up

* Comment fix

* Removed commented imports

* Updated comments

* Fixed topology test fixture
2020-08-07 18:16:54 +01:00
Jędrzej Stuczyński e849e45b12 Feature/gateway shared key generation (#272)
* Changed identity keypair to use ed25519

* Encryption key is now x25519 based + compatibiltiy with sphinx

* Pathing and import fixes

* Moved all asymmetric keys to sub-module in crypto

* Extracted aes to separate module

* kdf module in crypto

* Ability to perform diffie hellman on encryption keys

* ecdsa on identity keys

* Extremely rough and incomplete registration handshake

* Authentication primitives

* Creating new random authenticationIV

* Wrapper type for the derived shared key

* Removed AuthToken in favour of using SharedKey for authentication

* Gateway identity keys

* Registration handshake without error mapping

* Gateway address in client config

* Added extra key for gateway presence

* Updated pemstore to work on borrows instead

* Gateway client trying to perform the handshake

* Gateway changes to allow for handshake and shared key

* Debug trait on sharedkey

* native client using updated gateway client

* Slightly updated gateway API

* Minor cleanup

* Fixed pemstore to correctly save multiple keypairs

* Gateway actually deriving shared key during handshake

* Gateway sending correct mid-handshake message

* Missing quotation mark in client config template

* Fixed template for correct shared key serialization

* Fixed gateway authentication

* Fixed tests

* Using correct gateway key when converting to sphinx node

* "get_all_clients" takes them from gateways as opposed to providers now

* cargo fmt

* Renamed pemstore methods

* Unused import

* Encryption of forward requests between client and gateway

* Updated sphinx dependency to use public revision

* Sending 'error' on handshake processing error

* Removed some dead code
2020-06-30 12:01:45 +01:00
Jędrzej Stuczyński fcfe463efa Feature/wasm topology duplication (#265)
* Removed constructor from NymTopology trait + split directory_client

* Removed bunch of duplicate wasm topology code

* Post-merge changes
2020-06-16 12:12:19 +01:00
Jędrzej Stuczyński b57a548350 Feature/packet retransmission (#263)
* Ability to send sphinx packets of different sizes + more efficient decoding

* Closing connection on connection corruption

* Missing semicolons

* Missing license notices

* Default for packetsize

* Split nymsphinx

* Replaced Mutex with RwLock for TopologyAccessor + impl Deref

* Sphinx update + import cleanup

* Moved packet_sizes file

* Updated NymTopology API

* sphinx version bump

* Missing license notice

* nymsphinx-params crate

* Changes due to ibid.

* Chunking rework to allow variable size fragments

* Initial ack crate

* Version bump to new dev build

* Cargo lock changes

* random_route_to_gateway by node address

* exposing getting read permit

* Very initial draft on ack control

* Correctly dereferencing out of topology read permit

* All pending changes + compilation todo!s

* Restricted scope of deref on TopologyAccessorInner

* Type path alias for generate_key

* Derived traits for MessageChunker

* Ack control starting to take shape!

* Awaiting callbacks

* Most of work done on acks. Now to wire it all together

* Import cleanup

* rng generalization

* Connected real traffic together; only acks from gateway left

* Removed redundant things from nymsphinx::utils

* nymsphinx-cover crate

* Ack-related fields in client config

* Decreased packet store log level

* Restored forward sphinx request

* Slight adjustements to surb acks

* Changed TopologyReadPermit from type alias into a struct

* Changes due to ibid.

* Sphinx version upgrade

* Gateway being able to understand and handle acks

* Special Cover FragmentIdentifier + removal of dead code

* Initial packet router for gateway client

* Kill client if it fails to send to gateway too many times

* Cover messages with acks

* Moved out gateway client errors

* Ignoring cover traffic acks

* Changes in ack control

* Another sphinx version upgrade

* websocket handler delegating message chunking

* Using config defined ack wait additions

* Other minor changes I should have been more dilligent with splitting

* Import path fix

* sphinx_receiver => mixnet_receiver

* Missing renamed variable instance

* Updated aes-ctr to 0.4.0

* Removed concept of 'unfragmented' single fragment

* Replay fragments detection

* Long method split

* typo

* Cleaner client init

* Fixed race condition

* Fixed similar issue for retransmission

* Cargo fmt

* Minor clenaup
2020-06-16 11:22:02 +01:00
jstuczyn 5e78515216 Version bump 2020-06-02 12:21:42 +01:00
Jędrzej Stuczyński 860a69b246 Feature/sphinx socket packet encoder (#245)
* Ability to send sphinx packets of different sizes + more efficient decoding

* Closing connection on connection corruption

* Missing semicolons

* Missing license notices

* Default for packetsize
2020-05-27 10:08:08 +01:00
Jędrzej Stuczyński 3773800133 Feature/start local network improvements (#228)
* Moved directory_server from Debug section of configs

* Using correct variable path

* Updated start_local_network script

* Actually killing gateways on startup

* Removed redundant stop_local_network.sh

* The Canadian appeasement accord
2020-05-13 12:01:51 +01:00
Jędrzej Stuczyński ff2e24afbc Updated directory_client reqwest to 0.10 (#226)
* Updated directory_client reqwest to 0.10

* Using consistent syntax
2020-05-12 12:52:31 +01:00
Jędrzej Stuczyński c3e18cedd5 Feature/load keys on run (#220)
* Mixnode keys loaded in run command

* Client keys loaded in run command

* Removed unused imports
2020-05-06 16:17:02 +01:00
Jędrzej Stuczyński fa1bcabe5a Fixed compilation warnings on unreachable code when compiling with features flag (#215) 2020-05-05 13:16:56 +01:00
Jędrzej Stuczyński abbf7041a4 Feature/gateway provider merge (#208)
* Initial draft for ClientsHandler

* Created listener struct

* typo

* Stateful websocket connection handler

* Exposing modules

* Depdendencies updates

* Moved listener to correct file + made start consume listener

* Main starting new listener

* Catching sigint

* Copied client storage from provider into gateway

* Exposed websocket listener type for nicer import path

* Defined websocket message receiver concrete type

* Client ledger struct without implementation

* ClientsHandler using more concrete types

* Mixnet sender + receiver and exposed listener type

* Handling mix packets

* Ability to forward mix packets

* "starting" both listeners at main

* Depedencies updates

* Initial type definitions for client messages

* Initial "gateway-requests" with AuthToken

* ibid.

* Restored most of ledger's functionalities

* Ability to retrieve all messages regardless of rate limit

* ClientsHandler request handling logic

* Required 'new' dependencies

* Main changes required for compilation

* PacketProcessor getting private key pointer

* "moved" types into gateway requests crate

* Moved and renamed types

* ibid.

* Added required serde_json dependency

* Skeleton for websocket request handling

* helper methods on ServerResponse

* WebSocket Handler pushing received mix messages directly to client

* PacketForwarder returning JoinHandle alongside the channel

* ClientsHandler following the same pattern

* Made websocket listener start method consistent with mix listener

* Syntax error + formatting

* Websocket handler having access to mix forwarder

* Minimal binary request parsing

* Implicitly derived std::error::Error on GatewayRequestsError

* Handling of all websocket requests

* Types import cleanup

* Updated placeholder fields

* Everything put into main

* Missing license notices

* Cleaned up unused code

* Copied and did initial minor changes to commands and config

* It's actually gateway

* Gateway sending its regular presence to directory server

* Re-organisation of gateway code + Gateway struct

* Updated provider argument description

* Restored duplicate ip check without importing NymTopology trait

* Moved hardcoded values into config

* Cargo fmt

* Compilation errors in other crates due to topology adjustments

* Test fixes

* Initial gateway-client

* Seemingly working version with bunch of hardcoded and temporary values

* cargo fmt

* Removed provider poller

* Updated config with gateway values instead of provider

* Gateway address including ws

* Removed hardcoded gateway address

* Properly skipping loop cover messages

* Updated log filter with tokio tungstenite related modules

* Updated sphinx version used

* Very minor cleanup

* unused import
2020-04-30 10:14:21 +01:00
Dave Hrycyszyn 8baa236d81 Feature/wasm js demo (#191)
* Moved `nym-sphinx-wasm` into `wasm` folder and renamed its examples

* A proposal for some structural cleanup

* desktop client: beginning of a Rust example for chunking.

* Simplifying desktop client readme

* Tarting up webassembly README

* A more visual webassembly client example

* clients/webassembly: grouping a few things into named functions for clarity

* clients/webassembly: put URLs at top of file, prepping for drop-down action

* mixnode + provider run: changed startup error messages a bit

* clients/webassembly: scrolling from the bottom in the demo
2020-04-21 10:05:38 +01:00
Jędrzej Stuczyński 4af5788bba Feature/limit direct sphinx dependency + remove direct curve25519 dependency from wasm client (#189)
* Initial set of re-exported sphinx types and constants

* Removed direct sphinx dependency from healthchecker

* Crypto module

* nym-client no longer needing sphinx

* All common modules

* mix-client until removed

* Sfw-provider no longer depending on sphinx crate

* Mixnode no longe depending directly on sphinx crate

* Ibid. for sfw-provider-requests

* Corrected import inside nymsphinx itself

* wasm client no longer needing direct sphinx dependency

* Required gateway change due to re-exporting constants in one place

* Missing import path changes in tests

* Removed direct dependency on curve25519 from wasm client

* Lock file changes
2020-04-20 16:59:51 +01:00
Jędrzej Stuczyński fda308694e Feature/very minor refactoring (#188)
* log statement for forwarding traffic

* Mixnode logging intent to forward packet

* Presence logging level decrease + making things less public

* Default adjustments + human readable equivalents in comments

* Do not immediately refresh topology on start
2020-04-17 18:59:22 +01:00
Dave Hrycyszyn 7088fb3ffc Upgraded all Sphinx commits to latest. 2020-04-15 13:08:31 +01:00
Dave Hrycyszyn 3c8aad49fc Updated all uses of ed25519-dalek to 2.0.0 so that wasm-pack build works 2020-04-09 17:20:22 +01:00
Dave Hrycyszyn 0d33d35437 nym-sphinx-wasm: updating to latest Sphinx 2020-04-09 16:41:01 +01:00
Dave Hrycyszyn 3f06ccc36b Adding Apache 2 license headers to all files (#178) 2020-04-09 11:24:24 +01:00
Dave Hrycyszyn cb82299f0e Bumped version numbers to 0.7.0-dev 2020-04-07 17:33:26 +01:00
Dave Hrycyszyn d47f0be2f2 Bumping version numbers 2020-04-07 17:29:46 +01:00
Jędrzej Stuczyński 3b6110a42e Feature/tcp client connection timeout (#176)
* Added timeout values to configs

* Fixed possible crash when using delay larger than 2 years

* Connection timeout with hardcoded value

* Using provided timeout value

* tcp client requiring timeout value at construction

* Client using updated tcp client

* Mixnode using updated tcp client

* Healthchecker having separate timeout + new client config field

* Updated validator with connection timeout field

* Added connection_timeout to validator config template
2020-04-07 15:50:23 +01:00
Jędrzej Stuczyński 7e1c957090 Feature/mixing stats logging (#175)
* Extra startup log messages

* Type alias for sent metrics map

* Initial metrics informer

* Separated report and running stats

* Decreases report logging level

* Added logging delay as a config value

* New metrics informer constructor

* Determining if running stats should be logged

* Separated running total and reports logging

* Missing changes
2020-04-07 11:21:12 +01:00
Jędrzej Stuczyński 6766cf3470 Feature/non mandatory debug config (#173)
* configs no longer need to have all debug fields set

* Removed debug section from config template of mixnode, provider and validator

* Significantly reduced debug section in client config template
2020-04-06 16:32:34 +01:00
Jędrzej Stuczyński b564cd935e Feature/addressing move (#169)
* Moved 'addressing' to nymsphinx + slightly better API + tests

* Replaced all usages of above in the project

* Removed 'split_and_encapsulate_message' from chunking API to get rid of circular dependency + to prefer usage of TopologyAccessor

* changes in Cargo.lock

* formatting
2020-04-03 15:07:02 +01:00
Jędrzej Stuczyński d859a98367 Checking if any other node is already announcing the same host (#168) 2020-04-02 15:39:14 +01:00
Jędrzej Stuczyński d02e248328 Bugfix/closing tcp client connections on drop (#167)
* Filtering out early eof errors

* Wrapping ConnectionManager in Abortable

* Decreased pathchecker logging level

* Client aborting all connection futures on drop

* Moved AbortHandle to connection_managers HashMap to couple them closer together
2020-04-02 15:38:21 +01:00
Jędrzej Stuczyński aee3286793 Feature/packet chunking (#158)
Basic support for message chunking and reconstruction. It's now possible to take arbitrarily-sized input and send it through the mixnet. The sending Nym client will automatically chunk the input into Sphinx packets, and the receiving Nym client will then reconstruct the message at the other end.
2020-03-31 16:00:41 +01:00
Dave Hrycyszyn d576a17d33 New cargo versions for top-level binaries 2020-03-23 10:35:19 +00:00
Dave Hrycyszyn 5caf093dca Some more startup fixes 2020-03-20 12:56:26 +00:00
Jędrzej Stuczyński eae2fe675d Merge pull request #151 from nymtech/feature/remove-startup-warnings
Friendlification of startup messages
2020-03-19 11:55:30 +00:00
jstuczyn 776a857779 Entering runtime context when creating packet forwarder 2020-03-19 11:32:44 +00:00
Dave Hrycyszyn 3ccaf77249 mixnode, sfw-provider: no need to expose deep internals to users first thing 2020-03-19 11:18:43 +00:00
jstuczyn 3b2461080c Changed the multi-tcp client to have an option to wait for an error response 2020-03-16 17:04:26 +00:00
jstuczyn 270d7567df Merge branch 'develop' into feature/concurrent_connection_managers 2020-03-16 15:08:36 +00:00
Dave Hrycyszyn b2789bf2a1 Merge pull request #148 from nymtech/feature/windows_fix
Making code work on windows machines.
2020-03-16 15:06:21 +00:00
Jędrzej Stuczyński 560b01974f Merge pull request #145 from nymtech/feature/simplify-setup
Extracting the log setup
2020-03-16 14:22:28 +00:00
jstuczyn c0044499da Missing quoation mark 2020-03-16 13:33:09 +00:00
Dave Hrycyszyn d8e4c8d24d Extracting logging setup for all binaries 2020-03-16 13:22:15 +00:00
jstuczyn f5e3e10707 Updated merged changes in config to be consistent with previous updates 2020-03-16 13:12:15 +00:00
jstuczyn 2eb237cc0e Merge branch 'develop' into feature/windows_fix 2020-03-16 13:08:26 +00:00
jstuczyn 5d2fb6bdfa Updated quotation marks used in config templates to work on windows with paths containing \U sequences 2020-03-16 12:37:09 +00:00
Jedrzej Stuczynski ab5656ce94 Updated configs and args with location 2020-03-13 16:34:06 +00:00
Jedrzej Stuczynski fe85fefb5b Client and mixnode adjustments due to previous changes 2020-03-12 16:24:04 +00:00
Jedrzej Stuczynski e8a5320ae6 Defaulting for global 'Info' logging level if not set in .env 2020-03-11 14:53:28 +00:00
Jedrzej Stuczynski c625c00d58 Using log builder to include timestamps + filters 2020-03-11 10:36:24 +00:00
Jedrzej Stuczynski 858481e1d2 Changed presence and metrics interval to use deadlines rather than fixed delays 2020-03-10 10:11:59 +00:00
Jedrzej Stuczynski a9a3e98801 Reverts changes in 744a004d06 2020-03-10 09:26:44 +00:00