diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-25 00:43:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-25 00:43:34 +0100 |
commit | 5c4626638cf38d7106d9549d05f768406849ea20 (patch) | |
tree | 5d4acd3a702c77084212cd555d9347e53160b71f /src/libutil | |
parent | eb38f643f3b26d552fb4503dcc8528e3388c9b99 (diff) | |
download | rspamd-5c4626638cf38d7106d9549d05f768406849ea20.tar.gz rspamd-5c4626638cf38d7106d9549d05f768406849ea20.zip |
Implement generating keypairs via rspamadm.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/http.c | 7 | ||||
-rw-r--r-- | src/libutil/http.h | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index 4405e3fc5..f1a1dac75 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -2230,13 +2230,14 @@ rspamd_http_print_key_component (guchar *data, gsize datalen, g_string_append_printf (res, "%s", b32); g_free (b32); } + else if (how & RSPAMD_KEYPAIR_HEX) { + rspamd_printf_gstring (res, "%*xs", (gint)datalen, data); + } else { g_string_append_len (res, data, datalen); } - if (how & RSPAMD_KEYPAIR_HUMAN) { - g_string_append_c (res, '\n'); - } + g_string_append_c (res, '\n'); } GString * diff --git a/src/libutil/http.h b/src/libutil/http.h index efd6d1e17..ffc820ce8 100644 --- a/src/libutil/http.h +++ b/src/libutil/http.h @@ -199,7 +199,8 @@ gboolean rspamd_http_connection_is_encrypted (struct rspamd_http_connection *con /** Encode output with base 32 */ #define RSPAMD_KEYPAIR_BASE32 0x8 /** Human readable output */ -#define RSPAMD_KEYPAIR_HUMAN 0x16 +#define RSPAMD_KEYPAIR_HUMAN 0x10 +#define RSPAMD_KEYPAIR_HEX 0x20 /** * Print keypair encoding it if needed * @param key key to print |