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

Add Digest AKA to Algorithm Directive from RFC 3110 and RFC 4169 #30

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

tobiasfunke1
Copy link
Contributor

@tobiasfunke1 tobiasfunke1 commented Jul 16, 2024

Hi,

I added changes to match the definition for the algorithm directive from RFC 3310:

           algorithm           =  "algorithm" EQUAL ( aka-namespace
                                  / algorithm-value )
           aka-namespace       =  aka-version "-" algorithm-value
           aka-version         =  "AKAv" 1*DIGIT
           algorithm-value     =  ( "MD5" / "MD5-sess" / token )

Since the no Digest AKA is supported right now, I decided to return an error on the handle_digest_challenge method. I added a second commit to add Digest AKA in the handle_digest_challenge method too.

Additional I decided to add some tests to check if the parsing works fine.

AKAv1: https://datatracker.ietf.org/doc/html/rfc3310#section-3.1
AKAv2: https://datatracker.ietf.org/doc/html/rfc4169#section-2

@tobiasfunke1 tobiasfunke1 force-pushed the add-digest-aka-extension branch 2 times, most recently from a6cf329 to 032118e Compare July 16, 2024 16:17
Copy link
Contributor Author

@tobiasfunke1 tobiasfunke1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update and remove some comments.

crates/sip-auth/src/digest.rs Outdated Show resolved Hide resolved
crates/sip-auth/src/digest.rs Outdated Show resolved Hide resolved
crates/sip-types/src/header/typed/auth.rs Outdated Show resolved Hide resolved
@tobiasfunke1 tobiasfunke1 marked this pull request as draft July 17, 2024 10:03
@tobiasfunke1 tobiasfunke1 marked this pull request as ready for review July 23, 2024 13:14
@tobiasfunke1
Copy link
Contributor Author

I clean up the code and the commits, this PR is ready to review. @kbalt If you have time, can you please look at it?

For Digest AKA the password used to generate the digest response can contain non-ascii chars. So I change the type of the password to a vector of u8.

...
The resulting AKA RES parameter is treated as a "password" when
   calculating the response directive of [RFC 2617](https://datatracker.ietf.org/doc/html/rfc2617).

source: https://datatracker.ietf.org/doc/html/rfc3310#section-3.3

@tobiasfunke1 tobiasfunke1 reopened this Jul 23, 2024
@tobiasfunke1
Copy link
Contributor Author

Sorry, I accidentally closed this PR with a force push. Now it should be open again.

@kbalt
Copy link
Owner

kbalt commented Jul 23, 2024

Thanks for your effort, I will look into this when I have a bit of time to check everything out!

@tobiasfunke1
Copy link
Contributor Author

Any updates on the review process?

@kbalt kbalt merged commit 3045a92 into kbalt:main Oct 1, 2024
1 check passed
@tobiasfunke1
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants