Changeset 822e9bd


Ignore:
Timestamp:
Oct 15, 2011, 8:17:21 PM (13 years ago)
Author:
Jed Davis <jld@panix.com>
Children:
87d7e14
Parents:
ef4074b
git-author:
Jed Davis <jld@panix.com> (10/15/11 19:57:06)
git-committer:
Jed Davis <jld@panix.com> (10/15/11 20:17:21)
Message:
Fix SASL digest-uri to be acceptable to ejabberd.

This is, approximately, 68ad6bc and 8fe68e0 from the XML-Stream
repo.  The problem is that, if example.com pointed SRV records at
foo.example.com, we'd send "xmpp/foo.example.com" (which is, arguably,
what RFC 2831 calls for, but community consensus seems to disagree)
rather than "xmpp/example.com".

ejabberd would also accept "xmpp/foo.example.com/example.com", and
that would follow RFC 2831 more closely, but I don't want to introduce
divergence from the upstream unless there's an observed interoperability
problem that would be fixed by it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Jabber/lib/XML/Stream.pm

    ra8d5a39 r822e9bd  
    21122112
    21132113    return unless defined($mechanisms);
     2114
     2115    # Here we assume that if 'to' is available, then a domain is being
     2116    # specified that does not match the hostname of the jabber server
     2117    # and that we should use that to form the bare JID for SASL auth.
     2118    my $domain .=  $self->{SIDS}->{$sid}->{to}
     2119        ? $self->{SIDS}->{$sid}->{to}
     2120        : $self->{SIDS}->{$sid}->{hostname};
     2121
     2122    my $authname = $username . '@' . $domain;
    21142123   
    21152124    my $sasl = new Authen::SASL(mechanism=>join(" ",@{$mechanisms}),
    21162125                                callback=>{
    2117 #                                           authname => $username."@".$self->{SIDS}->{$sid}->{hostname},
     2126                                           authname => $authname,
     2127
    21182128                                           user     => $username,
    21192129                                           pass     => $password
     
    21212131                               );
    21222132
    2123     $self->{SIDS}->{$sid}->{sasl}->{client} = $sasl->client_new('xmpp', $self->{SIDS}->{$sid}->{hostname});
     2133    $self->{SIDS}->{$sid}->{sasl}->{client} = $sasl->client_new('xmpp', $domain);
    21242134    $self->{SIDS}->{$sid}->{sasl}->{username} = $username;
    21252135    $self->{SIDS}->{$sid}->{sasl}->{password} = $password;
Note: See TracChangeset for help on using the changeset viewer.