[JDEV] Problems with binding

Alexey Nezhdanov snake at penza-gsm.ru
Sun Dec 14 22:17:59 CST 2003


Robert Norris wrote:

>On Sat, Dec 13, 2003 at 05:30:21PM +0300, Alexey Nezhdanov wrote:
>  
>
>>Found strange behaiveour: server binds only "host/resource" and ignores 
>>the node part.
>>    
>>
>
>  
>
>>DEBUG: socket       sent  <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' 
>>mechanism='PLAIN'>d29vZHk4LnBlbnphLWdzbS5ydQB0ZXN0AHRlc3Q=\n</auth>
>>    
>>
>
>When decoded, this has an authzid of 'woody8.penza-gsm.ru' (no node
>part).
>
>However, jabberd2 should have thrown you off at this time. I'll add some
>extra checks to make sure it does.
>
Ok. Maked the change:
-            
sasl_data='%s\x00%s\x00%s'%(self._owner.Server,self.username,self.password)
+            
sasl_data='%s\x00%s\x00%s'%(self.username+'@'+self._owner.Server,self.username,self.password)
And fast-tested to view if binding corrected:
================================
DEBUG: socket       got   <stream:features 
xmlns:stream='http://etherx.jabber.org/streams'><mechanisms 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
DEBUG: socket       sent  <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' 
mechanism='PLAIN'>dGVzdEB3b29keTgucGVuemEtZ3NtLnJ1AHRlc3QAdGVzdA==\n</auth>
DEBUG: socket       got   <success 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
DEBUG: socket       sent  <?xml version='1.0'?><stream:stream 
version='1.0' xmlns:stream='http://etherx.jabber.org/streams' 
to='woody8.penza-gsm.ru' xmlns='jabber:client'>
DEBUG: socket       got   <?xml version='1.0'?><stream:stream 
xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' 
from='woody8.penza-gsm.ru' version='1.0' 
id='rhy9t7csywfox353rspqqp0en1xbzn5q440ybcqa'>
DEBUG: socket       got   <stream:features 
xmlns:stream='http://etherx.jabber.org/streams'><bind 
xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session 
xmlns='http://jabberd.jabberstudio.org/ns/session/1.0'/></stream:features>
DEBUG: socket       sent  <iq id='1' type='set'><bind 
xmlns='urn:ietf:params:xml:ns:xmpp-bind' /></iq>
DEBUG: socket       got   <iq xmlns='jabber:client' id='1' 
type='result'><bind 
xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>test at woody8.penza-gsm.ru/219e900d0e8d92752040bcab4c71835e3884dd69</jid></bind></iq>
DEBUG: socket       sent  <iq id='2' type='get'><query 
xmlns='jabber:iq:roster' /></iq>
DEBUG: socket       sent  <presence id='3' />
DEBUG: socket       got   <stream:error 
xmlns:stream='http://etherx.jabber.org/streams'><not-authorized 
xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
================================
It seems that I got another sort of error from now on. Subsequent run 
(with wrong password):
================================
DEBUG: socket       sent  <?xml version='1.0'?><stream:stream 
version='1.0' xmlns:stream='http://etherx.jabber.org/streams' 
to='woody8.penza-gsm.ru' xmlns='jabber:client'>
DEBUG: socket       got   <?xml version='1.0'?><stream:stream 
xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' 
from='woody8.penza-gsm.ru' version='1.0' 
id='7oymrciubfrsd0dstfcww7eucqnlp94wy3jpf2kq'>
DEBUG: socket       got   <stream:features 
xmlns:stream='http://etherx.jabber.org/streams'><starttls 
xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
DEBUG: socket       sent  <starttls 
xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
DEBUG: socket       got   <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
DEBUG: socket       sent  <?xml version='1.0'?><stream:stream 
version='1.0' xmlns:stream='http://etherx.jabber.org/streams' 
to='woody8.penza-gsm.ru' xmlns='jabber:client'>
DEBUG: socket       got   <?xml version='1.0'?><stream:stream 
xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' 
from='woody8.penza-gsm.ru' version='1.0' 
id='hbjucxn5cz287g3k7r5w0atydcose8jwk2qw0e2c'>
DEBUG: socket       got   <stream:features 
xmlns:stream='http://etherx.jabber.org/streams'><mechanisms 
xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
DEBUG: socket       sent  <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' 
mechanism='PLAIN'>dGVzdEB3b29keTgucGVuemEtZ3NtLnJ1AHRlc3QAdGVzdHJmZ3JlZw==\n</auth>
DEBUG: socket       error Socket error while receiving data
DEBUG: socket       error Socket operation failed
================================
When I returned password to the correct one the output still the same. 
Jabberd2 just closes the stream now without any notice. I will restart 
jabberd2 today and see if it will correct the error.

--
Respectively
Alexey Nezhdanov.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20031215/8532675c/attachment-0002.htm>


More information about the JDev mailing list