summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens2026-05-31 15:27:40 +0000
committerHauke Mehrtens2026-06-07 11:24:37 +0000
commitf816506651d5ff61c74c15941684d507650aa8c5 (patch)
tree9d4d999d7c0ed41a2533ef41cf720081e6ad0b31
parent9dd0055d527d5fee1cb37f8debe28d2762150236 (diff)
downloaduclient-f816506651d5ff61c74c15941684d507650aa8c5.tar.gz
uclient-http: start digest nonce count at 1
RFC 7616 section 3.4 specifies that the first request sent in response to a given nonce must carry nc=00000001. uh->nc starts at 0 and the code used a post-increment, so the first digest request sent nc=00000000, which strict servers reject. Pre-increment so counting starts at 1. Assisted-by: Claude:claude-opus-4-8 Link: https://github.com/openwrt/uclient/pull/16 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--uclient-http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uclient-http.c b/uclient-http.c
index aa048c5..51b9bd0 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -567,7 +567,7 @@ uclient_http_add_auth_digest(struct uclient_http *uh)
goto fail;
}
- sprintf(nc_str, "%08x", uh->nc++);
+ sprintf(nc_str, "%08x", ++uh->nc);
err = get_cnonce(cnonce_str);
if (err)
goto fail;