Only human readbale backup chars
Fixes #14811 Only use humand readable chars (so no I and 1 etc) Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
923735021b
commit
d878130fb2
|
@ -72,7 +72,7 @@ class BackupCodeStorage {
|
||||||
|
|
||||||
$uid = $user->getUID();
|
$uid = $user->getUID();
|
||||||
foreach (range(1, min([$number, 20])) as $i) {
|
foreach (range(1, min([$number, 20])) as $i) {
|
||||||
$code = $this->random->generate(self::$CODE_LENGTH, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS);
|
$code = $this->random->generate(self::$CODE_LENGTH, ISecureRandom::CHAR_HUMAN_READABLE);
|
||||||
|
|
||||||
$dbCode = new BackupCode();
|
$dbCode = new BackupCode();
|
||||||
$dbCode->setUserId($uid);
|
$dbCode->setUserId($uid);
|
||||||
|
|
|
@ -67,7 +67,7 @@ class BackupCodeStorageTest extends TestCase {
|
||||||
$user->method('getUID')->willReturn('fritz');
|
$user->method('getUID')->willReturn('fritz');
|
||||||
$this->random->expects($this->exactly($number))
|
$this->random->expects($this->exactly($number))
|
||||||
->method('generate')
|
->method('generate')
|
||||||
->with(16, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
|
->with(16, ISecureRandom::CHAR_HUMAN_READABLE)
|
||||||
->will($this->returnValue('CODEABCDEF'));
|
->will($this->returnValue('CODEABCDEF'));
|
||||||
$this->hasher->expects($this->exactly($number))
|
$this->hasher->expects($this->exactly($number))
|
||||||
->method('hash')
|
->method('hash')
|
||||||
|
|
Loading…
Reference in New Issue