Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Conversation

alberanid
Copy link

Fixed test for MD5, introduced test for SHA-256.

@@ -36,7 +36,7 @@ static int test_sip_auth_encode(void)
"10.0.0.1:37589;branch=z9hG4bK5625ce6f310a0fc8;rport=13718;"
"received=10.0.0.2\r\n"
"WWW-Authenticate: Digest realm=\"example.net\", "
"nonce=\"YZlVk2GZVGegVBZVKaMHpnxmUA+QyoSl\"\r\n"
"nonce=\"YZlVk2GZVGegVBZVKaMHpnxmUA+QyoSl\" algorithm=MD5\r\n"
Copy link
Member

@sreimers sreimers Jan 21, 2022

Choose a reason for hiding this comment

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

Without algorithm is valid test case too and should fallback to MD5 I think.

Copy link
Member

@sreimers sreimers Jan 28, 2022

Choose a reason for hiding this comment

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

For reference:

https://datatracker.ietf.org/doc/html/rfc2617#section-3.1.3

3.1.3 Representation of digest values

   An optional header allows the server to specify the algorithm used to
   create the checksum or digest. By default the MD5 algorithm is used
   and that is the only algorithm described in this document.
...
   algorithm
     A string indicating a pair of algorithms used to produce the digest
     and a checksum. If this is not present it is assumed to be "MD5".
     If the algorithm is not understood, the challenge should be ignored
     (and a different one used, if there is more than one).

Copy link
Author

Choose a reason for hiding this comment

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

I agree, MD5 should be taken as the default. For the moment let's keep the branches open, I'll try to work on them as soon as possible.

Thanks!

@alfredh alfredh closed this Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants