Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 500 with Defuse while inserting new item through API #1624

Closed
tehnotronic opened this issue Jan 18, 2017 · 1 comment
Closed

Error 500 with Defuse while inserting new item through API #1624

tehnotronic opened this issue Jan 18, 2017 · 1 comment

Comments

@tehnotronic
Copy link

With latest version we see errors while inserting new items through API.
Browser gets error 500 response and PHP log output is below:

[18-Jan-2017 11:45:51 Europe/Helsinki] PHP Fatal error: Uncaught exception 'Defuse\Crypto\Exception\EnvironmentIsBrokenException' in /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/Core.php:245 Stack trace: #0 /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/Core.php(106): Defuse\Crypto\Core::ensureFunctionExists('random_bytes') #1 /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/Key.php(23): Defuse\Crypto\Core::secureRandom(32) #2 /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/RuntimeTests.php(85): Defuse\Crypto\Key::createNewRandomKey() #3 /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/RuntimeTests.php(60): Defuse\Crypto\RuntimeTests::testEncryptDecrypt() #4 /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/Crypto.php(183): Defuse\Crypto\RuntimeTests::runtimeTest() #5 /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/Crypto.php(31): Defuse\Crypto\Crypto::encryptInternal('secretpassword', Object(Defuse in /srv/www/tp/htdocs/includes/libraries/Encryption/Encryption/Core.php on line 245

Request is: http://server/api/index.php/add/item/dGVzdC0yMDE3MDExOC0xMTQ3MTY7c2VjcmV0cGFzc3dvcmQ7OzY0Mjtyb290Ozs7OzE?apikey=secretkey

nilsteampassnet pushed a commit that referenced this issue Jan 23, 2017
Fix for #1624
Fix for #1619 by changing the way to edit from search results. Now double-click on the orange key to edit item
@tehnotronic
Copy link
Author

In api/function.php we still get "err": "password is empty" after todays code commit.
After some debugging, I found the output of $encrypt array and it was as follows:

Array
(
[string] =>
[error] => Defuse\Crypto\Exception\EnvironmentIsBrokenException Object
(
[message:protected] =>
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/Core.php
[line:protected] => 250
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/Core.php
[line] => 106
[function] => ensureFunctionExists
[class] => Defuse\Crypto\Core
[type] => ::
[args] => Array
(
[0] => random_bytes
)
)
[1] => Array
(
[file] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/Key.php
[line] => 23
[function] => secureRandom
[class] => Defuse\Crypto\Core
[type] => ::
[args] => Array
(
[0] => 32
)
)
[2] => Array
(
[file] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/RuntimeTests.php
[line] => 85
[function] => createNewRandomKey
[class] => Defuse\Crypto\Key
[type] => ::
[args] => Array
(
)
)
[3] => Array
(
[file] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/RuntimeTests.php
[line] => 60
[function] => testEncryptDecrypt
[class] => Defuse\Crypto\RuntimeTests
[type] => ::
[args] => Array
(
)
)
[4] => Array
(
[file] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/Crypto.php
[line] => 183
[function] => runtimeTest
[class] => Defuse\Crypto\RuntimeTests
[type] => ::
[args] => Array
(
)
)
[5] => Array
(
[file] => /srv/www/localhost/htdocs/includes/libraries/Encryption/Encryption/Crypto.php
[line] => 31
[function] => encryptInternal
[class] => Defuse\Crypto\Crypto
[type] => ::
[args] => Array
(
[0] => HiddenSecretPassword
[1] => Defuse\Crypto\KeyOrPassword Object
(
[secret_type:Defuse\Crypto\KeyOrPassword:private] => 1
[secret:Defuse\Crypto\KeyOrPassword:private] => Defuse\Crypto\Key Object
(
[key_bytes:Defuse\Crypto\Key:private] => hiddenBinaryString
)
)
[2] =>
)
)
[6] => Array
(
[file] => /srv/www/localhost/htdocs/sources/main.functions.php
[line] => 385
[function] => encrypt
[class] => Defuse\Crypto\Crypto
[type] => ::
[args] => Array
(
[0] => HiddenSecretPassword
[1] => Defuse\Crypto\Key Object
(
[key_bytes:Defuse\Crypto\Key:private] => hiddenBinaryString
)
)
)
[7] => Array
(
[file] => /srv/www/localhost/htdocs/api/functions.php
[line] => 690
[function] => cryption
[args] => Array
(
[0] => HiddenSecretPassword
[1] =>
[2] => encrypt
)
)
[8] => Array
(
[file] => /srv/www/localhost/htdocs/api/index.php
[line] => 39
[function] => rest_get
[args] => Array
(
)
)
)
[previous:Exception:private] =>
)
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants