]> source.dussan.org Git - rspamd.git/commitdiff
Fix decrypt results checking.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 8 Oct 2015 13:29:40 +0000 (14:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 8 Oct 2015 13:29:40 +0000 (14:29 +0100)
src/libutil/http.c

index f363969b4f523175ea3b6156773e78d5a978f4c0..612e898bb2189d29d0e97f46728233585a20b2eb 100644 (file)
@@ -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;
                }