summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-01-19 22:09:33 +0000
committerChristian Pointner <equinox@anytun.org>2009-01-19 22:09:33 +0000
commit66bafc4dff6f10f21c8e3936c65d50a670af2bab (patch)
tree6a4ccee899a6fd478f5315691dbb157135138f78 /src
parentmoved signal init to better place (diff)
fixed bug which prevents uanytun from detecting device type properly
some cleanup
Diffstat (limited to 'src')
-rw-r--r--src/key_derivation.c4
-rw-r--r--src/key_derivation.h2
-rw-r--r--src/options.c3
-rw-r--r--src/uanytun.c4
4 files changed, 6 insertions, 7 deletions
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, &params->aes_key_, params->ctr_.buf_, params->ecount_buf, &num);
+ AES_ctr128_encrypt(key, key, len, &params->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] <file> the config file\n");
printf(" [-D|--nodaemonize] don't run in background\n");
printf(" [-C|--chroot] chroot and drop privileges\n");
printf(" [-u|--username] <username> if chroot change to this user\n");
@@ -336,7 +335,7 @@ void options_print_usage()
printf(" [-k|--kd-prf] <kd-prf type> key derivation pseudo random function\n");
printf(" [-l|--ld-kdr] <ld-kdr> log2 of key derivation rate\n");
#ifndef NO_PASSPHRASE
- printf(" [-E|--passphrase <pass phrase> a passprhase to generate master key and salt from\n");
+ printf(" [-E|--passphrase] <pass phrase> a passprhase to generate master key and salt from\n");
#endif
printf(" [-K|--key] <master key> master key to use for encryption\n");
printf(" [-A|--salt] <master 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);