From 00321a025f90990a71b60b4689ede1f38fbde347 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 24 Oct 2018 10:40:42 +0200 Subject: dirmngr: Add FLUSHCRLs command Summary: * dirmngr/crlcache.c (crl_cache_flush): Also deinit the cache. * dirmngr/server.c (hlp_flushcrls, cmd_flushcrls): New. (register_commands): Add FLUSHCRLS. -- This allows it to flush the CRL cache of a running dirmngr server. This can be useful to debug / analyze CRL issues. GnuPG-Bug-Id: T3967 Differential Revision: https://dev.gnupg.org/D469 Signed-off-by: Andre Heinecke --- dirmngr/server.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dirmngr/server.c') diff --git a/dirmngr/server.c b/dirmngr/server.c index d414c0e62..272b95aa2 100644 --- a/dirmngr/server.c +++ b/dirmngr/server.c @@ -2689,6 +2689,20 @@ cmd_reloaddirmngr (assuan_context_t ctx, char *line) } +static const char hlp_flushcrls[] = + "FLUSHCRLS\n" + "\n" + "Remove all cached CRLs from memory and\n" + "the file system."; +static gpg_error_t +cmd_flushcrls (assuan_context_t ctx, char *line) +{ + (void)line; + + return leave_cmd (ctx, crl_cache_flush () ? GPG_ERR_GENERAL : 0); +} + + /* Tell the assuan library about our commands. */ static int @@ -2719,6 +2733,7 @@ register_commands (assuan_context_t ctx) { "LOADSWDB", cmd_loadswdb, hlp_loadswdb }, { "KILLDIRMNGR",cmd_killdirmngr,hlp_killdirmngr }, { "RELOADDIRMNGR",cmd_reloaddirmngr,hlp_reloaddirmngr }, + { "FLUSHCRLS", cmd_flushcrls, hlp_flushcrls }, { NULL, NULL } }; int i, j, rc; -- cgit v1.2.3