Signed-off-by: Felix Fietkau <nbd@openwrt.org>
#include "uclient-utils.h"
#include "uclient-backend.h"
-static uint32_t nc;
-
enum auth_type {
AUTH_TYPE_UNKNOWN,
AUTH_TYPE_NONE,
long read_chunked;
long content_length;
+ uint32_t nc;
+
struct blob_buf headers;
struct blob_buf meta;
};
static void
get_cnonce(char *dest)
{
- uint32_t val = nc;
+ uint32_t val = 0;
FILE *f;
f = fopen("/dev/urandom", "r");
if (!realm || !data.qop || !data.nonce)
return;
- sprintf(nc_str, "%08x", nc++);
+ sprintf(nc_str, "%08x", uh->nc++);
get_cnonce(cnonce_str);
data.qop = "auth";