xmppo / go-xmpp

Go XMPP Library (From Yasuhiro Matsumoto and based on the code from Russ Cox)
https://golang.org/
BSD 3-Clause "New" or "Revised" License
526 stars 170 forks source link

Authentication improvements. #165

Closed mdosch closed 8 months ago

mdosch commented 8 months ago

Add support for XEP-0474

The upcoming ejabberd release supports XEP-0474 [1] wich requires support for the d= parameter. Currently we fail if an unknown parameter is set and d= is unknown.

Instead of just not failing when d= is set I added support for the downgrade protection.

[1] https://xmpp.org/extensions/xep-0474.html

mdosch commented 8 months ago

@mattn What do you think about this? The XEP is currently experimental, but servers not supporting it would simply not set the d= part in the challenge and therefore it shouldn't have any negative impact for other servers.

I have succesfully tested the implementation against a server running the current development snapshot of ejabberd.

I'd like to get it also tested against this prosody module but I didn't get it to work on my server yet.

mdosch commented 8 months ago

Also successfully tested with the prosody module now.

mdosch commented 8 months ago

Ok, after some more testing I'm convinced this PR has no negative side effects. :)