[PATCH] tools/gpgconf.c (main): Initialize libgcrypt.

Ben Kibbey bjk at luxsci.net
Sat Aug 6 19:27:38 CEST 2016


--
Fixes a warning appearing the system logs when --homedir is passed.

Signed-off-by: Ben Kibbey <bjk at luxsci.net>
---
 tools/gpgconf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index f7ce4c9..19444df 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <gcrypt.h>
 
 #include "gpgconf.h"
 #include "i18n.h"
@@ -229,6 +230,12 @@ main (int argc, char **argv)
   i18n_init();
   init_common_subsystems (&argc, &argv);
 
+  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) );
+    }
+
   /* Parse the command line. */
   pargs.argc  = &argc;
   pargs.argv  = &argv;
-- 
2.8.1




More information about the Gnupg-devel mailing list