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

Don’t base64-decode when there’s nothing to decode #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eigengrau
Copy link

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 #19

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

Ping?

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

Successfully merging this pull request may close these issues.

1 participant