Adding CRAM-MD5 server authentication #466
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #337 by adding support for CRAM-MD5 authentication.
I am unable to run the tests (they currently fail on master as well), but have tested this against my IMAP server which runs CRAM-MD5 authentication (debug log below to show it).
Would love some help figuring out how to provide a test suite for this as well.
Also I was unsure about how I'm sending the challenge response. I tried using
#_enqueue
but it was adding information to the start of the command; the challenge needs to be send with no leading information.I noticed this structure:
In
#_processQueue
but that uses the current request type to handle it's munging of the command. The challenge response has no type -- it's literally just the base64 encoded HMAC digest with the username pre-pended with a space, so I'm just writing directly to the socket and leavingthis._curReq
alone (which seems to be the best case out of all the methods I tried.)