fix snifftest and aesni with new warnings

This commit is contained in:
toddouska 2012-09-25 11:14:21 -07:00
parent 2c0e7fd8e9
commit d0affb0d0e
2 changed files with 14 additions and 8 deletions

View File

@ -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;

View File

@ -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);