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

Connection stuck after auth success when connecting to prosody v0.10+ #19

Open
eigengrau opened this issue Oct 13, 2016 · 2 comments
Open

Comments

@eigengrau
Copy link

eigengrau commented Oct 13, 2016

After upgrading my server to prosody v0.10, I’ve noticed that jabber.el reports the following error upon connecting:

Thu Oct 13 11:21:17 2016: Error in jabber-connection/:sasl-auth: Invalid base64 data

However, both the server log and jabber.el’s XML console log show that SASL authentication succeeds.

Subsequently, the roster is shown empty. When setting presence, no messages seem to be sent to the server, and fsm-debug reports that the event triggered are ignored in state jabber-connection/:sasl-auth.

The invalid base64 error might be related to the contents of the success message:

<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">=</success>

I’m not sure if this is legal or whether prosody is sending something broken here. Could you advise? Apparently the single = is legal as per rfc6120, via prosody’s issue tracker.

@eigengrau
Copy link
Author

eigengrau commented Oct 13, 2016

I tried working around the issue by forcing the contents of <success> to be empty on the client. This alleviated the stuck-after-auth issue, but as soon as jabber.el registers me as online and notifies me of contact presences, Emacs segfaults. Might be as separate issue though.

eigengrau added a commit to eigengrau/emacs-jabber that referenced this issue Nov 8, 2016
Servers are free to return the string “=” instead of actual base64 data in the
success message payload as per [1] (cf. [2]). Prosody does this as of v0.10.
Hence, despite login success, we choke when trying to base64-decode non-base64
data and get stuck after auth.

We avoid getting stuck by making sure the data is not just nil but also not a
void “=”.

[1] <http://xmpp.org/rfcs/rfc6120.html#sasl-process-neg-initiate>
[2] <https://prosody.im/issues/issue/729>

Fixes legoscia#19
@eigengrau
Copy link
Author

Turns out the Emacs crash was coincidental. The workaround actually works and allows logon to prosody after v0.10.

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

No branches or pull requests

1 participant