From 49829c29e541546084950b8a153067db371d101a Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Mon, 8 Aug 2016 18:40:03 -0400 Subject: Cleanup initialization of libgcrypt. * common/init.c (init_common_subsystems): Initialize libgcrypt. * dirmngr/Makefile.am (dirmngr_ldap): Link with libgcrypt. -- Most other modules already call gcry_check_version() after init_common_subsystems() so may as well move initialization of libgcrypt to here. Also fixes a warning in the system log from gpgconf --homedir. Signed-off-by: Ben Kibbey --- common/init.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common/init.c') diff --git a/common/init.c b/common/init.c index c406ffe58..591c85468 100644 --- a/common/init.c +++ b/common/init.c @@ -47,7 +47,9 @@ # include /* For _assuan_w32ce_finish_pipe. */ #endif +#include #include "util.h" +#include "i18n.h" /* This object is used to register memory cleanup functions. Technically they are not needed but they can avoid frequent @@ -186,6 +188,12 @@ _init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp) atexit (sleep_on_exit); #endif + if (!gcry_check_version (NEED_LIBGCRYPT_VERSION)) + { + log_fatal (_("%s is too old (need %s, have %s)\n"), "libgcrypt", + NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL)); + } + /* Initialize the Estream library. */ gpgrt_init (); gpgrt_set_alloc_func (gcry_realloc); -- cgit v1.2.3