-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use password_hash for passwords instead of SHA1
Squashed version of PR #977, with several additional changes: - fix migration improperly removing default null for password column - migrate to ascii_bin collation - move migration ID to current date to avoid later confusion - use PASSWORD_DEFAULT instead of PASSWORD_BCRYPT - simplify/clarify password upgrade checks - upgrade passwords when validating outside login (e.g. when resetting password) - added additional tests for hash upgrades with wrong passwords Co-authored-by: John Flatness <[email protected]>
- Loading branch information
1 parent
798e267
commit 14022a5
Showing
8 changed files
with
132 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
application/migrations/20240717204800_growUserPassword.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Omeka | ||
* | ||
* @copyright Copyright 2007-2022 Roy Rosenzweig Center for History and New Media | ||
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU GPLv3 | ||
*/ | ||
|
||
/** | ||
* Increase length of salt and hash for user passwords | ||
* | ||
* @package Omeka\Db\Migration | ||
*/ | ||
class growUserPassword extends Omeka_Db_Migration_AbstractMigration | ||
{ | ||
public function up() | ||
{ | ||
$this->db->query("ALTER TABLE {$this->db->User} MODIFY `password` VARCHAR(255) COLLATE ascii_bin DEFAULT NULL"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters