From 263704ea800982e288b9edb5323124936f93b3bd Mon Sep 17 00:00:00 2001 From: riemann89 Date: Thu, 24 Nov 2016 18:59:38 +0100 Subject: [PATCH] fix warnings --- Makefile | 6 +++--- src/Client.c | 5 +---- src/Server.c | 18 +++--------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 37f6f62..ab74f35 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,9 @@ client: SSL_utilities SSL_utilities: mkdir -p build - $(CC) $(CFLAGS) $(OPENSSL) -c src/structures.c -o build/structures.o $(LFLAGS) - $(CC) $(CFLAGS) $(OPENSSL) -c src/SSL_functions.c -o build/SSL_functions.o $(LFLAGS) - $(CC) $(CFLAGS) $(OPENSSL) -c src/Utilities.c -o build/Utilities.o $(LFLAGS) + $(CC) $(CFLAGS) -I/usr/local/ssl/include -c src/structures.c -o build/structures.o + $(CC) $(CFLAGS) -I/usr/local/ssl/include -c src/SSL_functions.c -o build/SSL_functions.o + $(CC) $(CFLAGS) -I/usr/local/ssl/include -c src/Utilities.c -o build/Utilities.o clean: rm -r build diff --git a/src/Client.c b/src/Client.c index 100d63d..77d30a1 100644 --- a/src/Client.c +++ b/src/Client.c @@ -24,8 +24,7 @@ int main(int argc, const char *argv[]){ uint8_t **pre_master_secret; MD5_CTX md5; SHA_CTX sha; - uint8_t len_hello; - uint8_t *enc_message, *dec_message, *mac, *mac2, *key_block, *client_write_MAC_secret, *server_write_MAC_secret, *master_secret, *sha_1, *md5_1, *sha_fin, *md5_fin, *mac_test; + uint8_t *enc_message, *dec_message, *mac, *key_block, *client_write_MAC_secret, *server_write_MAC_secret, *master_secret, *sha_1, *md5_1, *sha_fin, *md5_fin, *mac_test; client_hello = NULL; server_hello = NULL; @@ -43,12 +42,10 @@ int main(int argc, const char *argv[]){ enc_message_len = 0; dec_message_len = 0; pre_master_secret = NULL; - len_hello = 0; phase=0; enc_message = NULL; dec_message = NULL; mac = NULL; - mac2 = NULL; key_block = NULL; client_write_MAC_secret = NULL; server_write_MAC_secret = NULL; diff --git a/src/Server.c b/src/Server.c index ee83fdf..1a12071 100644 --- a/src/Server.c +++ b/src/Server.c @@ -27,13 +27,13 @@ int main(int argc, const char *argv[]){ ClientKeyExchange *client_key_exchange; ServerKeyExchange *server_key_exchange; Certificate *certificate; - CertificateVerify *certificate_verify; Finished finished; CipherSuite *ciphersuite_choosen; Talker sender; int phase, key_block_size, len_parameters,dec_message_len, enc_message_len, pre_master_secret_size; uint8_t ciphersuite_code; - uint8_t *key_block,*dec_message,*enc_message, *mac, *mac_test, *pre_master_secret, *master_secret,*sha_1, *md5_1, *sha_fin, *md5_fin, session_Id[4]; + uint8_t *key_block,*dec_message,*enc_message, *mac, *mac_test, *pre_master_secret, *master_secret,*sha_1, *md5_1, *sha_fin, *md5_fin, *client_write_MAC_secret, session_Id[4]; + MD5_CTX md5; SHA_CTX sha; DH *dh, **dhp; @@ -77,7 +77,6 @@ int main(int argc, const char *argv[]){ dhp = &dh; pub_key_client = NULL; private_key = NULL; - certificate_verify=NULL; @@ -255,16 +254,7 @@ int main(int argc, const char *argv[]){ printf("\n\n"); OpenCommunication(client); - phase = 4;//TODO: se usa il verify non funziona - break; - case CERTIFICATE_VERIFY: - certificate_verify = HandshakeToCertificateVerify(client_handshake); - - SHA1_Update(&sha,client_message->message,sizeof(uint8_t)*(client_message->length-5)); - MD5_Update(&md5,client_message->message,sizeof(uint8_t)*(client_message->length-5)); - OpenCommunication(client); - printf("cert verify"); - CheckCommunication(); + phase = 4; break; default: perror("ERROR: Unattended message in phase 3.\n"); @@ -327,9 +317,7 @@ int main(int argc, const char *argv[]){ mac_test = NULL; handshake->length = handshake->length - ciphersuite_choosen->hash_size; - uint8_t *client_write_MAC_secret, *server_write_MAC_secret; client_write_MAC_secret = NULL; - server_write_MAC_secret = NULL; client_write_MAC_secret = key_block;