aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-10-22 15:40:38 +0200
committerGitHub <noreply@github.com>2019-10-22 15:40:38 +0200
commit6be518c64223e7d9356642ef060a5f9cc7df7d5d (patch)
tree07642490a35c88a8ce43c059e1ad68d4ee6853f9 /apps
parentac1585b316aa36c86f4265597bf9d970c61efdf7 (diff)
parentd878130fb292d8e38d0cd86089bf6aa1524e034a (diff)
downloadnextcloud-server-6be518c64223e7d9356642ef060a5f9cc7df7d5d.tar.gz
nextcloud-server-6be518c64223e7d9356642ef060a5f9cc7df7d5d.zip
Merge pull request #17628 from nextcloud/enh/14811/2fa_backup_chars
Only human readbale backup chars
Diffstat (limited to 'apps')
-rw-r--r--apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php2
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
index 88117c37ec0..7842dd610be 100644
--- a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
+++ b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
@@ -72,7 +72,7 @@ class BackupCodeStorage {
$uid = $user->getUID();
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->setUserId($uid);
diff --git a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
index d962961c251..7c662d3ef83 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
@@ -67,7 +67,7 @@ class BackupCodeStorageTest extends TestCase {
$user->method('getUID')->willReturn('fritz');
$this->random->expects($this->exactly($number))
->method('generate')
- ->with(16, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
+ ->with(16, ISecureRandom::CHAR_HUMAN_READABLE)
->will($this->returnValue('CODEABCDEF'));
$this->hasher->expects($this->exactly($number))
->method('hash')