diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-11 12:39:05 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-11 12:39:05 +0200 |
| commit | 0fb433690c0ca5f9561fe9e2e973e2cd61b873ba (patch) | |
| tree | 9422a034b09d1e0b46144f35a1f9bcf7860156d6 /client/cmixclient.hpp | |
| parent | d8e48c32f8435076382543edfafbf81c223f9e87 (diff) | |
| download | cmix-0fb433690c0ca5f9561fe9e2e973e2cd61b873ba.tar.gz cmix-0fb433690c0ca5f9561fe9e2e973e2cd61b873ba.tar.bz2 cmix-0fb433690c0ca5f9561fe9e2e973e2cd61b873ba.zip | |
Commit introducing Client keyexchange, triggering bugs.
Clients now send their public key to each node and the node calculates
the shared secret. The node does not yet respond with it's public key.
To keep this commit smaller.
Nodes now disconnect from each other in a better way.
Getting the relevant crypto api is now done with a generic function.
What crypto algorithm and implemenation is beign used can be selected in
the cmake cache (use cmake-gui or ccmake)
Clients now connect correctly to multiple nodes.
Diffstat (limited to 'client/cmixclient.hpp')
| -rw-r--r-- | client/cmixclient.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/client/cmixclient.hpp b/client/cmixclient.hpp index 10438d1..5c6405a 100644 --- a/client/cmixclient.hpp +++ b/client/cmixclient.hpp @@ -2,6 +2,7 @@ #include "node.hpp" +#include "api.h" #include "logging.hpp" #include "client.hpp" #include "connect.hpp" @@ -22,10 +23,20 @@ class CMixClient { std::vector<NodeDetails> network_details; std::vector<Node> network_connections; - void initialized(); + Api api; + KeyPair keypair; + std::vector<SharedKey> shared_keys; + + void key_exchange(int i); void initialize_connections(); + cmix_proto::CMixMessage parse_cmix_message(std::vector<uint8_t> const& buffer); + + void handle_key_exchange(int node_id, cmix_proto::KeyExchange const& ke); + + void handle_message(int node_id, std::vector<uint8_t> const& message_buffer); + public: CMixClient(std::vector<NodeDetails> details); |
