diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-10-10 20:34:49 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-10-11 08:53:44 +0200 |
commit | d54183d749f847a556a1f3a0300786169e0c40b2 (patch) | |
tree | ebf802f06e852b5f811dd20314192c6bd999ac33 | |
parent | a46f96fbfc017963a5578498c93bc85650461020 (diff) | |
download | ouroboros-d54183d749f847a556a1f3a0300786169e0c40b2.tar.gz ouroboros-d54183d749f847a556a1f3a0300786169e0c40b2.zip |
lib: Initialize libgcrypt before use
This initializes libgcrypt before use in the library. This fixes the
"called in non-operational state" error when CRC checking is enabled.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
-rw-r--r-- | src/lib/dev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c index a7b342ba..456019d2 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -343,7 +343,10 @@ static void init(int argc, prog = argv[1]; ai.pid = getpid(); - +#ifdef HAVE_LIBGCRYPT + if (!gcry_check_version(GCRYPT_VERSION)) + goto fail_fds; +#endif ai.fds = bmp_create(PROG_MAX_FLOWS - PROG_RES_FDS, PROG_RES_FDS); if (ai.fds == NULL) goto fail_fds; |