From ddc00caeab38019d9d34fed60168dc33de754b1f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 28 Jan 2015 17:52:59 +0000 Subject: Rework key API to allow reusing of keypairs. --- src/libutil/http.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/libutil/http.h') diff --git a/src/libutil/http.h b/src/libutil/http.h index 10634e2c7..5234fe46b 100644 --- a/src/libutil/http.h +++ b/src/libutil/http.h @@ -148,14 +148,20 @@ struct rspamd_http_connection * rspamd_http_connection_new ( enum rspamd_http_connection_type type); /** - * Load the encryption keypair for this connection - * @param conn connection structure + * Load the encryption keypair * @param key base32 encoded privkey and pubkey (in that order) * @param keylen length of base32 string - * @return TRUE if a key has been loaded successfully + * @return opaque pointer pr NULL in case of error + */ +gpointer rspamd_http_connection_make_key (gchar *key, gsize keylen); + +/** + * Set key pointed by an opaque pointer + * @param conn connection structure + * @param key opaque key structure */ -gboolean rspamd_http_connection_set_key (struct rspamd_http_connection *conn, - gchar *key, gsize keylen); +void rspamd_http_connection_set_key (struct rspamd_http_connection *conn, + gpointer key); /** * Handle a request using socket fd and user data ud -- cgit v1.2.3