Changes from trunk/src/wp-includes/pluggable.php at r29635 to branches/4.0/src/wp-includes/pluggable.php at r30413
- File:
-
- 1 edited
-
branches/4.0/src/wp-includes/pluggable.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0/src/wp-includes/pluggable.php
r29635 r30413 670 670 671 671 $key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme ); 672 $hash = hash_hmac( 'sha256', $username . '|' . $expiration . '|' . $token, $key ); 672 673 // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. 674 $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; 675 $hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key ); 673 676 674 677 if ( ! hash_equals( $hash, $hmac ) ) { … … 735 738 736 739 $key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme ); 737 $hash = hash_hmac( 'sha256', $user->user_login . '|' . $expiration . '|' . $token, $key ); 740 741 // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. 742 $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; 743 $hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key ); 738 744 739 745 $cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash; … … 1934 1940 // If the hash is still md5... 1935 1941 if ( strlen($hash) <= 32 ) { 1936 $check = ( $hash == md5($password) );1942 $check = hash_equals( $hash, md5( $password ) ); 1937 1943 if ( $check && $user_id ) { 1938 1944 // Rehash using new hash.
Note: See TracChangeset
for help on using the changeset viewer.