1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2013-08-19 11:22:11 +02:00
parent 88914a9e24
commit 3966eb2445

View File

@ -150,6 +150,13 @@ main( int argc, char **argv )
i18n_init(); i18n_init();
init_common_subsystems (); 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); gnupg_init_signals (0, NULL);
opt.command_fd = -1; /* no command fd */ opt.command_fd = -1; /* no command fd */
@ -164,6 +171,8 @@ main( int argc, char **argv )
tty_batchmode(1); tty_batchmode(1);
disable_dotlock(); disable_dotlock();
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
pargs.argc = &argc; pargs.argc = &argc;
pargs.argv = &argv; pargs.argv = &argv;
pargs.flags= 1; /* do not remove the args */ pargs.flags= 1; /* do not remove the args */