summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md5/md5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/md5/md5.c')
-rw-r--r--src/lib/libcrypto/md5/md5.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/libcrypto/md5/md5.c b/src/lib/libcrypto/md5/md5.c
index 744c66f005..3bc558f0f2 100644
--- a/src/lib/libcrypto/md5/md5.c
+++ b/src/lib/libcrypto/md5/md5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: md5.c,v 1.23 2024/06/01 07:36:16 tb Exp $ */ 1/* $OpenBSD: md5.c,v 1.24 2025/01/19 07:51:41 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -278,19 +278,13 @@ MD5_Update(MD5_CTX *c, const void *data_, size_t len)
278{ 278{
279 const unsigned char *data = data_; 279 const unsigned char *data = data_;
280 unsigned char *p; 280 unsigned char *p;
281 MD5_LONG l;
282 size_t n; 281 size_t n;
283 282
284 if (len == 0) 283 if (len == 0)
285 return 1; 284 return 1;
286 285
287 l = (c->Nl + (((MD5_LONG)len) << 3))&0xffffffffUL; 286 /* Update message bit counter. */
288 /* 95-05-24 eay Fixed a bug with the overflow handling, thanks to 287 crypto_add_u32dw_u64(&c->Nh, &c->Nl, (uint64_t)len << 3);
289 * Wei Dai <weidai@eskimo.com> for pointing it out. */
290 if (l < c->Nl) /* overflow */
291 c->Nh++;
292 c->Nh+=(MD5_LONG)(len>>29); /* might cause compiler warning on 16-bit */
293 c->Nl = l;
294 288
295 n = c->num; 289 n = c->num;
296 if (n != 0) { 290 if (n != 0) {