summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-06 10:57:49 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-06 10:57:49 -0400
commit7458473dcac19b1aed0803b5f8649f905f5ce7fb (patch)
tree99c51e4c10bef959dd851da481e6065c7576c368 /testing
parent928fc1e65a315cfb09b61f7b7ea8313a523a5326 (diff)
Forward secrecy implemented into crypto.
Diffstat (limited to 'testing')
-rw-r--r--testing/DHT_cryptosendfiletest.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c
index 787e279e..84d777cc 100644
--- a/testing/DHT_cryptosendfiletest.c
+++ b/testing/DHT_cryptosendfiletest.c
@@ -8,7 +8,7 @@
8 * NOTE: this program simulates 33% packet loss. 8 * NOTE: this program simulates 33% packet loss.
9 * 9 *
10 * This is how I compile it: gcc -O2 -Wall -o test ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/DHT.c ../nacl/build/Linux/lib/amd64/* DHT_cryptosendfiletest.c 10 * This is how I compile it: gcc -O2 -Wall -o test ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/DHT.c ../nacl/build/Linux/lib/amd64/* DHT_cryptosendfiletest.c
11* 11 *
12 * 12 *
13 * Command line arguments are the ip and port of a node (for bootstrapping). 13 * Command line arguments are the ip and port of a node (for bootstrapping).
14 * 14 *
@@ -167,8 +167,9 @@ int main(int argc, char *argv[])
167 { 167 {
168 uint8_t secret_nonce[crypto_box_NONCEBYTES]; 168 uint8_t secret_nonce[crypto_box_NONCEBYTES];
169 uint8_t public_key[crypto_box_PUBLICKEYBYTES]; 169 uint8_t public_key[crypto_box_PUBLICKEYBYTES];
170 inconnection = crypto_inbound(public_key, secret_nonce); 170 uint8_t session_key[crypto_box_PUBLICKEYBYTES];
171 inconnection = accept_crypto_inbound(inconnection, acceptedfriend_public_key, secret_nonce); 171 inconnection = crypto_inbound(public_key, secret_nonce, session_key);
172 inconnection = accept_crypto_inbound(inconnection, acceptedfriend_public_key, secret_nonce, session_key);
172 //inconnection = incoming_connection(); 173 //inconnection = incoming_connection();
173 if(inconnection != -1) 174 if(inconnection != -1)
174 { 175 {