diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-18 15:35:41 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-18 15:35:41 +0100 |
commit | 8648640248246880e83af6b2cde24fde1f4b1c5b (patch) | |
tree | 48ddbe3c51c2bc4c253f6423acf5da0f0a12a776 /src/libcryptobox | |
parent | ebc45e6c571fcd68aca4241293718646031704a6 (diff) | |
download | rspamd-8648640248246880e83af6b2cde24fde1f4b1c5b.tar.gz rspamd-8648640248246880e83af6b2cde24fde1f4b1c5b.zip |
[Fix] Fix border cases for incremental hashing
Diffstat (limited to 'src/libcryptobox')
-rw-r--r-- | src/libcryptobox/cryptobox.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index 08ae1fd8f..9e2d4b9cd 100644 --- a/src/libcryptobox/cryptobox.c +++ b/src/libcryptobox/cryptobox.c @@ -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); } /** |