From 3966eb244518d5612385d35a5149f7164a9fb707 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 19 Aug 2013 11:22:11 +0200 Subject: [PATCH] gpgv: Init Libgcrypt to avoid syslog warning. * g10/gpgv.c (main): Check libgcrypt version and disable secure memory. -- GnuPG-bug-id: 1376 Signed-off-by: Werner Koch --- g10/gpgv.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/g10/gpgv.c b/g10/gpgv.c index 42452b721..b700f17ac 100644 --- a/g10/gpgv.c +++ b/g10/gpgv.c @@ -142,14 +142,21 @@ main( int argc, char **argv ) strlist_t sl; strlist_t nrings=NULL; unsigned configlineno; - + set_strusage (my_strusage); log_set_prefix ("gpgv", 1); - + /* Make sure that our subsystems are ready. */ i18n_init(); init_common_subsystems (); - + + 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) ); + } + gcry_control (GCRYCTL_DISABLE_SECMEM, 0); + gnupg_init_signals (0, NULL); opt.command_fd = -1; /* no command fd */ @@ -163,7 +170,9 @@ main( int argc, char **argv ) tty_no_terminal(1); tty_batchmode(1); disable_dotlock(); - + + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); + pargs.argc = &argc; pargs.argv = &argv; pargs.flags= 1; /* do not remove the args */