summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-09-13 17:59:13 +0200
committerLinus Nordberg <linus@nordu.net>2016-09-21 13:15:11 +0200
commit6ff93d467cd5e59cfa5445baf4f615bd9c8d44a4 (patch)
tree3996259cb262678660d682c125650f3c09678d6f
parentf221191a52217fa30838f9eef8ac6933b4ef459f (diff)
Require libnettle unconditionally.
-rw-r--r--Makefile.am14
-rw-r--r--configure.ac18
-rw-r--r--debug.c8
-rw-r--r--debug.h2
-rw-r--r--radsecproxy.c14
-rw-r--r--tests/Makefile.am6
6 files changed, 5 insertions, 57 deletions
diff --git a/Makefile.am b/Makefile.am
index e4a6ef9..b8f75c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,5 @@
AUTOMAKE_OPTIONS = foreign
-if WANT_FTICKS
-fticks_sources = fticks.c fticks.h fticks_hashmac.c fticks_hashmac.h
-fticks_programs = radsecproxy-hash
-radsecproxy_hash_LDADD = fticks_hashmac.o hash.o list.o
-endif
-
if HAVE_DOCBOOK2X_MAN
GENMANPAGES = radsecproxy.conf.5
endif
@@ -13,15 +7,15 @@ endif
SUBDIRS = tests
sbin_PROGRAMS = radsecproxy
-bin_PROGRAMS = radsecproxy-conf $(fticks_programs)
+bin_PROGRAMS = radsecproxy-conf radsecproxy-hash
noinst_LIBRARIES = librsp.a
radsecproxy_SOURCES = main.c
librsp_a_SOURCES = \
- $(fticks_sources) \
debug.c debug.h \
dtls.c dtls.h \
+ fticks.c fticks.h fticks_hashmac.c fticks_hashmac.h \
gconfig.c gconfig.h \
hash.c hash.h \
hostport.c hostport.h \
@@ -48,8 +42,8 @@ AM_CFLAGS = \
radsecproxy_LDFLAGS = @SSL_LDFLAGS@ @TARGET_LDFLAGS@
radsecproxy_LDADD = librsp.a @SSL_LIBS@
-
radsecproxy_conf_LDFLAGS = @TARGET_LDFLAGS@
+radsecproxy_hash_LDADD = fticks_hashmac.o hash.o list.o
dist_man_MANS = radsecproxy.1 radsecproxy-hash.1 $(GENMANPAGES)
@@ -60,8 +54,6 @@ EXTRA_DIST = \
radsecproxy.conf.5.xml radsecproxy.conf-example \
tools/README tools/naptr-eduroam.sh tools/radsec-dynsrv.sh
-DISTCHECK_CONFIGURE_FLAGS = --enable-fticks
-
####################
radsecproxy.conf.5: $(srcdir)/radsecproxy.conf.5.xml
docbook2x-man $<
diff --git a/configure.ac b/configure.ac
index 307a8e7..65c3b10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,24 +53,8 @@ AC_ARG_ENABLE(dtls,
fi
])
-AC_ARG_ENABLE(fticks,
-AC_HELP_STRING([--enable-fticks],[build with F-Ticks support [default=no]]),
-[case $enableval in
-yes|no) ;;
-*) AC_MSG_ERROR([bad value $enableval for --enable-fticks, need yes or no]) ;;
-esac],
-[enable_fticks=no])
-
-if test "$enable_fticks" = "yes"; then
AC_CHECK_LIB([nettle], [nettle_sha256_init],,
- [AC_MSG_WARN([required library nettle not found, fticks support disabled])
- enable_fticks=no])
-fi
-
-if test "$enable_fticks" = "yes"; then
-AC_DEFINE([WANT_FTICKS], [1])
-fi
-AM_CONDITIONAL(WANT_FTICKS, test "$enable_fticks" = "yes")
+ [AC_MSG_ERROR([required library nettle not found])])
dnl Check if we're on Solaris and set CFLAGS accordingly
AC_CANONICAL_SYSTEM
diff --git a/debug.c b/debug.c
index 68f0f05..ab9c662 100644
--- a/debug.c
+++ b/debug.c
@@ -23,9 +23,7 @@ static uint8_t debug_level = DBG_INFO;
static char *debug_filepath = NULL;
static FILE *debug_file = NULL;
static int debug_syslogfacility = 0;
-#if defined(WANT_FTICKS)
static int fticks_syslogfacility = 0;
-#endif
static uint8_t debug_timestamp = 0;
void debug_init(char *ident) {
@@ -104,17 +102,13 @@ int debug_set_destination(char *dest, int log_type) {
debugx(1, DBG_ERR, "Unknown syslog facility %s", dest);
if (log_type != LOG_TYPE_FTICKS)
debug_syslogfacility = facvals[i];
-#if defined(WANT_FTICKS)
else if (log_type == LOG_TYPE_FTICKS)
fticks_syslogfacility = facvals[i];
-#endif
} else {
if (log_type != LOG_TYPE_FTICKS)
debug_syslogfacility = LOG_DAEMON;
-#if defined(WANT_FTICKS)
else if (log_type == LOG_TYPE_FTICKS)
fticks_syslogfacility = 0;
-#endif
}
openlog(debug_ident, LOG_PID, debug_syslogfacility);
return 1;
@@ -231,7 +225,6 @@ void debugerrnox(int err, uint8_t level, char *format, ...) {
exit(err);
}
-#if defined(WANT_FTICKS)
void fticks_debug(const char *format, ...) {
int priority;
va_list ap;
@@ -244,7 +237,6 @@ void fticks_debug(const char *format, ...) {
va_end(ap);
}
}
-#endif
/* Local Variables: */
/* c-file-style: "stroustrup" */
/* End: */
diff --git a/debug.h b/debug.h
index 12cb109..83785ee 100644
--- a/debug.h
+++ b/debug.h
@@ -25,9 +25,7 @@ void debugerrno(int err, uint8_t level, char *format, ...);
void debugerrnox(int err, uint8_t level, char *format, ...);
int debug_set_destination(char *dest, int log_type);
void debug_reopen_log();
-#if defined(WANT_FTICKS)
void fticks_debug(const char *format, ...);
-#endif
/* Local Variables: */
/* c-file-style: "stroustrup" */
diff --git a/radsecproxy.c b/radsecproxy.c
index d568acd..e15ac9c 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -68,9 +68,7 @@
#include "tcp.h"
#include "tls.h"
#include "dtls.h"
-#if defined(WANT_FTICKS)
#include "fticks.h"
-#endif
static struct options options;
static struct list *clconfs, *srvconfs;
@@ -1682,11 +1680,9 @@ void replyh(struct server *server, unsigned char *buf) {
}
}
-#if defined(WANT_FTICKS)
if (msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject)
if (options.fticks_reporting && from->conf->fticks_viscountry != NULL)
fticks_log(&options, from, msg, rqout);
-#endif
msg->id = (char)rqout->rq->rqid;
memcpy(msg->auth, rqout->rq->rqauth, 16);
@@ -2759,10 +2755,8 @@ int confclient_cb(struct gconffile **cf, void *arg, char *block, char *opt, char
"rewriteIn", CONF_STR, &conf->confrewritein,
"rewriteOut", CONF_STR, &conf->confrewriteout,
"rewriteattribute", CONF_STR, &conf->confrewriteusername,
-#if defined(WANT_FTICKS)
"fticksVISCOUNTRY", CONF_STR, &conf->fticks_viscountry,
"fticksVISINST", CONF_STR, &conf->fticks_visinst,
-#endif
NULL
))
debugx(1, DBG_ERR, "configuration error");
@@ -3121,11 +3115,9 @@ void getmainconfig(const char *configfile) {
struct gconffile *cfs;
char **listenargs[RAD_PROTOCOUNT];
char *sourcearg[RAD_PROTOCOUNT];
-#if defined(WANT_FTICKS)
uint8_t *fticks_reporting_str = NULL;
uint8_t *fticks_mac_str = NULL;
uint8_t *fticks_key_str = NULL;
-#endif
int i;
cfs = openconfigfile(configfile);
@@ -3180,12 +3172,10 @@ void getmainconfig(const char *configfile) {
"TLS", CONF_CBK, conftls_cb, NULL,
#endif
"Rewrite", CONF_CBK, confrewrite_cb, NULL,
-#if defined(WANT_FTICKS)
"FTicksReporting", CONF_STR, &fticks_reporting_str,
"FTicksMAC", CONF_STR, &fticks_mac_str,
"FTicksKey", CONF_STR, &fticks_key_str,
"FTicksSyslogFacility", CONF_STR, &options.ftickssyslogfacility,
-#endif
"IPv4Only", CONF_BLN, &options.ipv4only,
"IPv6Only", CONF_BLN, &options.ipv6only,
NULL
@@ -3205,10 +3195,8 @@ void getmainconfig(const char *configfile) {
if (!setttlattr(&options, DEFAULT_TTL_ATTR))
debugx(1, DBG_ERR, "Failed to set TTLAttribute, exiting");
-#if defined(WANT_FTICKS)
fticks_configure(&options, &fticks_reporting_str, &fticks_mac_str,
&fticks_key_str);
-#endif
for (i = 0; i < RAD_PROTOCOUNT; i++)
if (listenargs[i] || sourcearg[i])
@@ -3354,13 +3342,11 @@ int radsecproxy_main(int argc, char **argv) {
debug_set_destination(options.logdestination
? options.logdestination
: "x-syslog:///", LOG_TYPE_DEBUG);
-#if defined(WANT_FTICKS)
if (options.ftickssyslogfacility) {
debug_set_destination(options.ftickssyslogfacility,
LOG_TYPE_FTICKS);
free(options.ftickssyslogfacility);
}
-#endif
}
free(options.logdestination);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2a7c339..91b037a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,10 +1,6 @@
AUTOMAKE_OPTIONS = foreign
-if WANT_FTICKS
-fticks_programs = t_fticks
-endif
-
-check_PROGRAMS = $(fticks_programs)
+check_PROGRAMS = t_fticks
AM_CFLAGS = -g -Wall -Werror @TARGET_CFLAGS@
LDADD = $(top_builddir)/librsp.a @SSL_LIBS@