Harden HMAC verification. props duck_.
Built from https://develop.svn.wordpress.org/trunk@28053 git-svn-id: http://core.svn.wordpress.org/trunk@27883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5fa5b037ec
commit
7f001bfe24
|
@ -647,7 +647,7 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') {
|
|||
$key = wp_hash($username . $pass_frag . '|' . $expiration, $scheme);
|
||||
$hash = hash_hmac('md5', $username . '|' . $expiration, $key);
|
||||
|
||||
if ( $hmac != $hash ) {
|
||||
if ( hash_hmac( 'md5', $hmac, $key ) !== hash_hmac( 'md5', $hash, $key ) ) {
|
||||
/**
|
||||
* Fires if a bad authentication cookie hash is encountered.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue