Changeset 3036:7ed4286c8013 for inc
- Timestamp:
- 07/03/15 17:03:26 (10 years ago)
- Branch:
- default
- Location:
- inc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.moduleslist.php
r3007 r3036 1172 1172 || !empty($_POST['fetch_pkg']) && !empty($_POST['pkg_url'])) 1173 1173 { 1174 if (empty($_POST['your_pwd']) || !$this->core->auth->checkPassword( crypt::hmac(DC_MASTER_KEY,$_POST['your_pwd']))) {1174 if (empty($_POST['your_pwd']) || !$this->core->auth->checkPassword($this->core->auth->crypt($_POST['your_pwd']))) { 1175 1175 throw new Exception(__('Password verification failed')); 1176 1176 } … … 1947 1947 || !empty($_POST['fetch_pkg']) && !empty($_POST['pkg_url'])) 1948 1948 { 1949 if (empty($_POST['your_pwd']) || !$this->core->auth->checkPassword( crypt::hmac(DC_MASTER_KEY,$_POST['your_pwd']))) {1949 if (empty($_POST['your_pwd']) || !$this->core->auth->checkPassword($this->core->auth->crypt($_POST['your_pwd']))) { 1950 1950 throw new Exception(__('Password verification failed')); 1951 1951 } -
inc/core/class.dc.auth.php
r2566 r3036 121 121 if ($pwd != '') 122 122 { 123 if ( crypt::hmac(DC_MASTER_KEY,$pwd) != $rs->user_pwd) {123 if ($this->crypt($pwd) != $rs->user_pwd) { 124 124 sleep(rand(2,5)); 125 125 return false; … … 165 165 166 166 /** 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 /** 167 178 * This method only check current user password. 168 179 * … … 290 301 $code = 291 302 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'))); 293 304 return bin2hex($code); 294 305 } … … 317 328 } 318 329 319 if ( crypt::hmac(DC_MASTER_KEY,$rs->user_pwd) != $pwd) {330 if ($this->crypt($rs->user_pwd) != $pwd) { 320 331 return false; 321 332 } … … 594 605 595 606 $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); 597 608 $cur->user_recover_key = null; 598 609 -
inc/core/class.dc.core.php
r3030 r3036 186 186 public function getNonce() 187 187 { 188 return crypt::hmac(DC_MASTER_KEY,session_id());188 return $this->auth->crypt(session_id()); 189 189 } 190 190 … … 195 195 } 196 196 197 return $secret == crypt::hmac(DC_MASTER_KEY,session_id());197 return $secret == $this->auth->crypt(session_id()); 198 198 } 199 199 … … 847 847 throw new Exception(__('Password must contain at least 6 characters.')); 848 848 } 849 $cur->user_pwd = crypt::hmac(DC_MASTER_KEY,$cur->user_pwd);849 $cur->user_pwd = $this->auth->crypt($cur->user_pwd); 850 850 } 851 851
Note: See TracChangeset
for help on using the changeset viewer.