]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Check sanity of a key
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 6 Feb 2016 13:30:13 +0000 (13:30 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 6 Feb 2016 13:30:13 +0000 (13:30 +0000)
src/rspamadm/signtool.c

index 8c9d9e705ad88c1488f0dd6978fca65879a07856..dfe8ac123a7f4b240b2a854fe9f3c22e0cf2b16c 100644 (file)
@@ -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 (