* [ADD] New encryption schema by using Defuse/php-encryption library. WARNING: work in progress

This commit is contained in:
nuxsmin
2017-02-20 15:16:52 +01:00
parent f173ea262b
commit 9b11e3eb3f
4 changed files with 17 additions and 5 deletions

View File

@@ -55,6 +55,8 @@ class AccountCrypt
*/
public function updateOldPass(&$currentMasterPass)
{
set_time_limit(300);
$accountsOk = [];
$userId = Session::getUserData()->getUserId();
$demoEnabled = Checks::demoIsEnabled();

View File

@@ -55,6 +55,8 @@ class AccountHistoryCrypt
*/
public function updateOldPass(&$currentMasterPass)
{
set_time_limit(300);
$accountsOk = [];
$demoEnabled = Checks::demoIsEnabled();
$errorCount = 0;

View File

@@ -51,18 +51,26 @@ class Crypt
public static function migrate(&$masterPass)
{
try {
DB::beginTransaction();
if (!DB::beginTransaction()) {
throw new SPException(SPException::SP_ERROR, __('No es posible iniciar una transacción', false));
}
self::migrateAccounts($masterPass);
self::migrateCustomFields($masterPass);
DB::endTransaction();
if (!DB::endTransaction()) {
throw new SPException(SPException::SP_ERROR, __('No es posible finalizar una transacción', false));
}
} catch (CryptoException $e) {
DB::rollbackTransaction();
if (DB::rollbackTransaction()) {
debugLog('Rollback');
}
return false;
} catch (SPException $e) {
DB::rollbackTransaction();
if (DB::rollbackTransaction()) {
debugLog('Rollback');
}
return false;
}

View File

@@ -226,8 +226,8 @@ class Upgrade
return $dbResult === true
&& is_object($UserData)
&& !empty($masterPass)
&& Crypt::migrateHash($masterPass)
&& Crypt::migrate($masterPass)
&& Crypt::migrateHash($masterPass)
&& UserMigrate::setMigrateUsers();
}
} catch (SPException $e) {