atomx / nginx-http-auth-digest

Digest Authentication for Nginx
Other
44 stars 14 forks source link

Extra null-char added after realm in "WWW-Authenticate" of HTTP request #8

Closed borkhuis closed 7 years ago

borkhuis commented 7 years ago

When testing with Firefox (I tested with Chrome before) I noticed that I could not connect anymore after enabling authentication. When inspecting the data using Wireshark I saw that there was an extra null character in the realm-name when using variables, compared to a direct realm (or off) in the configuration file.

Suggested fix: Add

size_t realm_len = strnlen((const char *)realm->data, realm->len);

in function ngx_http_auth_digest_send_challenge and use this instead of directly using realm->len.

erikdubbelboer commented 7 years ago

Thanks for the fix.