libhydra: Remove empty unused library
[strongswan.git] / src / charon-tkm / src / charon-tkm.c
index 6c3a78b..13352e5 100644 (file)
@@ -26,7 +26,6 @@
 #include <libgen.h>
 #include <errno.h>
 
-#include <hydra.h>
 #include <daemon.h>
 #include <library.h>
 #include <utils/backtrace.h>
@@ -43,6 +42,7 @@
 #include "tkm_public_key.h"
 #include "tkm_cred.h"
 #include "tkm_encoder.h"
+#include "tkm_spi_generator.h"
 
 /**
  * TKM bus listener for IKE authorize events.
@@ -103,6 +103,10 @@ static void run()
                sig = sigwaitinfo(&set, NULL);
                if (sig == -1)
                {
+                       if (errno == EINTR)
+                       {       /* ignore signals we didn't wait for */
+                               continue;
+                       }
                        DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
                        return;
                }
@@ -120,11 +124,6 @@ static void run()
                                charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
                                return;
                        }
-                       default:
-                       {
-                               DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
-                               break;
-                       }
                }
        }
 }
@@ -256,14 +255,6 @@ int main(int argc, char *argv[])
                exit(status);
        }
 
-       if (!libhydra_init())
-       {
-               dbg_syslog(DBG_DMN, 1, "initialization failed - aborting %s", dmn_name);
-               libhydra_deinit();
-               library_deinit();
-               exit(status);
-       }
-
        if (!libcharon_init())
        {
                dbg_syslog(DBG_DMN, 1, "initialization failed - aborting %s", dmn_name);
@@ -298,6 +289,9 @@ int main(int argc, char *argv[])
                        PLUGIN_PROVIDE(PUBKEY_VERIFY, SIGN_RSA_EMSA_PKCS1_SHA256),
                PLUGIN_CALLBACK(kernel_ipsec_register, tkm_kernel_ipsec_create),
                        PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
+               PLUGIN_CALLBACK(tkm_spi_generator_register, NULL),
+                       PLUGIN_PROVIDE(CUSTOM, "tkm-spi-generator"),
+                               PLUGIN_DEPENDS(CUSTOM, "libcharon-sa-managers"),
        };
        lib->plugins->add_static_features(lib->plugins, "tkm-backend", features,
                        countof(features), TRUE, NULL, NULL);
@@ -388,7 +382,6 @@ int main(int argc, char *argv[])
 deinit:
        destroy_dh_mapping();
        libcharon_deinit();
-       libhydra_deinit();
        library_deinit();
        tkm_deinit();
        return status;