From 8648640248246880e83af6b2cde24fde1f4b1c5b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 18 Jul 2016 15:35:41 +0100 Subject: [PATCH] [Fix] Fix border cases for incremental hashing --- src/libcryptobox/cryptobox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } /** -- 2.39.5