summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irmd/main.c17
-rw-r--r--src/lib/dev.c9
2 files changed, 20 insertions, 6 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 5875d7dc..f3a3ff87 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -2206,12 +2206,18 @@ static int irm_init(void)
#endif
#ifdef HAVE_LIBGCRYPT
- if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P))
- goto fail_gcry_control;
+ if (!gcry_check_version(GCRYPT_VERSION)) {
+ log_err("Error checking libgcrypt version.");
+ goto fail_gcry_version;
+ }
+
+ if (!gcry_control(GCRYCTL_ANY_INITIALIZATION_P)) {
+ log_err("Libgcrypt was not initialized.");
+ goto fail_gcry_version;
+ }
gcry_control(GCRYCTL_INITIALIZATION_FINISHED);
#endif
-
irmd_set_state(IRMD_RUNNING);
log_info("Ouroboros IPC Resource Manager daemon started...");
@@ -2219,7 +2225,10 @@ static int irm_init(void)
return 0;
#ifdef HAVE_LIBGCRYPT
- fail_gcry_control:
+ fail_gcry_version:
+#ifdef HAVE_FUSE
+ rmdir(FUSE_PREFIX);
+#endif
shm_rdrbuff_destroy(irmd.rdrb);
#endif
fail_rdrbuff:
diff --git a/src/lib/dev.c b/src/lib/dev.c
index ee7839c8..229a1470 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -344,8 +344,13 @@ static void init(int argc,
ai.pid = getpid();
#ifdef HAVE_LIBGCRYPT
- if (!gcry_check_version(GCRYPT_VERSION))
- goto fail_fds;
+ if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) {
+ if (!gcry_check_version(GCRYPT_VERSION))
+ goto fail_fds;
+ /* Needs to be enabled when we add encryption. */
+ gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
+ gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+ }
#endif
ai.fds = bmp_create(PROG_MAX_FLOWS - PROG_RES_FDS, PROG_RES_FDS);
if (ai.fds == NULL)