From 6e60421533749586a0336976e471d9c91f6fd8a3 Mon Sep 17 00:00:00 2001 From: cr-marcstevens Date: Mon, 13 Mar 2017 21:06:49 +0100 Subject: Small bug fix for new code when UBC is disabled --- lib/sha1.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/sha1.c b/lib/sha1.c index 745d7f5..fa552af 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -985,8 +985,9 @@ sha1_recompression_type sha1_recompression_step[80] = void sha1_process(SHA1_CTX* ctx, const uint32_t block[16]) { unsigned i, j; - uint32_t ubc_dv_mask[DVMASKSIZE] = { 0 }; + uint32_t ubc_dv_mask[DVMASKSIZE] = { 0xFFFFFFFF }; uint32_t ihvtmp[5]; + /* for (i=0; i < DVMASKSIZE; ++i) ubc_dv_mask[i]=0; @@ -1001,15 +1002,12 @@ void sha1_process(SHA1_CTX* ctx, const uint32_t block[16]) if (ctx->detect_coll) { - int perform_full_check = 1; - if (ctx->ubc_check) { ubc_check(ctx->m1, ubc_dv_mask); - perform_full_check = CHECK_DVMASK(ubc_dv_mask); } - if (perform_full_check) + if (ubc_dv_mask[0] != 0) { for (i = 0; sha1_dvs[i].dvType != 0; ++i) { -- cgit v1.2.3