From 7aed036896d1d02a421858714797548ae5268e5e Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Mon, 14 Oct 2019 09:54:54 +0300 Subject: [PATCH] sha1: fixed libstrophe build issues on Windows Backported from NetXMS. --- src/sha1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sha1.c b/src/sha1.c index 429e22f..a1cbaae 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -197,8 +197,9 @@ void crypto_SHA1_Update(SHA1_CTX* context, const uint8_t* data, size_t i, j; j = (context->count[0] >> 3) & 63; - if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; - context->count[1] += (len >> 29); + if ((context->count[0] += (uint32_t)len << 3) < ((uint32_t)len << 3)) + context->count[1]++; + context->count[1] += (uint32_t)(len >> 29); if ((j + len) > 63) { memcpy(&context->buffer[j], data, (i = 64-j)); SHA1_Transform(context->state, context->buffer);