Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 Crash #38

Open
Nazar78 opened this issue Apr 6, 2023 · 6 comments
Open

IPv6 Crash #38

Nazar78 opened this issue Apr 6, 2023 · 6 comments

Comments

@Nazar78
Copy link

Nazar78 commented Apr 6, 2023

Hi, I have issues using IPv6 authentication. It works in IPv4.

It initially crashed the workers, seen no similar issues opened or closed but then I realized it's in the ongoing pending 2019 PR #34. I then tried the patch compiling from the Debian 11 Nginx 1.18.0-6.1+deb11u3 source. Saw the warnings but it didn't error out as mentioned in the PR, so I proceed using it.

However after a few refresh, albeit successful authentication, it will eventually end up with a error 401. It's also being logged with 'ignoring authentication request - in evasion period' which I guess it never clears the auth_digest_maxtries counters despite successful authentication due to the warnings during the build.

I'm not very familiar with coding hoping this can be fixed soon, Thank you.

@Nazar78
Copy link
Author

Nazar78 commented Apr 8, 2023

I somewhat got it working with IPv6.

Instead of using sockaddr_storage as mentioned in this pending 2019 PR #34, I made all the ngx_memcpy occurrences for the source size to use the destination size if it's larger, idea sourced from https://stackoverflow.com/questions/1184291/creating-a-wrapper-for-strncpy-to-insert-terminating-null.

Tested with both IPv4 and IPv6 in evasive mode and it works as expected. However honestly I'm not sure of the implications by using a smaller size for the IPv6 evasive mode or this is even the correct approach solving this issue as I'm not well versed in C.

Anyone can advise?

@Nazar78

This comment was marked as duplicate.

@Nazar78
Copy link
Author

Nazar78 commented Apr 8, 2023

Created a fork master...Nazar78:nginx-http-auth-digest:master.

@erikdubbelboer
Copy link
Collaborator

I think that there are more places where addresses are used that need to be updated to fit ipv6. I'm afraid that I currently don't use this module anymore and don't have the time to look into this.

@Nazar78
Copy link
Author

Nazar78 commented Apr 15, 2023

Thank you for the reply. Just a question, do you happen to know which is the latest fork still being maintained?

@erikdubbelboer
Copy link
Collaborator

That is this one as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants