Closed mdosch closed 1 month ago
I fixed this recently in https://github.com/processone/xmpp/commit/1b1418ab2f79b26c31a6cd6c91d32fb477b56850
This fixes crash in case of client sending bind2 tag but no user-agent, as we tried to use missing user-agent to generate stable resource.
But in my scenario there is a user-tag but no ID. Still ejabberd gives me a stable resource.
This change is not yet available in ejabberd, it was added to library that ejabberd uses, but ejabberd uses version of that library from before that change was introduced.
And this change should also be triggered case where there is missing/empty id in user-agent
@mdosch, messaging.one now has the commit in question, just in case you'd like to test it. If things look fine, this issue could be closed I guess.
Seems to still set a stable resource in absence of user-agent id:
<authenticate xmlns='urn:xmpp:sasl:2' mechanism='SCRAM-SHA-1-PLUS'><initial-response>cD10bHMtZXhwb3J0ZXIsLG49bWRvc2NoLHI9ODk2OWQ3ZjcyOWQzOTRiZA==</initial-response><user-agent><software>go-sendxmpp</software></user-agent><bind xmlns='urn:xmpp:bind:0'><tag>go-sendxmpp</tag></bind></authenticate>
[…]
<success xmlns='urn:xmpp:sasl:2'><bound xmlns='urn:xmpp:bind:0'/><authorization-identifier>mdosch@messaging.one/go-sendxmpp.xuIUkF6Ve2</authorization-identifier><additional-data>dj1PdHVqU0dCSWo5WnUwMHJEWEh6NWFsWHljR3c9</additional-data></success>
<authenticate xmlns='urn:xmpp:sasl:2' mechanism='SCRAM-SHA-1-PLUS'><initial-response>cD10bHMtZXhwb3J0ZXIsLG49bWRvc2NoLHI9OGJiYzYxODE1NmM1ZmRlOA==</initial-response><user-agent><software>go-sendxmpp</software></user-agent><bind xmlns='urn:xmpp:bind:0'><tag>go-sendxmpp</tag></bind></authenticate>
[…]
<success xmlns='urn:xmpp:sasl:2'><bound xmlns='urn:xmpp:bind:0'/><authorization-identifier>mdosch@messaging.one/go-sendxmpp.xuIUkF6Ve2</authorization-identifier><additional-data>dj04NkV2OXlUYk1VckdDdjRmR1RXZGd6UWd4YlU9</additional-data></success>
Hm, i will see if i can reproduce that then, but from looking at what code does i though we should be skip code that does that without id.
Looks like i had a typo that didn't properly detect empty id - fixed in https://github.com/processone/xmpp/commit/12a2e3feadc0dfdf6a56a2b17925c1275adc2ef9
Thanks, I can confirm that it works now as expected.
Environment
@weiss might fill the gaps if necessary.
Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml
unknown
Errors from error.log/crash.log
unknown
Bug description
Ejabberd is providing a stable resource although no id attribute is set in the user-agent element.