commit e92d01d: [Minor] Distinguish invalid and missing keypair
Vsevolod Stakhov
vsevolod at highsecure.ru
Thu Jul 30 20:21:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-07-30 14:42:10 +0100
URL: https://github.com/rspamd/rspamd/commit/e92d01d68c4d119d5df9b8d3533aa737a3496732
[Minor] Distinguish invalid and missing keypair
---
src/rspamadm/signtool.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/rspamadm/signtool.c b/src/rspamadm/signtool.c
index d92071bfa..03f6ac60e 100644
--- a/src/rspamadm/signtool.c
+++ b/src/rspamadm/signtool.c
@@ -592,8 +592,13 @@ rspamadm_signtool (gint argc, gchar **argv, const struct rspamadm_command *cmd)
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");
+ if (kp == NULL) {
+ rspamd_fprintf (stderr, "invalid signing key\n");
+ exit (EXIT_FAILURE);
+ }
+
+ if (rspamd_keypair_type (kp) != RSPAMD_KEYPAIR_SIGN) {
+ rspamd_fprintf (stderr, "unsuitable for signing key\n");
exit (EXIT_FAILURE);
}
More information about the Commits
mailing list