Plugin Directory

Changeset 1327155


Ignore:
Timestamp:
01/13/2016 02:52:36 AM (10 years ago)
Author:
Jehan
Message:

Auth: upgrading SASL lib to Auth_SASL2 0.1.0.

Auth_SASL is not maintained anymore and has been superseded by Auth_SASL2.
Well it does not look that much more active. But for now it will do.

Location:
xmpp-auth/trunk
Files:
10 added
3 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • xmpp-auth/trunk/xmpp_stream.php

    r434713 r1327155  
    2121*/
    2222
    23 require_once(dirname(__FILE__) . '/Auth/SASL.php');
    24 require_once(dirname(__FILE__) . '/Auth/SASL/DigestMD5.php');
    25 require_once(dirname(__FILE__) . '/Auth/SASL/Plain.php');
    26 require_once(dirname(__FILE__) . '/Auth/SASL/CramMD5.php');
    27 require_once(dirname(__FILE__) . '/Auth/SASL/SCRAM.php');
    28 //require_once('./Auth/SASL/Anonymous.php');
     23require_once(dirname(__FILE__) . '/Auth/SASL2.php');
     24require_once(dirname(__FILE__) . '/Auth/SASL2/DigestMD5.php');
     25require_once(dirname(__FILE__) . '/Auth/SASL2/Plain.php');
     26require_once(dirname(__FILE__) . '/Auth/SASL2/CramMD5.php');
     27require_once(dirname(__FILE__) . '/Auth/SASL2/SCRAM.php');
     28//require_once('./Auth/SASL2/Anonymous.php');
    2929$old_error_level = error_reporting(0);
    3030include_once "Net/DNS.php"; // For SRV Records. // Optional.
     
    581581            if ($this->chosen_mechanism == "DIGEST-MD5")
    582582            {
    583                 $sasl = new Auth_SASL_DigestMD5 ();
     583                $sasl = new Auth_SASL2_DigestMD5 ();
    584584                $uncoded = $sasl->getResponse ($this->node, $this->password, $decoded_challenge, $this->domain, 'xmpp');
    585585
     
    600600                // Apparently that never gets used!
    601601                if (!isset($this->sasl))
    602                     $this->sasl = new Auth_SASL_SCRAM('SHA-1');
     602                    $this->sasl = new Auth_SASL2_SCRAM('SHA-1');
    603603                $uncoded = $this->sasl->getResponse ($this->node, $this->password, $decoded_challenge);
    604604
     
    616616            elseif ($this->chosen_mechanism == "CRAM-MD5")
    617617            {
    618                 $sasl = new Auth_SASL_CramMD5 ();
     618                $sasl = new Auth_SASL2_CramMD5 ();
    619619                $uncoded = $sasl->getResponse ($this->node, $this->password, $decoded_challenge);
    620620                // To be tested. Should the first argument be full jid or just username?
     
    634634            elseif ($this->chosen_mechanism == "ANONYMOUS")
    635635            {
    636                 $sasl = new Auth_SASL_Anonymous ();
     636                $sasl = new Auth_SASL2_Anonymous ();
    637637                $uncoded = $sasl->getResponse ();
    638638            }
     
    738738                if ($this->chosen_mechanism == "PLAIN")
    739739                {
    740                     $sasl = new Auth_SASL_Plain ();
     740                    $sasl = new Auth_SASL2_Plain ();
    741741                    $uncoded = $sasl->getResponse ($this->node . '@' . $this->domain, $this->password);
    742742
     
    750750                    // Apparently I don't come here!
    751751                    if (!isset($this->sasl))
    752                         $this->sasl = new Auth_SASL_SCRAM('SHA-1');
     752                        $this->sasl = new Auth_SASL2_SCRAM('SHA-1');
    753753                    $uncoded = $this->sasl->getResponse ($this->node, $this->password);
    754754                    $coded = base64_encode ($uncoded);
     
    798798                else
    799799                {
    800                     $sasl = new Auth_SASL_DigestMD5 ();
     800                    $sasl = new Auth_SASL2_DigestMD5 ();
    801801                    $uncoded = $sasl->getResponse ($this->node, $this->password, $decoded_challenge, $this->domain, 'xmpp');
    802802                }
     
    805805            {
    806806                if (!isset($this->sasl))
    807                     $this->sasl = new Auth_SASL_SCRAM('SHA-1');
     807                    $this->sasl = new Auth_SASL2_SCRAM('SHA-1');
    808808                $uncoded = $this->sasl->getResponse ($this->node, $this->password, $decoded_challenge);
    809809            }
    810810            elseif ($this->chosen_mechanism == "CRAM-MD5")
    811811            {
    812                 $sasl = new Auth_SASL_CramMD5 ();
     812                $sasl = new Auth_SASL2_CramMD5 ();
    813813                $uncoded = $sasl->getResponse ($this->node, $this->password, $decoded_challenge);
    814814                // To be tested. Should the first argument be full jid or just username?
     
    816816            elseif ($this->chosen_mechanism == "ANONYMOUS")
    817817            {
    818                 $sasl = new Auth_SASL_Anonymous ();
     818                $sasl = new Auth_SASL2_Anonymous ();
    819819                $uncoded = $sasl->getResponse ();
    820820            }
     
    879879                if ($this->chosen_mechanism == "PLAIN")
    880880                {
    881                     $sasl = new Auth_SASL_Plain ();
     881                    $sasl = new Auth_SASL2_Plain ();
    882882                    $uncoded = $sasl->getResponse ($this->node . '@' . $this->domain, $this->password);
    883883
     
    891891                    if (!isset($this->sasl))
    892892                    {
    893                         //$this->sasl = new Auth_SASL_SCRAM('SHA-1');
    894                         $sasl = new Auth_SASL();
     893                        //$this->sasl = new Auth_SASL2_SCRAM('SHA-1');
     894                        $sasl = new Auth_SASL2();
    895895                        $this->sasl = $sasl->factory('SCRAM-SHA-1');
    896896                    }
Note: See TracChangeset for help on using the changeset viewer.