Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
riemann89 committed Nov 24, 2016
1 parent 8a376a6 commit 263704e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/Client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
18 changes: 3 additions & 15 deletions src/Server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -77,7 +77,6 @@ int main(int argc, const char *argv[]){
dhp = &dh;
pub_key_client = NULL;
private_key = NULL;
certificate_verify=NULL;



Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 263704e

Please sign in to comment.