diff --git a/httpd/httpd.c b/httpd/httpd.c index 6ff824e..a97bb52 100644 --- a/httpd/httpd.c +++ b/httpd/httpd.c @@ -310,10 +310,12 @@ __xdata uint8_t *scan_header(__xdata uint8_t *p) return p; } - -void gen_random_bytes(__xdata uint8_t *b, register uint8_t bytes) +/* + * Generate random HEX-chars at the buffer location. + */ +void gen_random_hex_chars(__xdata uint8_t * b, __xdata uint8_t bytes) { - __xdata uint8_t i = 0; + uint8_t i = 0; while (bytes) { if (!i) get_random_32(); @@ -549,7 +551,7 @@ void handle_post(void) if (is_url_word_x(p, passwd)) { dbg_string("Password accepted!\n"); read_reg_timer(&last_session_use); - gen_random_bytes(session_id, SESSION_ID_LENGTH); + gen_random_hex_chars(session_id, SESSION_ID_LENGTH); session_id[SESSION_ID_LENGTH] = NUL; slen = strtox(outbuf, "HTTP/1.1 302 Found\r\nConnection: close\r\nLocation: index.html\r\n" \ "Set-Cookie: session=");