From: Vsevolod Stakhov Date: Thu, 8 Oct 2015 13:29:40 +0000 (+0100) Subject: Fix decrypt results checking. X-Git-Tag: 1.0.5~58 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c456b18a963242b80fbd30b3ad261d2c28502dab;p=rspamd.git Fix decrypt results checking. --- diff --git a/src/libutil/http.c b/src/libutil/http.c index f363969b4..612e898bb 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -690,7 +690,7 @@ rspamd_http_decrypt_message (struct rspamd_http_connection *conn, if (conn->cache) { if (!rspamd_cryptobox_decrypt_nm_inplace (m, dec_len, nonce, - peer_key->nm, m - rspamd_cryptobox_MACBYTES) != 0) { + peer_key->nm, m - rspamd_cryptobox_MACBYTES)) { msg_err ("cannot verify encrypted message"); return -1; } @@ -698,7 +698,7 @@ rspamd_http_decrypt_message (struct rspamd_http_connection *conn, else { if (!rspamd_cryptobox_decrypt_inplace (m, dec_len, nonce, peer_key->pk, priv->local_key->sk, - m - rspamd_cryptobox_MACBYTES) != 0) { + m - rspamd_cryptobox_MACBYTES)) { msg_err ("cannot verify encrypted message"); return -1; }