aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/digestauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r--src/microhttpd/digestauth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index d35a87a7..e9a7e35f 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -590,7 +590,7 @@ check_nonce_nc (struct MHD_Connection *connection,
590 mod = daemon->nonce_nc_size; 590 mod = daemon->nonce_nc_size;
591 if (0 == mod) 591 if (0 == mod)
592 return MHD_CHECK_NONCENC_STALE; /* no array! */ 592 return MHD_CHECK_NONCENC_STALE; /* no array! */
593 if (nc >= UINT64_MAX - 64) 593 if (nc >= UINT32_MAX - 64)
594 return MHD_CHECK_NONCENC_STALE; /* Overflow, unrealistically high value */ 594 return MHD_CHECK_NONCENC_STALE; /* Overflow, unrealistically high value */
595 595
596 nn = &daemon->nnc[get_nonce_nc_idx (mod, nonce, noncelen)]; 596 nn = &daemon->nnc[get_nonce_nc_idx (mod, nonce, noncelen)];
@@ -649,7 +649,7 @@ check_nonce_nc (struct MHD_Connection *connection,
649 else if (nc > nn->nc) 649 else if (nc > nn->nc)
650 { 650 {
651 /* 'nc' is larger, shift bitmask and bump limit */ 651 /* 'nc' is larger, shift bitmask and bump limit */
652 const uint64_t jump_size = nc - nn->nc; 652 const uint32_t jump_size = (uint32_t) nc - nn->nc;
653 if (64 > jump_size) 653 if (64 > jump_size)
654 { 654 {
655 /* small jump, less than mask width */ 655 /* small jump, less than mask width */
@@ -661,7 +661,7 @@ check_nonce_nc (struct MHD_Connection *connection,
661 nn->nmask = (UINT64_C (1) << 63); 661 nn->nmask = (UINT64_C (1) << 63);
662 else 662 else
663 nn->nmask = 0; /* big jump, unset all bits in the mask */ 663 nn->nmask = 0; /* big jump, unset all bits in the mask */
664 nn->nc = nc; 664 nn->nc = (uint32_t) nc;
665 ret = MHD_CHECK_NONCENC_OK; 665 ret = MHD_CHECK_NONCENC_OK;
666 } 666 }
667 else if (nc < nn->nc) 667 else if (nc < nn->nc)