Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/classes/Controllers/HomeController.php')
-rw-r--r--libraries/classes/Controllers/HomeController.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/libraries/classes/Controllers/HomeController.php b/libraries/classes/Controllers/HomeController.php
index 2b7a30226c..22b3990735 100644
--- a/libraries/classes/Controllers/HomeController.php
+++ b/libraries/classes/Controllers/HomeController.php
@@ -318,19 +318,23 @@ class HomeController extends AbstractController
* Check if user does not have defined blowfish secret and it is being used.
*/
if (! empty($_SESSION['encryption_key'])) {
- if (empty($GLOBALS['cfg']['blowfish_secret'])) {
+ $encryptionKeyLength = mb_strlen($GLOBALS['cfg']['blowfish_secret'], '8bit');
+ if ($encryptionKeyLength < SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
$this->errors[] = [
'message' => __(
- 'The configuration file now needs a secret passphrase (blowfish_secret).'
+ 'The configuration file needs a valid key for cookie encryption.'
+ . ' A temporary key was automatically generated for you.'
+ . ' Please refer to the [doc@cfg_blowfish_secret]documentation[/doc].'
),
'severity' => 'warning',
];
- } elseif (mb_strlen($GLOBALS['cfg']['blowfish_secret'], '8bit') !== SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
+ } elseif ($encryptionKeyLength > SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
$this->errors[] = [
'message' => sprintf(
__(
- 'The secret passphrase in configuration (blowfish_secret) is not the correct length.'
- . ' It should be %d bytes long.'
+ 'The cookie encryption key in the configuration file is longer than necessary.'
+ . ' It should only be %d bytes long.'
+ . ' Please refer to the [doc@cfg_blowfish_secret]documentation[/doc].'
),
SODIUM_CRYPTO_SECRETBOX_KEYBYTES
),