aboutsummaryrefslogtreecommitdiffstats
path: root/tools/symcryptrun.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-04-20 16:59:37 +0000
committerWerner Koch <[email protected]>2007-04-20 16:59:37 +0000
commitb89d98e3353f6101bc256476c0269f48a92d3f56 (patch)
tree6da6c9dd9e7b78f97ae6e89e54e6603f314cc644 /tools/symcryptrun.c
parent * certcheck.c (do_encode_md): Add arg PKEY. Add support for DSA2 (diff)
downloadgnupg-b89d98e3353f6101bc256476c0269f48a92d3f56.tar.gz
gnupg-b89d98e3353f6101bc256476c0269f48a92d3f56.zip
Improved logging for error orginating from libgcrypt.
Diffstat (limited to '')
-rw-r--r--tools/symcryptrun.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c
index 30fe8a92d..b45e356a9 100644
--- a/tools/symcryptrun.c
+++ b/tools/symcryptrun.c
@@ -96,25 +96,6 @@
#include "../common/simple-pwquery.h"
-/* Used by gcry for logging */
-static void
-my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
-{
- /* translate the log levels */
- switch (level)
- {
- case GCRY_LOG_CONT: level = JNLIB_LOG_CONT; break;
- case GCRY_LOG_INFO: level = JNLIB_LOG_INFO; break;
- case GCRY_LOG_WARN: level = JNLIB_LOG_WARN; break;
- case GCRY_LOG_ERROR:level = JNLIB_LOG_ERROR; break;
- case GCRY_LOG_FATAL:level = JNLIB_LOG_FATAL; break;
- case GCRY_LOG_BUG: level = JNLIB_LOG_BUG; break;
- case GCRY_LOG_DEBUG:level = JNLIB_LOG_DEBUG; break;
- default: level = JNLIB_LOG_ERROR; break; }
- log_logv (level, fmt, arg_ptr);
-}
-
-
/* From simple-gettext.c. */
/* We assume to have `unsigned long int' value with at least 32 bits. */
@@ -1053,10 +1034,10 @@ main (int argc, char **argv)
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
{
- log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
+ log_fatal (_("%s is too old (need %s, have %s)\n"), "libgcrypt",
NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
}
- gcry_set_log_handler (my_gcry_logger, NULL);
+ setup_libgcrypt_logging ();
gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
if (!opt.class)