Uh oh!
There was an error while loading. Please reload this page.
Digest auth new - #2098
Conversation
hyperxpro
commented
Jun 11, 2025
I'll have a look on the weekend. :) |
db10c8e to
735ab1cComparehyperxpro
commented
Jun 16, 2025
I think only the |
pratt4
commented
Jun 18, 2025
Thanks @hyperxpro for pointing that out! I’ve started implementing auth-int |
pratt4
commented
Jul 20, 2025
things to do
|
@hyperxpro i have fews questions it would be helpfull if you answer them 1)in Proxy auth is auth-int relevant? because as far as i know proxies happen before getting body Thanks! |
| * @return 2×length lower-case hex string | ||
| * @throws IllegalArgumentException if {@code bytes} is null | ||
| */ | ||
| public static String bytesToHex(byte[] bytes) { |
hyperxpro
commented
Jul 25, 2025
Thanks. I will try to review it ASAP. |
pratt4
commented
Aug 15, 2025
Hi @hyperxpro Thanks! |
hyperxpro
commented
Aug 16, 2025
@pratt4 Sorry, I was behind schedule. Let me take this up now. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| MessageDigest md = MessageDigestUtils.pooledMessageDigest(hashAlgorithm); | ||
| try { | ||
| md.update(responseInput.getBytes(StandardCharsets.ISO_8859_1)); |
| md.update(responseInput.getBytes(StandardCharsets.ISO_8859_1)); | ||
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } finally { | ||
| md.reset(); |
There was a problem hiding this comment.
We don't need to reset MessageDigest since we will return the hash and it won't be reused anymore.
| // For -sess: HA1 = H(H(username:realm:password):nonce:cnonce) | ||
| String sessInput = ha1 + ":" + realm.getNonce() + ":" + realm.getCnonce(); | ||
| md.reset(); | ||
| md.update(sessInput.getBytes(StandardCharsets.ISO_8859_1)); |
| return ha1; | ||
| } finally { | ||
| md.reset(); |
| md.update(bb); | ||
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } finally { | ||
| md.reset(); |
| md.update(request.getStringData().getBytes(charset)); | ||
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } finally { | ||
| md.reset(); |
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } finally { | ||
| md.reset(); |
| md.update(request.getByteData()); | ||
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } finally { | ||
| md.reset(); |
| throw new RuntimeException("Failed to hash request body", ioe); | ||
| } finally { | ||
| try { | ||
| md.reset(); |
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } catch (IOException ioe) { | ||
| throw new RuntimeException("Failed to hash request body", ioe); |
There was a problem hiding this comment.
This should be IOException not RuntimeException, because it is caused by an IO operation.
| md.update(bytes); | ||
| return MessageDigestUtils.bytesToHex(md.digest()); | ||
| } catch (IOException ioe) { | ||
| throw new RuntimeException("Failed to read file for auth-int hash", ioe); |
There was a problem hiding this comment.
This should be IOException not RuntimeException, because it is caused by an IO operation.
hyperxpro
commented
Aug 16, 2025
@pratt4 I will merge this into another branch where I will test it with the actual server implementation and see how it behaves before finally pushing to the main branch. It also requires some code formatting. Overall, great work! Thanks a lot :) |
pratt4
commented
Aug 18, 2025
@hyperxpro thanks for the review! I’m happy to fix the formatting issues myself if you can point them out along with the suggested changes and about testing in another branch.... i was just curious, Also, the improvements which I mentioned earlier in the previous comments for that i will create a separate PR, |
hyperxpro
commented
Aug 21, 2025
It won't be a zombie one; it will ship with the next release, but I need to test it. We don't have "SNAPSHOT" maven for this, so merging to a test branch is the only option before confirming full compliance with other implementations. |
Uh oh!
There was an error while loading. Please reload this page.
hyperxpro
commented
Sep 23, 2025
Merged this into another branch for now until I address remaining issues before merging into |
pratt4
commented
Sep 23, 2025
Thanks @hyperxpro Sorry I was little occupied in personal work all these days and couldn't fix/contribute to this branch... please feel tag any issue related to this feature and i will try to resolve it asap |
hyperxpro
commented
Sep 23, 2025
@pratt4 - No problem at all, thanks a lot for the great work. I will tag you in the final PR for the main branch. |
This is build on top of #2089
and still some changes are required around new testcases and failing testcases
closes#2068