From 905060b43a294dd73cbcf19eb86b66240d6d0140 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 4 Dec 2003 22:40:43 +0000 Subject: May further patches from dbindner git-svn-id: file:///home/lennart/svn/public/seppl/trunk@19 91a2fd9b-5dcb-0310-a70a-d71e310228e6 --- configure.ac | 12 +++++++++++- kernel/Makefile.in | 22 ++++++++++++++++++---- kernel/ipt_CRYPT.c | 10 ++++++++++ kernel/ipt_DECRYPT.c | 12 +++++++++++- kernel/seppl.c | 14 ++++++++++++++ libs/libipt_CRYPT.c | 8 ++++++-- libs/libipt_DECRYPT.c | 8 ++++++-- 7 files changed, 76 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 16307c1..58026cb 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ if test "x$IPTABLES" = x ; then AC_MSG_ERROR([*** Please install iptables ***]) fi IPTABLES_VERSION=$("$IPTABLES" -V | cut -d' ' -f2 | sed 's/^v//') -AC_DEFINE(IPTABLES_VERSION, [$IPTABLES_VERSION], "iptables release number") +AC_DEFINE_UNQUOTED(IPTABLES_VERSION, ["$IPTABLES_VERSION"], "iptables release number") AC_MSG_RESULT([$IPTABLES_VERSION]) # Init script location @@ -98,6 +98,16 @@ AC_ARG_WITH(kernel, AC_SUBST(KERNELDIR) AC_MSG_RESULT([$KERNELDIR]) +AC_MSG_CHECKING([kernel configuration file]) +if ! test -r "$KERNELDIR/.config" ; then + cat << EOF +You need to configure your kernel sources before building SEPPL. +Try "make menuconfig" or "make xconfig" in the kernel source directory. +EOF + exit 1 +fi +AC_MSG_RESULT([found]) + # Check for crypto.h AC_MSG_CHECKING(for crypto.h) if ! test -r $KERNELDIR/include/linux/crypto.h; then diff --git a/kernel/Makefile.in b/kernel/Makefile.in index 31f2f98..ee5a617 100644 --- a/kernel/Makefile.in +++ b/kernel/Makefile.in @@ -27,19 +27,33 @@ distdir = ../$(PACKAGE)-$(VERSION) CFLAGS=-Wall -g -O2 KERNEL_CFLAGS= -I$(KERNELDIR)/include -DLINUX -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -DPACKAGE_BUGREPORT="\"@PACKAGE_BUGREPORT@\"" +include $(KERNELDIR)/.config + all: Makefile ipt_CRYPT.o ipt_DECRYPT.o seppl.o Makefile: Makefile.in cd .. && ./config.status kernel/Makefile + +ifdef CONFIG_MODVERSIONS +seppl.o ipt_CRYPT.o ipt_DECRYPT.o: seppl.ver +endif + +ifndef GENKSYMS +GENKSYMS=genksyms +endif + ipt_CRYPT.o: ipt_CRYPT.c - $(CC) $(CFLAGS) -c $^ -o $@ $(KERNEL_CFLAGS) + $(CC) $(CFLAGS) -c $< -o $@ $(KERNEL_CFLAGS) ipt_DECRYPT.o: ipt_DECRYPT.c - $(CC) $(CFLAGS) -c $^ -o $@ $(KERNEL_CFLAGS) + $(CC) $(CFLAGS) -c $< -o $@ $(KERNEL_CFLAGS) seppl.o: seppl.c - $(CC) $(CFLAGS) -c $^ -o $@ $(KERNEL_CFLAGS) + $(CC) $(CFLAGS) -c $< -o $@ $(KERNEL_CFLAGS) + +seppl.ver: seppl.c + $(CC) $(CFLAGS) $(KERNEL_CFLAGS) -E -D__GENKSYMS__ $^ | $(GENKSYMS) -k `uname -r`> $@ install: mkdir -p $(SEPPL_MODDIR) @@ -56,6 +70,6 @@ maintainer-clean: clean rm -f Makefile clean: - rm -f *.o + rm -f *.o *.var .PHONY: all clean maintainer-clean mostlyclean distclean distdir install diff --git a/kernel/ipt_CRYPT.c b/kernel/ipt_CRYPT.c index 68b5784..5fdbc87 100644 --- a/kernel/ipt_CRYPT.c +++ b/kernel/ipt_CRYPT.c @@ -20,6 +20,16 @@ ***/ #include + +#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS) + #define MODVERSIONS +#endif + +#if defined(MODVERSIONS) && !defined(__GENKSYMS__) + #include + #include "seppl.ver" +#endif + #include #include #include diff --git a/kernel/ipt_DECRYPT.c b/kernel/ipt_DECRYPT.c index 75db2bd..ce59525 100644 --- a/kernel/ipt_DECRYPT.c +++ b/kernel/ipt_DECRYPT.c @@ -1,4 +1,4 @@ -/* $Id: newmail.c 31 2003-10-22 22:59:07Z lennart $ */ +/* $Id$ */ /*** This file is part of seppl @@ -20,6 +20,16 @@ ***/ #include + +#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS) + #define MODVERSIONS +#endif + +#if defined(MODVERSIONS) && !defined(__GENKSYMS__) + #include + #include "seppl.ver" +#endif + #include #include #include diff --git a/kernel/seppl.c b/kernel/seppl.c index b15afbe..fd54b55 100644 --- a/kernel/seppl.c +++ b/kernel/seppl.c @@ -19,6 +19,17 @@ USA ***/ +#include + +#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS) + #define MODVERSIONS +#endif + +#if defined(MODVERSIONS) && !defined(__GENKSYMS__) + #include + #include "seppl.ver" +#endif + #include #include #include @@ -305,6 +316,9 @@ void seppl_clear_keyring(void) { kfree(key->key); kfree(key->iv); + crypto_free_tfm(key->tfm_ecb); + kfree(key->key_ecb); + k = key; key = key->next; kfree(k); diff --git a/libs/libipt_CRYPT.c b/libs/libipt_CRYPT.c index 7e171f3..c7f083f 100644 --- a/libs/libipt_CRYPT.c +++ b/libs/libipt_CRYPT.c @@ -1,4 +1,4 @@ -/* $Id: newmail.c 31 2003-10-22 22:59:07Z lennart $ */ +/* $Id$ */ /*** This file is part of seppl @@ -19,6 +19,10 @@ USA ***/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -97,7 +101,7 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_target *target) static struct iptables_target crypt = { NULL, "CRYPT", - "1.2.8", + IPTABLES_VERSION, IPT_ALIGN(sizeof(struct ipt_crypt_info)), IPT_ALIGN(sizeof(struct ipt_crypt_info)), &help, diff --git a/libs/libipt_DECRYPT.c b/libs/libipt_DECRYPT.c index a9a5fc9..29e2160 100644 --- a/libs/libipt_DECRYPT.c +++ b/libs/libipt_DECRYPT.c @@ -1,4 +1,4 @@ -/* $Id: newmail.c 31 2003-10-22 22:59:07Z lennart $ */ +/* $Id$ */ /*** This file is part of seppl @@ -19,6 +19,10 @@ USA ***/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -58,7 +62,7 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_target *target) static struct iptables_target decrypt = { NULL, "DECRYPT", - "1.2.8", + IPTABLES_VERSION, IPT_ALIGN(sizeof(struct ipt_decrypt_info)), IPT_ALIGN(sizeof(struct ipt_decrypt_info)), &help, -- cgit