You are not logged in.
Pages: 1
Hi people, this is a new installation of GLPI in a Hosting through Softaculous, everytime I try to enter password for SMTP notifications or key for glpi-networks after submit it, server shows a blank page and in logs this error.
[2020-07-28 15:00:48] glpiphplog.CRITICAL: *** Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /home/asistem1/public_html/lwo/inc/toolbox.class.php at line 272
Backtrace :
inc/toolbox.class.php:272 sodium_crypto_aead_xchacha20poly1305_ietf_encrypt()
inc/config.class.php:173 Toolbox::sodiumEncrypt()
inc/commondbtm.class.php:1433 Config->prepareInputForUpdate()
front/notificationmailingsetting.form.php:44 CommonDBTM->update()
PHP Sodium module is already loaded, I own another installation (several years and been upgrading through time) with same version and I can change password or load key for glpi-network and shows no error.
I tried installing a new instance of GLPI but shows the same error.
Also installed 9.5.1 for bug patching but had no luck.
Someone has had same error or any hint for solving? Thanks in advance.
Last edited by eulogy (2020-07-28 21:25:13)
Offline
What you have in /home/asistem1/public_html/lwo/inc/toolbox.class.php at line 272?
--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS
Offline
The file isn't the problem, because is the same file I have in the other GLPI instance.
I edited the next code with "(272)" for pointing to the line 272.
public static function sodiumEncrypt($content, $key = null) {
if ($key === null) {
$key = self::getGlpiSecKey();
}
$nonce = random_bytes(SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES); // NONCE = Number to be used ONCE, for each message
$encrypted = sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
$content,
$nonce,
$nonce,
(272) $key
);
return base64_encode($nonce . $encrypted);
}
public static function sodiumDecrypt($content, $key = null) {
if (empty($content)) {
// Avoid sodium exception for blank content. Just return the null/empty value.
return $content;
}
if ($key === null) {
$key = self::getGlpiSecKey();
}
Last edited by eulogy (2020-07-29 00:22:29)
Offline
Similar problema, any solution?
GLPI 9.5.2;; FusionInventory: 9.2+1.0;; GLPI Modifications 1.1.4;; Notifications 1.1.9;; Dashboard 0.8.8;; PHP 7.3.33
Offline
I solved this problem by accessing SSH on the server console, going to the GLPI folder and using the command below:
php bin/console glpi:security:change_key
After that I answered "Yes" to the question about fields and configurations requiring migration.
Offline
Hi, I have the same problem in GLPI 9.5.1. After using the command "bin/console glpi:security:change_key" I get the following:
$ sudo php /var/www/glpi/bin/console glpi:security:change_key
Found 2 field(s) and 3 configuration entries requiring migration.
Do you want to continue ? [Yes/no]yes
In toolbox.class.php line 293:
public nonce size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes
glpi:security:change_key
How do I set it up?
Last edited by anyqov (2020-09-12 11:09:56)
Offline
Hello,
Same problem here w glpi version 9.5.1. Basically same scenario as @anyqov mentioned.
Only thing I have in mind is php version, we have PHP 7.4.7 so if anybody solved this issue can u point out your PHP version please ?
Thanks and good luck to everybody
Offline
Error: "public nonce size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes".
I got this problem when I updated GLPI from 9.4.4 to 9.5.1.
Versions: PHP 7.4.10, 10.4.14-MariaDB, Centos 7.
Last edited by anyqov (2020-10-01 18:08:30)
Offline
I have upgraded from 9.4 to 9.5.2. This is a CentOS 7 server running PHP 7.3. I am trying to update my ocsng configuration since it wasn't working since before glpi upgrade. When trying to create the database setup I get the following error:
Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /usr/share/glpi/inc/toolbox.class.php at line 273
Tried running
php bin/console glpi:security:change_key
Found 2 field(s) and 3 configuration entries requiring migration.
Do you want to continue ? [Yes/no]y
New security key generated; database updated.
However the error persists when trying to add the ocs server for the ocsng setup. Anyone have any additional solutions?
Offline
Same problem here but in the OCSNG plugin serveur add. If I set a password, I get a blank page but if I set empty password, it works but of course the connection does not work. If I add a password after that the server page become empty.
I don't know how to disable sodium to try this solution.
Tryed to reinstall sodium, can't make it work (I do not know what I'm doing).
I have PHP 7.3.
Last edited by ph.adam (2020-11-02 08:12:30)
Offline
Hello,
I tried to roll-back changes mentionned for ocsserver.class.php (github.com/pluginsGLPI/ocsinventoryng/commit/5c157b1c4c2192da3bd890be0798ed32533734ee) and it works...
There is an error for crypt method but the server connection is ok..
Offline
Hi,
bguillerme, I don't understand what changes you're talking about for the ocsserver.class.php file?
"github.com/pluginsGLPI/ocsinventoryng/commit/5c157b1c4c2192da3bd890be0798ed32533734ee"
It's a line which have to added?
Offline
Hi Guys,
Any news about this topic, already tried :
php bin/console glpi:security:change_key
Found 2 field(s) and 3 configuration entries requiring migration.
Do you want to continue ? [Yes/no]y
New security key generated; database updated.
but still the same issue :
[2020-11-11 10:57:44] glpiphplog.CRITICAL: *** Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /var/www/html/glpi/inc/toolbox.class.php at line 273
Backtrace :
inc/toolbox.class.php:273 sodium_crypto_aead_xchacha20poly1305_ietf_encrypt()
...ins/ocsinventoryng/inc/ocsserver.class.php:1648 Toolbox::sodiumEncrypt()
inc/commondbtm.class.php:1102 PluginOcsinventoryngOcsServer->prepareInputForAdd()
plugins/ocsinventoryng/front/ocsserver.form.php:59 CommonDBTM->add()
Offline
Reverting to encrypt and decrypt instead of sodiumencrypt and sodiumdecrypt also worked for me.
https://github.com/pluginsGLPI/ocsinven … 32533734ee
Offline
Reverting to encrypt and decrypt instead of sodiumencrypt and sodiumdecrypt also worked for me.
Thank you very much. This solution works fine. Pretty scary to update the code (even if I used to be a programmer...) and I imagine that at the next update I will have to redo the fix but it works now.
Offline
Hello,
We just updated our GLPI to latest version 9.5.3 and problem with LDAP is no longer present. U can try to update and apparently latest version resolved this issue. GL all.
other info:
PHP 7.4.12 (cli)
CentOS Linux release 7.3.1611 (Core)
GLPI version 9.5.3 25/11/2020 – Archive
Offline
Hi,
Thank you for the work and the information. Personnaly, after updating to GLPI 9.5.3 and undoing the changes (replace encrypt and decrypt with sodiumEncrypt and sodiumDecrypt and update the password) I still have the error "Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /var/www/html/glpi/inc/toolbox.class.php at line 275".
But I had warning telling me that encrypt and decrypt are deprecated.
Have a nice day
Offline
Hi,
I have the same problem on GLPI 9.5 (1-2-3).
I am at OVH PHP 7.2 Libsodium OK.
I tried php bin / console glpi: security: change_key with the same error.
Has anyone solved this problem that prevents me from using this version of GLPI?
Thank you in advance
GLPI 9.5; GLPI Modifications ; PHP 7.3; OVH
Offline
I have the same problem on GLPI 9.5.3, PHP 8.0.0 xampp
Has anyone solved this problem?
Thank you
Offline
Hello all, I have resolved my problem.
In my case the problem came from an undefined constant: MB_OVERLOAD_STRING in 'C:\xampp\htdocs\glpi\vendor\paragonie\sodium_compat\src\Core\Util.php'
I have included the following code in line 913:
if (!defined('MB_OVERLOAD_STRING')) {
define("MB_OVERLOAD_STRING", 2);
}
It seems that the system is confused about the definition of this constant.
Have a nice day.
Offline
Pages: 1