aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-19 09:25:52 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-19 09:25:52 +0100
commit134c44511e1a863766e54deaeade909eecc97278 (patch)
treea93da146ddad7662581e2240ebca70f03ed891d8 /src/rspamadm
parent517e542fcfe4cde88785117b18119b10ab43c33f (diff)
downloadrspamd-134c44511e1a863766e54deaeade909eecc97278.tar.gz
rspamd-134c44511e1a863766e54deaeade909eecc97278.zip
Enable openssl mode for rspamadm
Diffstat (limited to 'src/rspamadm')
-rw-r--r--src/rspamadm/keypair.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rspamadm/keypair.c b/src/rspamadm/keypair.c
index d5ef2bce4..4e985ebe7 100644
--- a/src/rspamadm/keypair.c
+++ b/src/rspamadm/keypair.c
@@ -30,6 +30,7 @@
static gboolean hex_encode = FALSE;
static gboolean raw = FALSE;
+static gboolean openssl = FALSE;
static void rspamadm_keypair (gint argc, gchar **argv);
static const char *rspamadm_keypair_help (gboolean full_help);
@@ -46,6 +47,8 @@ static GOptionEntry entries[] = {
"Use hex encoding", NULL},
{"raw", 'r', 0, G_OPTION_ARG_NONE, &raw,
"Print just keys, no description", NULL},
+ {"openssl", 's', 0, G_OPTION_ARG_NONE, &openssl,
+ "Generate openssl nistp256 keypair not curve25519 one", NULL},
{NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL}
};
@@ -60,6 +63,7 @@ rspamadm_keypair_help (gboolean full_help)
"Where options are:\n\n"
"-x: encode with hex instead of base32\n"
"-r: print raw base32/hex\n"
+ "-s: generate openssl nistp256 keypair\n"
"--help: shows available options and commands";
}
else {
@@ -93,6 +97,13 @@ rspamadm_keypair (gint argc, gchar **argv)
exit (1);
}
+ if (openssl) {
+ if (!rspamd_cryptobox_openssl_mode (TRUE)) {
+ fprintf (stderr, "cannot enable openssl mode (incompatible openssl)\n");
+ exit (1);
+ }
+ }
+
keypair = rspamd_http_connection_gen_key ();
if (keypair == NULL) {
exit (EXIT_FAILURE);