Commit e0dbc43d authored by Thomas Löffler's avatar Thomas Löffler

Remove md5 and crypt from user model and add crypt_sha512

parent 366392b1
Pipeline #7387 passed with stages
in 2 minutes and 40 seconds
......@@ -512,19 +512,16 @@ class Ldap implements \Psr\Log\LoggerAwareInterface
/** @var \T3o\T3oLdap\Utility\PasswordHashing $passwordHashing */
$passwordHashing = GeneralUtility::makeInstance(\T3o\T3oLdap\Utility\PasswordHashing::class);
$ldapUserArray['userPassword'][] = $passwordHashing->getPasswordHash($user->getPassword(), 'sha1');
$ldapUserArray['userPassword'][] = $passwordHashing->getPasswordHash($user->getPassword(), 'crypt');
$ldapUserArray['userPassword'][] = $passwordHashing->getPasswordHash($user->getPassword(), 'md5');
$ldapUserArray['userPassword'][] = $passwordHashing->getPasswordHash($user->getPassword(), 'crypt_sha512');
}
// if hash fields are filled, store them into ldap user and remove them afterwards
if ($this->isSaltedPassword($user->getPassword()) && ($myProfileUser->getHashMd5() || $myProfileUser->getHashSha1() || $myProfileUser->getHashCrypt())) {
if ($this->isSaltedPassword($user->getPassword()) && ($myProfileUser->getHashSha1() || $myProfileUser->getHashCryptSha512())) {
$ldapUserArray['userPassword'][] = $myProfileUser->getHashSha1();
$ldapUserArray['userPassword'][] = $myProfileUser->getHashCrypt();
$ldapUserArray['userPassword'][] = $myProfileUser->getHashMd5();
$ldapUserArray['userPassword'][] = $myProfileUser->getHashCryptSha512();
$myProfileUser->setHashCrypt('');
$myProfileUser->setHashMd5('');
$myProfileUser->setHashSha1('');
$myProfileUser->setHashCryptSha512('');
$myProfileRepository->update($myProfileUser);
GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class)->persistAll();
}
......
......@@ -28,11 +28,6 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
*/
protected $termsVersion = '';
/**
* @var string
*/
protected $hashMd5 = '';
/**
* @var string
*/
......@@ -41,7 +36,7 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
/**
* @var string
*/
protected $hashCrypt = '';
protected $hashCryptSha512 = '';
/**
* @return string
......@@ -107,16 +102,6 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this->termsVersion = $termsVersion;
}
public function getHashMd5(): string
{
return $this->hashMd5;
}
public function setHashMd5(string $hashMd5)
{
$this->hashMd5 = $hashMd5;
}
public function getHashSha1(): string
{
return $this->hashSha1;
......@@ -127,13 +112,13 @@ class MyProfile extends \In2code\Femanager\Domain\Model\User
$this->hashSha1 = $hashSha1;
}
public function getHashCrypt(): string
public function getHashCryptSha512(): string
{
return $this->hashCrypt;
return $this->hashCryptSha512;
}
public function setHashCrypt(string $hashCrypt)
public function setHashCryptSha512(string $hashCryptSha512): void
{
$this->hashCrypt = $hashCrypt;
$this->hashCryptSha512 = $hashCryptSha512;
}
}
......@@ -7,9 +7,8 @@ CREATE TABLE fe_users (
facebook VARCHAR (255),
terms_version VARCHAR (255),
hash_md5 VARCHAR(255) DEFAULT '' NOT NULL,
hash_sha1 VARCHAR(255) DEFAULT '' NOT NULL,
hash_crypt VARCHAR(255) DEFAULT '' NOT NULL
hash_crypt_sha512 VARCHAR(255) DEFAULT '' NOT NULL
);
CREATE TABLE old_users (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment