aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/signtool.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-06 13:30:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-06 13:30:13 +0000
commit1a3627cee2990c65e8d7377399bf8558348cfbb3 (patch)
treeaff46aa50e357224a7ca7280b972c197d7204980 /src/rspamadm/signtool.c
parent81e728813bcd1f48030d29a66d27378029b1be30 (diff)
downloadrspamd-1a3627cee2990c65e8d7377399bf8558348cfbb3.tar.gz
rspamd-1a3627cee2990c65e8d7377399bf8558348cfbb3.zip
Check sanity of a key
Diffstat (limited to 'src/rspamadm/signtool.c')
-rw-r--r--src/rspamadm/signtool.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rspamadm/signtool.c b/src/rspamadm/signtool.c
index 8c9d9e705..dfe8ac123 100644
--- a/src/rspamadm/signtool.c
+++ b/src/rspamadm/signtool.c
@@ -348,6 +348,11 @@ rspamadm_signtool (gint argc, gchar **argv)
kp = rspamd_keypair_from_ucl (top);
+ if (kp == NULL || rspamd_keypair_type (kp) != RSPAMD_KEYPAIR_SIGN) {
+ rspamd_fprintf (stderr, "invalid or unsuitable for signing key\n");
+ exit (EXIT_FAILURE);
+ }
+
for (i = 1; i < argc; i++) {
/* XXX: support cmd line signature */
if (!rspamadm_sign_file (argv[i], rspamd_keypair_component (