From d0affb0d0e010ed46fa725e1c0daf5f9cf3c44af Mon Sep 17 00:00:00 2001 From: toddouska Date: Tue, 25 Sep 2012 11:14:21 -0700 Subject: [PATCH] fix snifftest and aesni with new warnings --- ctaocrypt/src/aes.c | 8 ++++---- sslSniffer/sslSnifferTest/snifftest.c | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ctaocrypt/src/aes.c b/ctaocrypt/src/aes.c index 9d2102488..c598d8c8b 100644 --- a/ctaocrypt/src/aes.c +++ b/ctaocrypt/src/aes.c @@ -777,8 +777,8 @@ void AES_256_Key_Expansion(const unsigned char* userkey, unsigned char* key_schedule); -int AES_set_encrypt_key (const unsigned char *userKey, const int bits, - Aes* aes) +static int AES_set_encrypt_key(const unsigned char *userKey, const int bits, + Aes* aes) { if (!userKey || !aes) return BAD_FUNC_ARG; @@ -799,8 +799,8 @@ int AES_set_encrypt_key (const unsigned char *userKey, const int bits, } -int AES_set_decrypt_key (const unsigned char* userKey, const int bits, - Aes* aes) +static int AES_set_decrypt_key(const unsigned char* userKey, const int bits, + Aes* aes) { int nr; Aes temp_key; diff --git a/sslSniffer/sslSnifferTest/snifftest.c b/sslSniffer/sslSnifferTest/snifftest.c index adeb552cb..e7cc499fa 100755 --- a/sslSniffer/sslSnifferTest/snifftest.c +++ b/sslSniffer/sslSnifferTest/snifftest.c @@ -79,14 +79,16 @@ static void sig_handler(const int sig) #ifndef _WIN32 ssl_FreeSniffer(); #endif - exit(EXIT_SUCCESS); + if (sig) + exit(EXIT_SUCCESS); } static void err_sys(const char* msg) { fprintf(stderr, "%s\n", msg); - exit(EXIT_FAILURE); + if (msg) + exit(EXIT_FAILURE); } @@ -149,7 +151,9 @@ int main(int argc, char** argv) " installed correctly and you have sufficient permissions"); printf("Enter the interface number (1-%d): ", i); - scanf("%d", &inum); + ret = scanf("%d", &inum); + if (ret != 1) + printf("scanf port failed\n"); if (inum < 1 || inum > i) err_sys("Interface number out of range"); @@ -196,7 +200,9 @@ int main(int argc, char** argv) if (ret != 0) printf("pcap_activate failed %s\n", pcap_geterr(pcap)); printf("Enter the port to scan: "); - scanf("%d", &port); + ret = scanf("%d", &port); + if (ret != 1) + printf("scanf port failed\n"); SNPRINTF(filter, sizeof(filter), "tcp and port %d", port);