diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-01 17:40:17 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-01 17:40:17 +0100 |
| commit | 9531b6bea9fb29074c588a4e4e8838f6d9335a2b (patch) | |
| tree | 4d0e9429203bf5976507b43e6663f9fe0b21e6d0 /client/cmixclient.cpp | |
| parent | bdc26e00ad99f4f670df1a65b5e6439d0dfadc87 (diff) | |
| download | cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.tar.gz cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.tar.bz2 cmix-9531b6bea9fb29074c588a4e4e8838f6d9335a2b.zip | |
Moves cmix calculation stuff outisde of the node class.
Moves the computations and cryptography to the the libcmix library
where we can group and memory manage the underlying crypto-library.
Diffstat (limited to 'client/cmixclient.cpp')
| -rw-r--r-- | client/cmixclient.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/cmixclient.cpp b/client/cmixclient.cpp index ea178d3..ba1a187 100644 --- a/client/cmixclient.cpp +++ b/client/cmixclient.cpp @@ -66,7 +66,7 @@ void CMixClient::initialize_connections() { void CMixClient::handle_key_exchange(size_t node_id, cmix_proto::KeyExchange const& ke) { - data.at(node_id).shared_value = api.derive_shared_key(keypair, reinterpret_cast<uint8_t const*>(ke.public_key().c_str()), ke.public_key().size(), reinterpret_cast<uint8_t const*>(ke.value().c_str()), ke.value().size(), data.at(node_id).secret_value, false); + data.at(node_id).shared_value.shared = api.derive_shared_key(keypair, reinterpret_cast<uint8_t const*>(ke.public_key().c_str()), ke.public_key().size(), reinterpret_cast<uint8_t const*>(ke.value().c_str()), ke.value().size(), data.at(node_id).secret_value, false); cmix_proto::Bye bye; network_connections.at(node_id).async_send(bye); @@ -108,7 +108,7 @@ CMixClient::CMixClient(NetworkDetails details) , network_details(details) , network_connections() , api(get_implementation()) -, keypair(api.create_key_pair()) +, keypair(api.create_keypair()) { if(!details.certdir.empty()) { ctx->add_verify_path(details.certdir); @@ -119,7 +119,7 @@ CMixClient::CMixClient(NetworkDetails details) CMixClient::~CMixClient() { - api.free_key_pair(&keypair); + api.free_keypair(&keypair); for(auto&& d : data) { api.free_shared_key(&d.shared_value); api.free_group_element(d.secret_value); |
