added msg_auth flag in radius_message_t sign() method
[strongswan.git] / src / libhydra / hydra.c
index 2dd6ee7..f180e36 100644 (file)
@@ -42,6 +42,8 @@ void libhydra_deinit()
 {
        private_hydra_t *this = (private_hydra_t*)hydra;
        this->public.attributes->destroy(this->public.attributes);
 {
        private_hydra_t *this = (private_hydra_t*)hydra;
        this->public.attributes->destroy(this->public.attributes);
+       this->public.kernel_interface->destroy(this->public.kernel_interface);
+       free((void*)this->public.daemon);
        free(this);
        hydra = NULL;
 }
        free(this);
        hydra = NULL;
 }
@@ -49,13 +51,15 @@ void libhydra_deinit()
 /**
  * Described in header.
  */
 /**
  * Described in header.
  */
-bool libhydra_init()
+bool libhydra_init(const char *daemon)
 {
        private_hydra_t *this;
 
        INIT(this,
                .public = {
                        .attributes = attribute_manager_create(),
 {
        private_hydra_t *this;
 
        INIT(this,
                .public = {
                        .attributes = attribute_manager_create(),
+                       .kernel_interface = kernel_interface_create(),
+                       .daemon = strdup(daemon ?: "libhydra"),
                },
        );
        hydra = &this->public;
                },
        );
        hydra = &this->public;
@@ -63,7 +67,7 @@ bool libhydra_init()
        if (lib->integrity &&
                !lib->integrity->check(lib->integrity, "libhydra", libhydra_init))
        {
        if (lib->integrity &&
                !lib->integrity->check(lib->integrity, "libhydra", libhydra_init))
        {
-               DBG1("integrity check of libhydra failed");
+               DBG1(DBG_LIB, "integrity check of libhydra failed");
                return FALSE;
        }
        return TRUE;
                return FALSE;
        }
        return TRUE;