* Made $hashLength an int instead of an associative array of ints. All
acceptable hash functions have a digest size that is a multiple of
8 bits, so the hex length is always twice the binary (byte) length.
* Added types of both $algo and $hashLength using PHP 7.4 syntax.
Change-Id: Idc4592aa69a546b27bb0e77a3689f5d14d9ba7b8
* Replaced use of hash_algos() with hash_hmac_algos(), which was added
in PHP 7.2 and omits non-cryptographic hashing algorithms that are not
supported by hash_hmac().
* Removed MD5 and SHA-1 from the list of acceptable hash functions.
These functions are cryptographically broken and are not being used
anyway; all supported PHP versions support Whirlpool and SHA-256.
* Made the in_array() comparison strict as per coding conventions.
Change-Id: I3a3d43a790f71a4875a39c8788bef67ecf0181f0
These words referred to uses in MWCryptRand that were removed in
9bab7de5f8 and do not make much sense outside that context.
Change-Id: I0e05b357741a166a3fc5225fc4391764ba6e99a4
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
Remove the single wfDebug() call that was making this class MW specific,
someone can log the return value of MWCryptHash::hashAlgo() if they'd
like to know the specific implementation being used.
Change-Id: Ibb7ead7594edab7861631046dd8316daab613401
2016-10-01 23:19:28 -07:00
Renamed from includes/utils/MWCryptHash.php (Browse further)