From b3fa1fc8f48aea08da1552d76397e959cd0aa690 Mon Sep 17 00:00:00 2001 From: Konstantin Kowalski Date: Sat, 27 Jul 2013 12:10:41 -0400 Subject: [fixed]created new files misc_tools.(c|h) and moved hex_string_to_bin() there. --- testing/DHT_cryptosendfiletest.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'testing/DHT_cryptosendfiletest.c') diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c index 5c3a0256..c7c33531 100644 --- a/testing/DHT_cryptosendfiletest.c +++ b/testing/DHT_cryptosendfiletest.c @@ -38,6 +38,7 @@ #include "../core/network.h" #include "../core/DHT.h" #include "../core/net_crypto.h" +#include "misc_tools.h" #include @@ -60,22 +61,6 @@ void printip(IP_Port ip_port) 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)); } -//TODO: rewrite -unsigned char * hex_string_to_bin(char hex_string[]) -{ - size_t len = strlen(hex_string); - unsigned char * val = malloc(len); - char * pos = hex_string; - int i=0; - while(i < len) - { - sscanf(pos,"%2hhx",&val[i]); - pos+=2; - i++; - } - return val; -} - uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; int main(int argc, char *argv[]) -- cgit v1.2.3