struct rspamd_client_connection {
gint fd;
GString *server_name;
- gpointer key;
- gpointer keypair;
+ struct rspamd_cryptobox_pubkey *key;
+ struct rspamd_cryptobox_keypair *keypair;
struct event_base *ev_base;
struct timeval timeout;
struct rspamd_http_connection *http_conn;
double_to_tv (timeout, &conn->timeout);
if (key) {
- conn->key = rspamd_http_connection_make_peer_key (key);
+ conn->key = rspamd_pubkey_from_base32 (key, 0, RSPAMD_KEYPAIR_KEX,
+ RSPAMD_CRYPTOBOX_MODE_25519);
+
if (conn->key) {
- conn->keypair = rspamd_http_connection_gen_key ();
+ conn->keypair = rspamd_keypair_new (RSPAMD_KEYPAIR_KEX,
+ RSPAMD_CRYPTOBOX_MODE_25519);
rspamd_http_connection_set_key (conn->http_conn, conn->keypair);
}
else {
req->msg = rspamd_http_new_message (HTTP_REQUEST);
if (conn->key) {
- req->msg->peer_key = rspamd_http_connection_key_ref (conn->key);
+ req->msg->peer_key = rspamd_pubkey_ref (conn->key);
}
if (in != NULL) {
}
close (conn->fd);
if (conn->key) {
- rspamd_http_connection_key_unref (conn->key);
+ rspamd_pubkey_unref (conn->key);
}
if (conn->keypair) {
- rspamd_http_connection_key_unref (conn->keypair);
+ rspamd_keypair_unref (conn->keypair);
}
g_string_free (conn->server_name, TRUE);
g_slice_free1 (sizeof (struct rspamd_client_connection), conn);