Changeset 3405394


Ignore:
Timestamp:
Nov 11, 2006, 3:03:56 AM (14 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
51c57f8
Parents:
005562f
Message:
Protocol.pm: allow IQ Auth to take a password callback like SASL's.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/Net/XMPP/Protocol.pm

    r0ff8d110 r3405394  
    18311831    delete($args{digest});
    18321832    delete($args{type});
     1833    my $password = delete $args{password};
     1834    if (ref($password) eq 'CODE')
     1835    {
     1836        $password = $password->();
     1837    }
    18331838
    18341839    #--------------------------------------------------------------------------
     
    18441849    if ($authType eq "zerok")
    18451850    {
    1846         my $hashA = Digest::SHA1::sha1_hex(delete($args{password}));
     1851        my $hashA = Digest::SHA1::sha1_hex($password);
    18471852        $args{hash} = Digest::SHA1::sha1_hex($hashA.$token);
    18481853
     
    18631868    if ($authType eq "digest")
    18641869    {
    1865         my $password = delete($args{password});
    18661870        $args{digest} = Digest::SHA1::sha1_hex($self->GetStreamID().$password);
    18671871    }
     
    18851889    # return "".  If no then return error string from the reply.
    18861890    #--------------------------------------------------------------------------
     1891    $password =~ tr/\0-\377/x/;
    18871892    return unless defined($iqLogin);
    18881893    return ( $iqLogin->GetErrorCode() , $iqLogin->GetError() )
Note: See TracChangeset for help on using the changeset viewer.