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 /libcmix-crypto/curve25519 | |
| 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 'libcmix-crypto/curve25519')
| -rw-r--r-- | libcmix-crypto/curve25519/curve25519.c | 2 | ||||
| -rw-r--r-- | libcmix-crypto/curve25519/curve25519.h | 2 | ||||
| -rw-r--r-- | libcmix-crypto/curve25519/null/null_curve25519.c | 2 | ||||
| -rw-r--r-- | libcmix-crypto/curve25519/sodium/libsodium_curve25519.c | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/libcmix-crypto/curve25519/curve25519.c b/libcmix-crypto/curve25519/curve25519.c index 824daf9..4d53ddf 100644 --- a/libcmix-crypto/curve25519/curve25519.c +++ b/libcmix-crypto/curve25519/curve25519.c @@ -10,3 +10,5 @@ struct Api get_curve25519_implementation() &curve25519_shared_key_deleter }; } + +ImplementationGetter get_implementation = &get_curve25519_implementation; diff --git a/libcmix-crypto/curve25519/curve25519.h b/libcmix-crypto/curve25519/curve25519.h index 8e2ad4e..fde317a 100644 --- a/libcmix-crypto/curve25519/curve25519.h +++ b/libcmix-crypto/curve25519/curve25519.h @@ -28,7 +28,7 @@ extern void curve25519_keypair_deleter(struct KeyPair p); * \param swap_pub_order Should we swap the order in which we feed the public keys to the hash function. * \return A Shared key */ -extern struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char* pub_key, bool swap_pub_order); +extern struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char const* pub_key, bool swap_pub_order); /*! * \brief curve25519_shared_key_deleter * \param s the Shared key to free. diff --git a/libcmix-crypto/curve25519/null/null_curve25519.c b/libcmix-crypto/curve25519/null/null_curve25519.c index 317455f..63280ec 100644 --- a/libcmix-crypto/curve25519/null/null_curve25519.c +++ b/libcmix-crypto/curve25519/null/null_curve25519.c @@ -17,7 +17,7 @@ struct KeyPair curve25519_create_keypair() { void curve25519_shared_key_deleter(struct SharedKey s) {} -struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char* pub_key, bool swap_pub_order) { +struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char const* pub_key, bool swap_pub_order) { return (struct SharedKey){ NULL, 0 diff --git a/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c b/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c index 59e9258..e86ec09 100644 --- a/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c +++ b/libcmix-crypto/curve25519/sodium/libsodium_curve25519.c @@ -43,7 +43,7 @@ void curve25519_shared_key_deleter(struct SharedKey s) { s.shared = NULL; } -struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char* pub_key, bool swap_pub_order) { +struct SharedKey curve25519_derive_shared_key(struct KeyPair pair, unsigned char const* pub_key, bool swap_pub_order) { init(); unsigned char* shared = (unsigned char*) sodium_malloc(crypto_generichash_BYTES); |
