Dotclear


Ignore:
Timestamp:
07/03/15 17:03:26 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Centralizes crypt function of pwd in class.Dotclear.auth.php, closes #1923

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.auth.php

    r2566 r3036  
    121121          if ($pwd != '') 
    122122          { 
    123                if (crypt::hmac(DC_MASTER_KEY,$pwd) != $rs->user_pwd) { 
     123               if ($this->crypt($pwd) != $rs->user_pwd) { 
    124124                    sleep(rand(2,5)); 
    125125                    return false; 
     
    165165 
    166166     /** 
     167      * This method crypt given string (password, session_id, …). 
     168      * 
     169      * @param string $pwd string to be crypted 
     170      * @return string crypted value 
     171      */ 
     172     public function crypt($pwd) 
     173     { 
     174          return crypt::hmac(DC_MASTER_KEY,$pwd); 
     175     } 
     176 
     177     /** 
    167178     * This method only check current user password. 
    168179     * 
     
    290301          $code = 
    291302          pack('a32',$this->userID()). 
    292           pack('H*',crypt::hmac(DC_MASTER_KEY,$this->getInfo('user_pwd'))); 
     303          pack('H*',$this->crypt($this->getInfo('user_pwd'))); 
    293304          return bin2hex($code); 
    294305     } 
     
    317328          } 
    318329 
    319           if (crypt::hmac(DC_MASTER_KEY,$rs->user_pwd) != $pwd) { 
     330          if ($this->crypt($rs->user_pwd) != $pwd) { 
    320331               return false; 
    321332          } 
     
    594605 
    595606          $cur = $this->con->openCursor($this->user_table); 
    596           $cur->user_pwd = crypt::hmac(DC_MASTER_KEY,$new_pass); 
     607          $cur->user_pwd = $this->crypt($new_pass); 
    597608          $cur->user_recover_key = null; 
    598609 
Note: See TracChangeset for help on using the changeset viewer.

Sites map