]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix border cases for incremental hashing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Jul 2016 14:35:41 +0000 (15:35 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Jul 2016 14:35:41 +0000 (15:35 +0100)
src/libcryptobox/cryptobox.c

index 08ae1fd8fce0a0d69d5815bbc09034f6883cfb9e..9e2d4b9cd367003155a05bded4c40377ce9b813b 100644 (file)
@@ -1449,6 +1449,7 @@ rspamd_cryptobox_fast_hash_update (rspamd_cryptobox_fast_hash_state_t *st,
                len -= n;
                rst->h = mum_hash_step (rst->h, rst->buf);
                rst->buf = 0;
+               rst->pos = 0;
        }
 
        while (len > 8) {
@@ -1482,7 +1483,7 @@ rspamd_cryptobox_fast_hash_final (rspamd_cryptobox_fast_hash_state_t *st)
                rst->h = mum_hash_step (rst->h, rst->buf);
        }
 
-       return rst->h;
+       return mum_hash_finish (rst->h);
 }
 
 /**