-
Notifications
You must be signed in to change notification settings - Fork 226
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
Client anonymous authentication not working when sending empty trace string #258
Comments
An empty trace (argument passed to |
Right. Thanks for the pointer. If I'm not mistaken: With plain authentication, username and password are also required to be non-empty according to the RFC, however it is possible with the client to send all empty strings ( |
The SASL PLAIN RFC says that the identity is optional but username/password are required. Oh, hang on, I missed the square brackets in the ANONYMOUS RFC: it seems like the trace is optional after all! |
Yes, that was what I was referring to. I read it correct then. Your client api does not enforce it, which is fine, leaving it up to implementation of client and server to conform.
Aha. I missed that too after studying the link you referred to! |
So I think the issue is that we don't implement this bit of the SMTP AUTH RFC:
Would you be willing to try that out and send a patch? |
Sure. I will do that. |
With anonymous authentication according to RFC4505 the trace information string is optional, and SMTP authentication extension described in RFC4954 states that: If the client is transmitting an initial response of zero length, it MUST instead transmit the response as a single equals sign ("="). This indicates that the response is present, but contains no data. Fixes emersion#258
I've reached sort of a road block here, or at least a speed bump... I have implemented what I think will make the client and server more conformant; client sending By the way; This have effect for anonymous authentication, when sending empty trace message, but it does not affect plain authentication even if empty string is supplied for identity, username and password. That is because they are joined with a NUL character as separator before encoded to base64 and used in the auth command, and therefore when all are empty the result is a string of two NULs which encodes to base64 string "AAA=", so it does not end up in the same case as originally described in this issue. However, my changes do not solve my original case. I'm able to fix that by changing the go-sasl anonymous implementation, as suggested here: That makes my case with a go-smtp based client and server work with anonymous authentication with empty trace string - with or without my patch #259 in fact. |
Progress. Based on the following explanation from the go-sasl PR I think I will be able to solve this with the go-sasl change only, after an update to the go-sasl PR:
|
I've updated #259, force pushed a change that seem to fix this issue on its own (without the go-sasl change). Ready for review. |
Example code:
Output from a test server:
Output from a test client:
The text was updated successfully, but these errors were encountered: