From 3ff46930b57dd9be5832acb8e03832ea3773d163 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 28 Jan 2009 21:31:01 +0000 Subject: reenabled ld-kdr cleaning up Makefile --- doc/uanytun.8.txt | 14 +++++++++++++- src/Makefile | 24 ++++++++++++------------ src/configure | 10 +++++----- src/options.c | 4 ++-- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/doc/uanytun.8.txt b/doc/uanytun.8.txt index dc1b934..3364294 100644 --- a/doc/uanytun.8.txt +++ b/doc/uanytun.8.txt @@ -27,6 +27,7 @@ SYNOPSIS [ *-m|--mux* ] [ *-w|--window-size* ] [ *-k|--kd-prf* ] +[ *-l|--ld-kdr* ] [ *-E|--passphrase ] [ *-K|--key* ] [ *-A|--salt* ] @@ -208,6 +209,17 @@ Possible values: * *aes-ctr-192* - AES in counter mode with 192 Bits * *aes-ctr-256* - AES in counter mode with 256 Bits +-l|--ld-kdr +~~~~~~~~~~~~~~~~~~~~ + +The log2 of the key derivation rate. This is used by the key +derivation to determine how often a new session key has to be +generated. A value of -1 means to generate only one key and use +it forever. The default is 0 which means to calculate a new key +for every packet. A value of 1 would tell the key derivation +to generate a new key after 2 packets, for 2 its 4 packets and +so on. + -E|--passphrase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -299,6 +311,6 @@ COPYING Copyright \(C) 2008-2009 Christian Pointner. This program is free software; you can redistribute it and/or modify it under the terms -of the GNU General Public License version 2 as published by the +of the GNU General Public License version 3 as published by the Free Software Foundation. diff --git a/src/Makefile b/src/Makefile index ef90eeb..5488bfe 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,12 +34,11 @@ include include.mk -DEPENDFILE = .depend -EXECUTABLE = uanytun +EXECUTABLE := uanytun -CRYPT_OBJ = key_derivation.o \ +CRYPT_OBJ := key_derivation.o \ auth_algo.o -OBJ = log.o \ +OBJ := log.o \ signal.o \ options.o \ tun.o \ @@ -55,16 +54,17 @@ ifndef NO_CRYPT_OBJ OBJ += $(CRYPT_OBJ) endif -SRC = $(OBJ:%.o=%.c) +SRC := $(OBJ:%.o=%.c) -.PHONY: dep distclean clean +all: $(EXECUTABLE) -all: dep $(EXECUTABLE) +%.d: %.c + @set -e; rm -f $@; \ + $(CC) -MM $(CFLAGS) $< > $@.$$$$; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$; echo '(re)building $@' -dep: $(SRC) - $(CC) -MM $(SRC) > $(DEPENDFILE) - --include $(DEPENDFILE) +-include $(SRC:%.c=%.d) uanytun: $(OBJ) $(LD) $(OBJ) -o $@ $(LDFLAGS) @@ -81,5 +81,5 @@ distclean: clean clean: rm -f *.o - rm -f $(DEPENDFILE) + rm -f *.d rm -f $(EXECUTABLE) diff --git a/src/configure b/src/configure index d105f87..c54d555 100755 --- a/src/configure +++ b/src/configure @@ -141,11 +141,11 @@ if [ $V4_MAPPED -eq 0 ]; then fi cat >> include.mk <seq_window_size_) #ifndef NO_CRYPT PARSE_STRING_PARAM("-k","--kd-prf", opt->kd_prf_) -// PARSE_INT_PARAM("-l","--ld-kdr", opt->ld_kdr_) + PARSE_INT_PARAM("-l","--ld-kdr", opt->ld_kdr_) #ifndef NO_PASSPHRASE PARSE_STRING_PARAM_SEC("-E","--passphrase", opt->passphrase_) #endif @@ -337,7 +337,7 @@ void options_print_usage() printf(" [-w|--window-size] seqence number window size\n"); #ifndef NO_CRYPT printf(" [-k|--kd-prf] key derivation pseudo random function\n"); -// printf(" [-l|--ld-kdr] log2 of key derivation rate\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"); #endif -- cgit v1.2.3