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

Base64 encoding of SASL message not happening #4

Open
drboone opened this issue Jun 21, 2024 · 0 comments
Open

Base64 encoding of SASL message not happening #4

drboone opened this issue Jun 21, 2024 · 0 comments

Comments

@drboone
Copy link

drboone commented Jun 21, 2024

I'm having trouble authenticating to a server because the SASL exchange ends up sending the initial message without base64 encoding the message. Debug log follows. I've redacted the jid string and the hostname of the server.

I've done some basic checking, e.g. I think I have the newest tinyxmpp, tinysasl, base64 modules. Looking through the source, it's not at all clear to me how this is even possible.

Cluestick appreciated!

DEBUG:asyncio:Using selector: KqueueSelector
INFO:tinyxmpp:Connected to server.
DEBUG:tinyxmpp:SEND <?xml version='1.0'?><stream:stream from='redactedusername@redactedhost' to='redactedhost' version='1.0' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>
DEBUG:tinyxmpp:RECEIVED <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="redactedhost" id="11a3j2yl85" xml:lang="en" version="1.0"/>
DEBUG:tinyxmpp:RECEIVED <stream:features xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><ver xmlns="urn:xmpp:features:rosterver"/><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="https://www.igniterealtime.org/projects/openfire/" ver="zJwRlhv1+z7iJY5RFlHFXD/0/9U="/></stream:features>
INFO:tinyxmpp:Selecting auth mechanism SCRAM-SHA-1
DEBUG:tinyxmpp:SEND <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>n,,n=redactedusername,r=KwqrkevoYOlAnuek1rgg4X+rP4HEexXcn0lXO9Sv7zE=</auth>
DEBUG:tinyxmpp:SEND <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
DEBUG:tinyxmpp:RECEIVED <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl" xmlns:stream="http://etherx.jabber.org/streams"><incorrect-encoding/></failure>
ERROR:tinyxmpp:Could not authenticate: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl" xmlns:stream="http://etherx.jabber.org/streams"><incorrect-encoding/></failure>
DEBUG:tinyxmpp:RECEIVED <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" xmlns:stream="http://etherx.jabber.org/streams"/>
DEBUG:tinyxmpp:SEND <?xml version='1.0'?><stream:stream from='redactedusername@redactedhost' to='redactedhost' version='1.0' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>
DEBUG:tinyxmpp:RECEIVED <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="redactedhost" id="11a3j2yl85" xml:lang="en" version="1.0"/>
DEBUG:tinyxmpp:RECEIVED <stream:features xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><ver xmlns="urn:xmpp:features:rosterver"/><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="https://www.igniterealtime.org/projects/openfire/" ver="zJwRlhv1+z7iJY5RFlHFXD/0/9U="/></stream:features>
INFO:tinyxmpp:Selecting auth mechanism SCRAM-SHA-1
DEBUG:tinyxmpp:SEND <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>n,,n=redactedusername,r=nC1ppg96Ao+knYMYz4ZaM8UwhKJUrC0RpiO1sjgwzTY=</auth>
DEBUG:tinyxmpp:RECEIVED <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl" xmlns:stream="http://etherx.jabber.org/streams"><incorrect-encoding/></failure>
ERROR:tinyxmpp:Could not authenticate: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl" xmlns:stream="http://etherx.jabber.org/streams"><incorrect-encoding/></failure>
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