diff options
Diffstat (limited to 'testing/DHT_cryptosendfiletest.c')
-rw-r--r-- | testing/DHT_cryptosendfiletest.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c index 5c3a0256..23423497 100644 --- a/testing/DHT_cryptosendfiletest.c +++ b/testing/DHT_cryptosendfiletest.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "../core/network.h" | 38 | #include "../core/network.h" |
39 | #include "../core/DHT.h" | 39 | #include "../core/DHT.h" |
40 | #include "../core/net_crypto.h" | 40 | #include "../core/net_crypto.h" |
41 | #include "../core/misc_tools.h" | ||
41 | 42 | ||
42 | #include <string.h> | 43 | #include <string.h> |
43 | 44 | ||
@@ -60,22 +61,6 @@ void printip(IP_Port ip_port) | |||
60 | printf("\nIP: %u.%u.%u.%u Port: %u\n",ip_port.ip.c[0],ip_port.ip.c[1],ip_port.ip.c[2],ip_port.ip.c[3],ntohs(ip_port.port)); | 61 | printf("\nIP: %u.%u.%u.%u Port: %u\n",ip_port.ip.c[0],ip_port.ip.c[1],ip_port.ip.c[2],ip_port.ip.c[3],ntohs(ip_port.port)); |
61 | } | 62 | } |
62 | 63 | ||
63 | //TODO: rewrite | ||
64 | unsigned char * hex_string_to_bin(char hex_string[]) | ||
65 | { | ||
66 | size_t len = strlen(hex_string); | ||
67 | unsigned char * val = malloc(len); | ||
68 | char * pos = hex_string; | ||
69 | int i=0; | ||
70 | while(i < len) | ||
71 | { | ||
72 | sscanf(pos,"%2hhx",&val[i]); | ||
73 | pos+=2; | ||
74 | i++; | ||
75 | } | ||
76 | return val; | ||
77 | } | ||
78 | |||
79 | uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; | 64 | uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; |
80 | 65 | ||
81 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) |