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