From 66bafc4dff6f10f21c8e3936c65d50a670af2bab Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 19 Jan 2009 22:09:33 +0000 Subject: fixed bug which prevents uanytun from detecting device type properly some cleanup --- src/key_derivation.c | 4 ++-- src/key_derivation.h | 2 +- src/options.c | 3 +-- src/uanytun.c | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/key_derivation.c b/src/key_derivation.c index 957cba0..a4b1c9f 100644 --- a/src/key_derivation.c +++ b/src/key_derivation.c @@ -447,9 +447,9 @@ int key_derivation_aesctr_generate(key_derivation_t* kd, key_store_dir_t dir, sa return -1; } u_int32_t num = 0; - memset(params->ecount_buf, 0, AES_BLOCK_SIZE); + memset(params->ecount_buf_, 0, AES_BLOCK_SIZE); memset(key, 0, len); - AES_ctr128_encrypt(key, key, len, ¶ms->aes_key_, params->ctr_.buf_, params->ecount_buf, &num); + AES_ctr128_encrypt(key, key, len, ¶ms->aes_key_, params->ctr_.buf_, params->ecount_buf_, &num); #endif if(!kd->ld_kdr_) diff --git a/src/key_derivation.h b/src/key_derivation.h index 1e849af..9bdb8f3 100644 --- a/src/key_derivation.h +++ b/src/key_derivation.h @@ -116,7 +116,7 @@ struct key_derivation_aesctr_param_struct { gcry_cipher_hd_t handle_; #else AES_KEY aes_key_; - u_int8_t ecount_buf[AES_BLOCK_SIZE]; + u_int8_t ecount_buf_[AES_BLOCK_SIZE]; #endif key_derivation_aesctr_ctr_t ctr_; }; diff --git a/src/options.c b/src/options.c index 4f97bfe..4b8dc33 100644 --- a/src/options.c +++ b/src/options.c @@ -312,7 +312,6 @@ void options_print_usage() { printf("USAGE:\n"); printf("uanytun [-h|--help] prints this...\n"); -// printf(" [-f|--config] the config file\n"); printf(" [-D|--nodaemonize] don't run in background\n"); printf(" [-C|--chroot] chroot and drop privileges\n"); printf(" [-u|--username] if chroot change to this user\n"); @@ -336,7 +335,7 @@ void options_print_usage() printf(" [-k|--kd-prf] key derivation pseudo random function\n"); printf(" [-l|--ld-kdr] log2 of key derivation rate\n"); #ifndef NO_PASSPHRASE - printf(" [-E|--passphrase a passprhase to generate master key and salt from\n"); + printf(" [-E|--passphrase] a passprhase to generate master key and salt from\n"); #endif printf(" [-K|--key] master key to use for encryption\n"); printf(" [-A|--salt] master salt to use for encryption\n"); diff --git a/src/uanytun.c b/src/uanytun.c index df54c57..c4a4f1b 100644 --- a/src/uanytun.c +++ b/src/uanytun.c @@ -149,9 +149,9 @@ int process_tun_data(tun_device_t* dev, udp_socket_t* sock, options_t* opt, plai plain_packet_set_payload_length(plain_packet, len); - if(dev->type_ = TYPE_TUN) + if(dev->type_ == TYPE_TUN) plain_packet_set_type(plain_packet, PAYLOAD_TYPE_TUN); - else if(dev->type_ = TYPE_TAP) + else if(dev->type_ == TYPE_TAP) plain_packet_set_type(plain_packet, PAYLOAD_TYPE_TAP); else plain_packet_set_type(plain_packet, PAYLOAD_TYPE_UNKNOWN); -- cgit v1.2.3