Make WordPress Core


Ignore:
Timestamp:
12/06/2015 10:03:41 PM (9 years ago)
Author:
nbachiyski
Message:

Docs: clarify inline docs for hash_equals

Before the docs implied the complexity of the function was O(1) by using the term "constant time", now we use the more descriptive term "Timing attack safe".

Props AramZS.
Fixes #32778.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r34981 r35805  
    229229if ( ! function_exists( 'hash_equals' ) ) :
    230230/**
    231  * Compare two strings in constant time.
     231 * Timing attack safe string comparison
     232 *
     233 * Compares two strings using the same time whether they're equal or not.
    232234 *
    233235 * This function was added in PHP 5.6.
    234  * It can leak the length of a string.
     236 *
     237 * Note: It can leak the length of a string when arguments of differing length are supplied.
    235238 *
    236239 * @since 3.9.2
    237240 *
    238241 * @param string $a Expected string.
    239  * @param string $b Actual string.
     242 * @param string $b Actual, user supplied, string.
    240243 * @return bool Whether strings are equal.
    241244 */
Note: See TracChangeset for help on using the changeset viewer.