summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/net_crypto.h2
-rw-r--r--testing/Messenger_test.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/core/net_crypto.h b/core/net_crypto.h
index c8837c03..6d223256 100644
--- a/core/net_crypto.h
+++ b/core/net_crypto.h
@@ -28,7 +28,7 @@
28 28
29//TODO: move this to network.h 29//TODO: move this to network.h
30#ifndef WIN32 30#ifndef WIN32
31#include "../nacl/build/Linux/include/amd64/crypto_box.h" 31#include "../nacl/build/localhost/include/amd64/crypto_box.h" //${HOSTNAME%.*} doesn't work... set env var later
32#endif 32#endif
33//Our public key. 33//Our public key.
34extern uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; 34extern uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c
index ea32673d..0fd9c557 100644
--- a/testing/Messenger_test.c
+++ b/testing/Messenger_test.c
@@ -7,7 +7,7 @@
7 * If it recieves a message from a friend it replies back. 7 * If it recieves a message from a friend it replies back.
8 * 8 *
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 ../core/Messenger.c ../nacl/build/$HOSTNAME/lib/amd64/* Messenger_test.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 ../core/Messenger.c ../nacl/build/${HOSTNAME%.*}/lib/amd64/* Messenger_test.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).
@@ -57,11 +57,11 @@ void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
57 } 57 }
58 printf("\nOf length: %u with data: %s \n", length, data); 58 printf("\nOf length: %u with data: %s \n", length, data);
59 59
60 if(length != sizeof("Install Gentoo")) 60 if(length != sizeof((uint8_t*)"Install Gentoo"))
61 { 61 {
62 return; 62 return;
63 } 63 }
64 if(memcmp(data ,"Install Gentoo", sizeof("Install Gentoo")) == 0 ) 64 if(memcmp(data , "Install Gentoo", sizeof("Install Gentoo")) == 0 )
65 //if the request contained the message of peace the person is obviously a friend so we add him. 65 //if the request contained the message of peace the person is obviously a friend so we add him.
66 { 66 {
67 printf("Friend request accepted.\n"); 67 printf("Friend request accepted.\n");
@@ -72,7 +72,7 @@ void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
72void print_message(int friendnumber, uint8_t * string, uint16_t length) 72void print_message(int friendnumber, uint8_t * string, uint16_t length)
73{ 73{
74 printf("Message with length %u recieved from %u: %s \n", length, friendnumber, string); 74 printf("Message with length %u recieved from %u: %s \n", length, friendnumber, string);
75 m_sendmessage(friendnumber, "Test1", 6); 75 m_sendmessage(friendnumber, (uint8_t*)"Test1", 6);
76} 76}
77 77
78int main(int argc, char *argv[]) 78int main(int argc, char *argv[])
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
85 m_callback_friendrequest(print_request); 85 m_callback_friendrequest(print_request);
86 m_callback_friendmessage(print_message); 86 m_callback_friendmessage(print_message);
87 87
88 m_setinfo("Install Gentoo", sizeof("Install Gentoo"));//The message we send is a message of peace 88 m_setinfo((uint8_t*)"Install Gentoo", sizeof((uint8_t*)"Install Gentoo"));//The message we send is a message of peace
89 89
90 printf("OUR ID: "); 90 printf("OUR ID: ");
91 uint32_t i; 91 uint32_t i;
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
109 109
110 while(1) 110 while(1)
111 { 111 {
112 m_sendmessage(num, "Test", 5); 112 m_sendmessage(num, (uint8_t*)"Test", 5);
113 doMessenger(); 113 doMessenger();
114 c_sleep(30); 114 c_sleep(30);
115 } 115 }