charon-tkm: Register kernel_netlink_net
authorAdrian-Ken Rueegsegger <ken@codelabs.ch>
Tue, 11 Sep 2012 17:17:23 +0000 (19:17 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 19 Mar 2013 14:23:48 +0000 (15:23 +0100)
Explicitly register kernel netlink net implementation and avoid loading
the whole kernel-netlink plugin since the kernel netlink ipsec part is
unwanted.

src/charon-tkm/Makefile.am
src/charon-tkm/src/charon-tkm.c
src/charon-tkm/tests/keymat_tests.c

index 1b5dfdf..6c73593 100644 (file)
@@ -25,7 +25,6 @@ PLUGINS = \
        aes \
        constraints \
        hmac \
-       kernel-netlink \
        pem \
        pkcs1 \
        pkcs8 \
index 0782bda..1d21e7d 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <hydra.h>
 #include <daemon.h>
+#include <plugins/kernel_netlink/kernel_netlink_net.h>
 
 #include <library.h>
 #include <utils/backtrace.h>
@@ -287,6 +288,9 @@ int main(int argc, char *argv[])
                        PLUGIN_PROVIDE(DH, MODP_4096_BIT),
                PLUGIN_CALLBACK(kernel_ipsec_register, tkm_kernel_ipsec_create),
                        PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
+               PLUGIN_CALLBACK(kernel_net_register, kernel_netlink_net_create),
+                       PLUGIN_PROVIDE(CUSTOM, "kernel-net"),
+
        };
        lib->plugins->add_static_features(lib->plugins, "tkm-backend", features,
                        countof(features), TRUE);
index 0fde2fb..0d74ad5 100644 (file)
 #include <hydra.h>
 #include <config/proposal.h>
 #include <encoding/payloads/ike_header.h>
+#include <plugins/kernel_netlink/kernel_netlink_net.h>
 #include <tkm/client.h>
 
 #include "tkm.h"
 #include "tkm_nonceg.h"
 #include "tkm_diffie_hellman.h"
 #include "tkm_keymat.h"
+#include "tkm_kernel_ipsec.h"
 
 START_TEST(test_derive_ike_keys)
 {
@@ -39,6 +41,10 @@ START_TEST(test_derive_ike_keys)
                PLUGIN_REGISTER(DH, tkm_diffie_hellman_create),
                        PLUGIN_PROVIDE(DH, MODP_3072_BIT),
                        PLUGIN_PROVIDE(DH, MODP_4096_BIT),
+               PLUGIN_CALLBACK(kernel_ipsec_register, tkm_kernel_ipsec_create),
+                       PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
+               PLUGIN_CALLBACK(kernel_net_register, kernel_netlink_net_create),
+                       PLUGIN_PROVIDE(CUSTOM, "kernel-net"),
        };
        lib->plugins->add_static_features(lib->plugins, "tkm-tests", features,
                        countof(features), TRUE);