mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 12:11:40 +00:00
194ecc28eb
* remove insecure rng providers and remove the openssl provider. We now rely exclusively on random_bytes(), as there are no reasons not to. Fix #121 * remove the isSecure property of the test rng class * remove pointless test rng class we were testing a test class, which didn't make a lot of sense. * Revert "remove pointless test rng class" This reverts commitf6da6bee6d. * Reapply "remove pointless test rng class" This reverts commit06220d4a54. * assing rng provider to class attribute this also aligns with other providers * remove polyfill for hash_equals
17 lines
282 B
PHP
17 lines
282 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace RobThree\Auth\Providers\Rng;
|
|
|
|
class CSRNGProvider implements IRNGProvider
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getRandomBytes(int $bytecount): string
|
|
{
|
|
return random_bytes($bytecount); // PHP7+
|
|
}
|
|
}
|