‪TYPO3CMS  10.4
Argon2iPasswordHashes.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
23 
30 {
34  protected ‪$confirmation;
35 
36  public function ‪__construct()
37  {
38  $this->confirmation = new ‪Confirmation(
39  'Please make sure to read the following carefully:',
40  $this->‪getDescription(),
41  false,
42  'Yes, I understand!',
43  '',
44  true
45  );
46  }
47 
51  public function ‪getIdentifier(): string
52  {
53  return 'argon2iPasswordHashes';
54  }
55 
59  public function ‪getTitle(): string
60  {
61  return 'Reminder to verify live system supports argon2i';
62  }
63 
67  public function ‪getDescription(): string
68  {
69  return 'TYPO3 uses the modern hash mechanism "argon2i" on this system. Existing passwords'
70  . ' will be automatically upgraded to this mechanism upon user login. If this instance'
71  . ' is later deployed to a different system, make sure the system does support argon2i'
72  . ' too, otherwise logins will fail. If that is not possible, select a different hash'
73  . ' algorithm in Setting > Presets > Password hashing settings and make sure no user'
74  . ' has been upgraded yet. This upgrade wizard exists only to inform you, it does not'
75  . ' change the system';
76  }
77 
83  public function ‪updateNecessary(): bool
84  {
85  $passwordHashFactory = GeneralUtility::makeInstance(PasswordHashFactory::class);
86  $feHash = $passwordHashFactory->getDefaultHashInstance('BE');
87  $beHash = $passwordHashFactory->getDefaultHashInstance('FE');
88  return $feHash instanceof Argon2iPasswordHash || $beHash instanceof Argon2iPasswordHash;
89  }
90 
94  public function ‪getPrerequisites(): array
95  {
96  return [
97  DatabaseUpdatedPrerequisite::class,
98  ];
99  }
100 
106  public function ‪executeUpdate(): bool
107  {
108  return true;
109  }
110 
116  public function ‪getConfirmation(): Confirmation
117  {
118  return ‪$this->confirmation;
119  }
120 }
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\$confirmation
‪Confirmation $confirmation
Definition: Argon2iPasswordHashes.php:33
‪TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory
Definition: PasswordHashFactory.php:27
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\__construct
‪__construct()
Definition: Argon2iPasswordHashes.php:35
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\getConfirmation
‪Confirmation getConfirmation()
Definition: Argon2iPasswordHashes.php:115
‪TYPO3\CMS\Install\Updates
Definition: AbstractDownloadExtensionUpdate.php:16
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\getIdentifier
‪string getIdentifier()
Definition: Argon2iPasswordHashes.php:50
‪TYPO3\CMS\Install\Updates\Confirmation
Definition: Confirmation.php:21
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\executeUpdate
‪bool executeUpdate()
Definition: Argon2iPasswordHashes.php:105
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\updateNecessary
‪bool updateNecessary()
Definition: Argon2iPasswordHashes.php:82
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\getTitle
‪string getTitle()
Definition: Argon2iPasswordHashes.php:58
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\getDescription
‪string getDescription()
Definition: Argon2iPasswordHashes.php:66
‪TYPO3\CMS\Install\Updates\UpgradeWizardInterface
Definition: UpgradeWizardInterface.php:24
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes
Definition: Argon2iPasswordHashes.php:30
‪TYPO3\CMS\Install\Updates\Argon2iPasswordHashes\getPrerequisites
‪string[] getPrerequisites()
Definition: Argon2iPasswordHashes.php:93
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Crypto\PasswordHashing\Argon2iPasswordHash
Definition: Argon2iPasswordHash.php:31
‪TYPO3\CMS\Install\Updates\ConfirmableInterface
Definition: ConfirmableInterface.php:24