diff options
-rw-r--r-- | sbin/isakmpd/init.c | 7 | ||||
-rw-r--r-- | sbin/isakmpd/isakmpd.conf.5 | 26 | ||||
-rw-r--r-- | sbin/isakmpd/log.c | 47 | ||||
-rw-r--r-- | sbin/isakmpd/log.h | 3 | ||||
-rw-r--r-- | sbin/isakmpd/regress/b2n/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/crypto/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/crypto/cryptotest.c | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/dh/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/ec2n/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/group/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/prf/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/rsakeygen/Makefile | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/rsakeygen/rsakeygen.c | 4 | ||||
-rw-r--r-- | sbin/isakmpd/regress/util/Makefile | 4 |
14 files changed, 99 insertions, 24 deletions
diff --git a/sbin/isakmpd/init.c b/sbin/isakmpd/init.c index ff4ee3ab066..5e9e755e6b2 100644 --- a/sbin/isakmpd/init.c +++ b/sbin/isakmpd/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.26 2003/11/08 19:17:28 jmc Exp $ */ +/* $OpenBSD: init.c,v 1.27 2004/02/25 16:01:28 hshoexer Exp $ */ /* $EOM: init.c,v 1.25 2000/03/30 14:27:24 ho Exp $ */ /* @@ -77,6 +77,9 @@ init (void) conf_init (); connection_init (); + /* This depends on conf_init, thus check as soon as possible. */ + log_reinit (); + #ifdef USE_POLICY /* policy_init depends on conf_init having run. */ policy_init (); @@ -113,6 +116,8 @@ reinit (void) /* Reread config file. */ conf_reinit (); + log_reinit (); + /* Set timezone */ tzset (); diff --git a/sbin/isakmpd/isakmpd.conf.5 b/sbin/isakmpd/isakmpd.conf.5 index 9ca6562d78e..ebe6e208967 100644 --- a/sbin/isakmpd/isakmpd.conf.5 +++ b/sbin/isakmpd/isakmpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: isakmpd.conf.5,v 1.86 2003/11/05 12:55:13 jmc Exp $ +.\" $OpenBSD: isakmpd.conf.5,v 1.87 2004/02/25 16:01:28 hshoexer Exp $ .\" $EOM: isakmpd.conf.5,v 1.57 2000/12/21 14:43:17 ho Exp $ .\" .\" Copyright (c) 1998, 1999, 2000 Niklas Hallqvist. All rights reserved. @@ -169,6 +169,30 @@ This list is used as a filter for the set of addresses the interfaces configured provides. This means that we won't see if an address given here does not exist on this host, and thus no error is given for that case. +.It Em Loglevel +A list of the form +.Ar class Ns = Ns Ar level , +where both +.Ar class +and +.Ar level +are numbers. +This is similar to the +.Fl D +command line switch of +.Em isakmpd. +See +.Xr isakmpd 8 +for details. +.It Em Logverbose +If this tag is defined, whatever the value is, verbose logging is enabled. +This is similar to the +.Fl v +command line switch +.Em isakmpd. +See +.Xr isakmpd 8 +for details. .It Em Policy-file The name of the file that contains .Xr keynote 4 diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c index 419512709b5..fcc9c217841 100644 --- a/sbin/isakmpd/log.c +++ b/sbin/isakmpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.39 2004/02/19 09:54:52 ho Exp $ */ +/* $OpenBSD: log.c,v 1.40 2004/02/25 16:01:28 hshoexer Exp $ */ /* $EOM: log.c,v 1.30 2000/09/29 08:19:23 niklas Exp $ */ /* @@ -60,6 +60,7 @@ #include <stdarg.h> #include <unistd.h> +#include "conf.h" #include "isakmp_num.h" #include "log.h" #include "monitor.h" @@ -109,6 +110,50 @@ log_init (int debug) } void +log_reinit (void) +{ + struct conf_list *logging; +#ifdef USE_DEBUG + struct conf_list_node *logclass; + int class, level; +#endif /* USE_DEBUG */ + + logging = conf_get_list ("General", "Logverbose"); + if (logging) + { + verbose_logging = 1; + conf_free_list (logging); + } + + +#ifdef USE_DEBUG + logging = conf_get_list ("General", "Loglevel"); + if (logging) + { + for (logclass = TAILQ_FIRST (&logging->fields); logclass; + logclass = TAILQ_NEXT (logclass, link)) + { + if (sscanf (logclass->field, "%d=%d", &class, &level) != 2) + { + if (sscanf (logclass->field, "A=%d", &level) == 1) + for (class = 0; class < LOG_ENDCLASS; class++) + log_debug_cmd (class, level); + else + { + log_print ("init: invalid logging class or level: %s", + logclass->field); + continue; + } + } + else + log_debug_cmd (class, level); + } + conf_free_list (logging); + } +#endif /* USE_DEBUG */ +} + +void log_to (FILE *f) { if (!log_output && f) diff --git a/sbin/isakmpd/log.h b/sbin/isakmpd/log.h index e313eee3f1f..df96760b79f 100644 --- a/sbin/isakmpd/log.h +++ b/sbin/isakmpd/log.h @@ -1,4 +1,4 @@ -/* $OpenBSD: log.h,v 1.18 2004/02/19 09:54:52 ho Exp $ */ +/* $OpenBSD: log.h,v 1.19 2004/02/25 16:01:28 hshoexer Exp $ */ /* $EOM: log.h,v 1.19 2000/03/30 14:27:23 ho Exp $ */ /* @@ -97,5 +97,6 @@ extern void log_verbose (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern void log_to (FILE *); extern void log_init (int); +extern void log_reinit (void); #endif /* _LOG_H_ */ diff --git a/sbin/isakmpd/regress/b2n/Makefile b/sbin/isakmpd/regress/b2n/Makefile index 6bdc12fb5dd..57ffb1fd257 100644 --- a/sbin/isakmpd/regress/b2n/Makefile +++ b/sbin/isakmpd/regress/b2n/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.6 2000/10/13 13:22:01 niklas Exp $ +# $OpenBSD: Makefile,v 1.7 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.12 2000/10/13 13:04:17 ho Exp $ # Test some math PROG= b2ntest -SRCS= b2ntest.c log.c math_2n.c sysdep.c util.c +SRCS= b2ntest.c conf.c log.c math_2n.c sysdep.c util.c NOMAN= TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- diff --git a/sbin/isakmpd/regress/crypto/Makefile b/sbin/isakmpd/regress/crypto/Makefile index 48739dbdc67..b2a0ef97f65 100644 --- a/sbin/isakmpd/regress/crypto/Makefile +++ b/sbin/isakmpd/regress/crypto/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.10 2003/08/28 14:43:35 markus Exp $ +# $OpenBSD: Makefile,v 1.11 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.7 2000/03/28 21:22:06 ho Exp $ # Test Crypto: PROG= cryptotest -SRCS= crypto.c cryptotest.c log.c +SRCS= crypto.c cryptotest.c conf.c log.c sysdep.c util.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile diff --git a/sbin/isakmpd/regress/crypto/cryptotest.c b/sbin/isakmpd/regress/crypto/cryptotest.c index ee63702b8c4..68573731efb 100644 --- a/sbin/isakmpd/regress/crypto/cryptotest.c +++ b/sbin/isakmpd/regress/crypto/cryptotest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptotest.c,v 1.11 2003/09/24 11:12:31 markus Exp $ */ +/* $OpenBSD: cryptotest.c,v 1.12 2004/02/25 16:01:29 hshoexer Exp $ */ /* $EOM: cryptotest.c,v 1.5 1998/10/07 16:40:49 niklas Exp $ */ /* @@ -58,7 +58,7 @@ verify_buf (u_int8_t *buf, u_int16_t len) #define hexchar2bin(x) ((nibble2bin((x)[0]) << 4) + nibble2bin((x)[1])) #define nibble2c(x) ((x) >= 10 ? ('a'-10+(x)) : ('0' + (x))) -void asc2bin (u_int8_t *bin, u_int8_t *asc, u_int16_t len) +static void asc2bin (u_int8_t *bin, u_int8_t *asc, u_int16_t len) { int i; diff --git a/sbin/isakmpd/regress/dh/Makefile b/sbin/isakmpd/regress/dh/Makefile index 3416377d463..e7f8d798364 100644 --- a/sbin/isakmpd/regress/dh/Makefile +++ b/sbin/isakmpd/regress/dh/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.7 2001/01/27 11:24:41 niklas Exp $ +# $OpenBSD: Makefile,v 1.8 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.10 2000/04/07 20:19:43 niklas Exp $ # Test DH: PROG= dhtest SRCS= math_2n.c math_ec2n.c math_group.c dh.c dhtest.c log.c util.c \ - sysdep.c gmp_util.c + sysdep.c gmp_util.c conf.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile diff --git a/sbin/isakmpd/regress/ec2n/Makefile b/sbin/isakmpd/regress/ec2n/Makefile index b21842abb1d..827ecbe7b96 100644 --- a/sbin/isakmpd/regress/ec2n/Makefile +++ b/sbin/isakmpd/regress/ec2n/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.6 2000/10/13 13:22:01 niklas Exp $ +# $OpenBSD: Makefile,v 1.7 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.9 2000/10/13 13:04:17 ho Exp $ # Test EC2N: PROG= ec2ntest -SRCS= math_2n.c math_ec2n.c ec2ntest.c log.c sysdep.c util.c +SRCS= math_2n.c math_ec2n.c ec2ntest.c log.c sysdep.c util.c conf.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile diff --git a/sbin/isakmpd/regress/group/Makefile b/sbin/isakmpd/regress/group/Makefile index e15fef033f7..9dc9982d8cd 100644 --- a/sbin/isakmpd/regress/group/Makefile +++ b/sbin/isakmpd/regress/group/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.7 2001/01/27 11:24:42 niklas Exp $ +# $OpenBSD: Makefile,v 1.8 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.12 2000/04/07 20:19:43 niklas Exp $ # Test Group: PROG= grouptest SRCS= math_2n.c math_ec2n.c math_group.c grouptest.c log.c util.c \ - sysdep.c gmp_util.c + sysdep.c gmp_util.c conf.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile diff --git a/sbin/isakmpd/regress/prf/Makefile b/sbin/isakmpd/regress/prf/Makefile index 84786d54721..5d9b1faa200 100644 --- a/sbin/isakmpd/regress/prf/Makefile +++ b/sbin/isakmpd/regress/prf/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.6 2000/04/07 22:06:11 niklas Exp $ +# $OpenBSD: Makefile,v 1.7 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.6 2000/03/28 21:22:07 ho Exp $ # Test PRF: PROG= prftest -SRCS= prf.c hash.c log.c prftest.c +SRCS= prf.c hash.c log.c prftest.c conf.c sysdep.c util.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile diff --git a/sbin/isakmpd/regress/rsakeygen/Makefile b/sbin/isakmpd/regress/rsakeygen/Makefile index 0fb9120dc7b..578a7b57d61 100644 --- a/sbin/isakmpd/regress/rsakeygen/Makefile +++ b/sbin/isakmpd/regress/rsakeygen/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2003/06/03 14:39:51 ho Exp $ +# $OpenBSD: Makefile,v 1.15 2004/02/25 16:01:29 hshoexer Exp $ # $EOM: Makefile,v 1.10 2000/03/28 21:23:24 ho Exp $ # @@ -33,7 +33,7 @@ # RSA Key Generation PROG= rsakeygen -SRCS= libcrypto.c log.c rsakeygen.c sysdep.c util.c +SRCS= libcrypto.c log.c rsakeygen.c sysdep.c util.c conf.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile diff --git a/sbin/isakmpd/regress/rsakeygen/rsakeygen.c b/sbin/isakmpd/regress/rsakeygen/rsakeygen.c index 763797ba86f..00864078222 100644 --- a/sbin/isakmpd/regress/rsakeygen/rsakeygen.c +++ b/sbin/isakmpd/regress/rsakeygen/rsakeygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsakeygen.c,v 1.17 2003/06/03 14:39:51 ho Exp $ */ +/* $OpenBSD: rsakeygen.c,v 1.18 2004/02/25 16:01:29 hshoexer Exp $ */ /* $EOM: rsakeygen.c,v 1.10 2000/12/21 15:18:53 ho Exp $ */ /* @@ -47,7 +47,7 @@ #define TEST_STRING "!Dies ist ein Test" -void asc2bin (u_int8_t *bin, u_int8_t *asc, u_int16_t len) +static void asc2bin (u_int8_t *bin, u_int8_t *asc, u_int16_t len) { int i; diff --git a/sbin/isakmpd/regress/util/Makefile b/sbin/isakmpd/regress/util/Makefile index ff2a19f6243..88c0785d860 100644 --- a/sbin/isakmpd/regress/util/Makefile +++ b/sbin/isakmpd/regress/util/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.1 2001/07/01 19:25:11 niklas Exp $ +# $OpenBSD: Makefile,v 1.2 2004/02/25 16:01:29 hshoexer Exp $ # Test some utility functions PROG= utiltest -SRCS= log.c sysdep.c util.c utiltest.c +SRCS= log.c sysdep.c util.c utiltest.c conf.c TOPSRC= ${.CURDIR}/../.. TOPOBJ!= cd ${TOPSRC}; printf "all:\n\t@pwd\n" |${MAKE} -f- OS!= awk '/^OS=/ { print $$2 }' ${.CURDIR}/../../Makefile |