From 0d16792e387ccb9d71afe31101a7e77eb70314ef Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 30 Jan 2015 18:08:25 +0000 Subject: [PATCH] Set peer's key properly. --- src/libutil/http.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libutil/http.c b/src/libutil/http.c index 0500f18ef..dc4774c2f 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -908,8 +908,6 @@ rspamd_http_connection_reset (struct rspamd_http_connection *conn) REF_RELEASE (priv->buf); } - priv->encrypted = FALSE; - rspamd_http_parser_reset (conn); if (priv->out != NULL) { @@ -1039,6 +1037,8 @@ rspamd_http_connection_write_message (struct rspamd_http_connection *conn, bodylen += crypto_box_NONCEBYTES + crypto_box_ZEROBYTES; } + peer_key = (struct rspamd_http_keypair *)msg->peer_key; + if (conn->type == RSPAMD_HTTP_SERVER) { /* Format reply */ if (msg->method < HTTP_SYMBOLS) { @@ -1094,7 +1094,6 @@ rspamd_http_connection_write_message (struct rspamd_http_connection *conn, bodylen); } if (encrypted) { - peer_key = (struct rspamd_http_keypair *)msg->peer_key; memcpy (id, peer_key->id, sizeof (id)); b32_key = rspamd_encode_base32 (priv->local_key->pk, sizeof (priv->local_key->pk)); -- 2.39.5