diff --git a/CHANGELOG.md b/CHANGELOG.md index 17edfd4..b676f34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Added -- SHA512 Whirlpool hashing algorithm -- WoltLab Community Framework 2.x hashing algorithm -- phpass hashing implementation +- SHA512 Whirlpool hash algorithm +- WoltLab Community Framework 2.x hash algorithm +- phpass hash implementation - Support for salt column ### Changed @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [4.0.0-rc1] - 2018-06-13 ### Added -- New hashing algorithms: Argon2 Crypt (PHP 7.2 and above), Blowfish Crypt, Courier base64-encoded MD5, Courier base64-encoded SHA1, Courier base64-encoded SHA256, Courier hexadecimal MD5, Extended DES Crypt, SHA256 Crypt, SHA512 Crypt, SSHA512, Standard DES Crypt +- New hash algorithms: Argon2 Crypt (PHP 7.2 and above), Blowfish Crypt, Courier base64-encoded MD5, Courier base64-encoded SHA1, Courier base64-encoded SHA256, Courier hexadecimal MD5, Extended DES Crypt, SHA256 Crypt, SHA512 Crypt, SSHA512, Standard DES Crypt - Option to allow users to change their display names - Option to allow user to change its avatar - Database query results cache @@ -38,9 +38,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Minimum supported PHP version - 7.0 ### Removed -- MySQL ENCRYPT() hashing implementation - Function is deprecated as of MySQL 5.7.6 and will be removed in a future MySQL release. -- MySQL PASSWORD() hashing implementation - Function is deprecated as of MySQL 5.7.6 and will be removed in a future MySQL release. -- Redmine hashing implementation - Cannot implement in new core system. +- MySQL ENCRYPT() hash implementation - Function is deprecated as of MySQL 5.7.6 and will be removed in a future MySQL release. +- MySQL PASSWORD() hash implementation - Function is deprecated as of MySQL 5.7.6 and will be removed in a future MySQL release. +- Redmine hash implementation - Cannot implement in new core system. - User active column - Use database view instead - Domain support diff --git a/README.md b/README.md index d1aee0c..536c6cd 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Name | Description | Details **Allow display name change** | With this option enabled user can change its display name. The display name change is propagated to the database. | Optional.
Default: false.
Requires: user *Display name* column. **Allow password change** | Can user change its password. The password change is propagated to the database. See [Hash algorithms](#hash-algorithms). | Optional.
Default: false. **Use cache** | Use database query results cache. The cache can be cleared any time with the *Clear cache* button click. | Optional.
Default: false. -**Hashing algorithm** | How users passwords are stored in the database. See [Hash algorithms](#hash-algorithms). | Mandatory. +**Hash algorithm** | How users passwords are stored in the database. See [Hash algorithms](#hash-algorithms). | Mandatory. **Email sync** | Sync e-mail address with the Nextcloud.
- *None* - Disables this feature. This is the default option.
- *Synchronise only once* - Copy the e-mail address to the Nextcloud storage if its not set.
- *Nextcloud always wins* - Always copy the e-mail address to the database. This updates the user table.
- *SQL always wins* - Always copy the e-mail address to the Nextcloud storage. | Optional.
Default: *None*.
Requires: user *Email* column. **Home mode** | User storage path.
- *Default* - Let the Nextcloud manage this. The default option.
- *Query* - Use location from the user table pointed by the *home* column.
- *Static* - Use static location. The `%u` variable is replaced with the username of the user. | Optional
Default: *Default*. **Home Location** | User storage path for the `static` *home mode*. | Mandatory if the *Home mode* is set to `Static`. @@ -146,7 +146,7 @@ User table: wp_users Username column: user_login Password column: user_pass -Hashing algorithm: Unix (Crypt) or Portable PHP password +Hash algorithm: Unix (Crypt) or Portable PHP password ``` #### JHipster @@ -163,7 +163,7 @@ Password column: password_hash Email column: email Active column: activated -Hashing algorithm: Unix (Crypt) +Hash algorithm: Unix (Crypt) ``` ## Hash algorithms @@ -203,7 +203,7 @@ Add a new class in the `OCA\UserSQL\Platform` namespace which extends the `Abstr Add this driver in `admin.php` template to `$drivers` variable and in method `getPlatform(Connection $connection)` of `PlatformFactory` class. -#### New hashing algorithm support +#### New hash algorithm support Create a new class in `OCA\UserSQL\Crypto` namespace which implements `IPasswordAlgorithm` interface. Do not forget to write unit tests. diff --git a/lib/Crypto/AbstractCrypt.php b/lib/Crypto/AbstractCrypt.php index 7ce1c94..e27e957 100644 --- a/lib/Crypto/AbstractCrypt.php +++ b/lib/Crypto/AbstractCrypt.php @@ -22,8 +22,8 @@ namespace OCA\UserSQL\Crypto; /** - * Abstract Unix Crypt hashing implementation. - * The hashing algorithm depends on the chosen salt. + * Abstract Unix Crypt hash implementation. + * The hash algorithm depends on the chosen salt. * * @see crypt() * @author Marcin Łojewski @@ -52,7 +52,7 @@ abstract class AbstractCrypt extends AbstractAlgorithm } /** - * Generate a salt string for the hashing algorithm. + * Generate a salt string for the hash algorithm. * * @return string The salt string. */ diff --git a/lib/Crypto/CourierMD5.php b/lib/Crypto/CourierMD5.php index 6e8e71f..c2463e3 100644 --- a/lib/Crypto/CourierMD5.php +++ b/lib/Crypto/CourierMD5.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Courier MD5 hashing implementation. + * Courier MD5 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/CourierMD5Raw.php b/lib/Crypto/CourierMD5Raw.php index 39fd3db..094eab3 100644 --- a/lib/Crypto/CourierMD5Raw.php +++ b/lib/Crypto/CourierMD5Raw.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Courier MD5 RAW hashing implementation. + * Courier MD5 RAW hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/CourierSHA1.php b/lib/Crypto/CourierSHA1.php index 15d2ef3..6a96a44 100644 --- a/lib/Crypto/CourierSHA1.php +++ b/lib/Crypto/CourierSHA1.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Courier SHA1 hashing implementation. + * Courier SHA1 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/CourierSHA256.php b/lib/Crypto/CourierSHA256.php index 3bf0ed6..081cd9d 100644 --- a/lib/Crypto/CourierSHA256.php +++ b/lib/Crypto/CourierSHA256.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Courier SHA256 hashing implementation. + * Courier SHA256 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/Crypt.php b/lib/Crypto/Crypt.php index 609bdcb..c28763a 100644 --- a/lib/Crypto/Crypt.php +++ b/lib/Crypto/Crypt.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Unix Crypt hashing implementation. + * Unix Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptArgon2.php b/lib/Crypto/CryptArgon2.php index 14efb64..ed4aafb 100644 --- a/lib/Crypto/CryptArgon2.php +++ b/lib/Crypto/CryptArgon2.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Argon2 Crypt hashing implementation. + * Argon2 Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptBlowfish.php b/lib/Crypto/CryptBlowfish.php index 8e4a35e..6e1b8a5 100644 --- a/lib/Crypto/CryptBlowfish.php +++ b/lib/Crypto/CryptBlowfish.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Blowfish Crypt hashing implementation. + * Blowfish Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptExtendedDES.php b/lib/Crypto/CryptExtendedDES.php index b09baab..d6654c4 100644 --- a/lib/Crypto/CryptExtendedDES.php +++ b/lib/Crypto/CryptExtendedDES.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Extended DES Crypt hashing implementation. + * Extended DES Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptMD5.php b/lib/Crypto/CryptMD5.php index 6ca2e3b..0211f7e 100644 --- a/lib/Crypto/CryptMD5.php +++ b/lib/Crypto/CryptMD5.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * MD5 Crypt hashing implementation. + * MD5 Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptSHA256.php b/lib/Crypto/CryptSHA256.php index fad91b3..b4e2b41 100644 --- a/lib/Crypto/CryptSHA256.php +++ b/lib/Crypto/CryptSHA256.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SHA256 Crypt hashing implementation. + * SHA256 Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptSHA512.php b/lib/Crypto/CryptSHA512.php index 11f3b8f..e32238f 100644 --- a/lib/Crypto/CryptSHA512.php +++ b/lib/Crypto/CryptSHA512.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SHA512 Crypt hashing implementation. + * SHA512 Crypt hash implementation. * * @see crypt() * @author Marcin Łojewski diff --git a/lib/Crypto/CryptStandardDES.php b/lib/Crypto/CryptStandardDES.php index 7d8fa7d..bf2b4ec 100644 --- a/lib/Crypto/CryptStandardDES.php +++ b/lib/Crypto/CryptStandardDES.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Standard DES Crypt hashing implementation. + * Standard DES Crypt hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/Joomla.php b/lib/Crypto/Joomla.php index e5dd2ca..46af41c 100644 --- a/lib/Crypto/Joomla.php +++ b/lib/Crypto/Joomla.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * Joomla hashing implementation. + * Joomla hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/MD5.php b/lib/Crypto/MD5.php index a4ba435..b995b9c 100644 --- a/lib/Crypto/MD5.php +++ b/lib/Crypto/MD5.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * MD5 hashing implementation. + * MD5 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/Phpass.php b/lib/Crypto/Phpass.php index 586658c..d193917 100644 --- a/lib/Crypto/Phpass.php +++ b/lib/Crypto/Phpass.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * phpass hashing implementation. + * phpass hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/SHA1.php b/lib/Crypto/SHA1.php index a534212..6a1c707 100644 --- a/lib/Crypto/SHA1.php +++ b/lib/Crypto/SHA1.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SHA1 hashing implementation. + * SHA1 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/SHA512Whirlpool.php b/lib/Crypto/SHA512Whirlpool.php index 1fd3988..4f36e9a 100644 --- a/lib/Crypto/SHA512Whirlpool.php +++ b/lib/Crypto/SHA512Whirlpool.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SHA512 Whirlpool hashing implementation. + * SHA512 Whirlpool hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/SSHA.php b/lib/Crypto/SSHA.php index f0f46d9..ddae4b2 100644 --- a/lib/Crypto/SSHA.php +++ b/lib/Crypto/SSHA.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SSHA* hashing implementation. + * SSHA* hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/SSHA256.php b/lib/Crypto/SSHA256.php index a01cdf9..40337bd 100644 --- a/lib/Crypto/SSHA256.php +++ b/lib/Crypto/SSHA256.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SSHA256 hashing implementation. + * SSHA256 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/SSHA512.php b/lib/Crypto/SSHA512.php index 78e66a1..508fe53 100644 --- a/lib/Crypto/SSHA512.php +++ b/lib/Crypto/SSHA512.php @@ -24,7 +24,7 @@ namespace OCA\UserSQL\Crypto; use OCP\IL10N; /** - * SSHA512 hashing implementation. + * SSHA512 hash implementation. * * @author Marcin Łojewski */ diff --git a/lib/Crypto/WCF2.php b/lib/Crypto/WCF2.php index 07b1484..498818a 100644 --- a/lib/Crypto/WCF2.php +++ b/lib/Crypto/WCF2.php @@ -22,7 +22,7 @@ namespace OCA\UserSQL\Crypto; /** - * WCF2 hashing implementation. + * WCF2 hash implementation. * * @author Marcin Łojewski */ diff --git a/templates/admin.php b/templates/admin.php index a39becf..62e0d39 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -115,7 +115,7 @@ function print_select_options( "> getVisibleName(); + $hashes[$class] = $passwordAlgorithm->getVisibleName(); } } catch (Throwable $e) { } } - print_select_options($l, "opt-crypto_class", "Hashing algorithm", $hashing, $_['opt.crypto_class']); + print_select_options($l, "opt-crypto_class", "Hash algorithm", $hashes, $_['opt.crypto_class']); print_select_options($l, "opt-email_sync", "Email sync", ["" => "None", "initial" => "Synchronise only once", "force_nc"=>"Nextcloud always wins", "force_sql"=>"SQL always wins"], $_['opt.email_sync']); print_select_options($l, "opt-home_mode", "Home mode", ["" => "Default", "query" => "Query", "static" => "Static"], $_['opt.home_mode']); print_text_input($l, "opt-home_location", "Home Location", $_['opt.home_location']); ?>