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 filling Integer Encrypted Custom Field on Account #946

Closed
cristianoisaac opened this issue May 24, 2018 · 2 comments
Closed

Error filling Integer Encrypted Custom Field on Account #946

cristianoisaac opened this issue May 24, 2018 · 2 comments

Comments

@cristianoisaac
Copy link

I'm using v3.0-beta (300.18042501) on PHP 7 CentOS 7.4
I added an CUSTOM FIELD as INTEGER, ENCRYPTED with the name "Conexões Simultâneas" in the Accounts. When I tried to add an account filling this field I received this error. If I don't fill the field it saves normally.
×
There was an error
SyntaxError: Unexpected token S in JSON at position 0parsererror
2018-05-24 21:15:32 - Loaded actions cache
2018-05-24 21:15:36 - ------------
2018-05-24 21:15:36 - Boostrap:web
2018-05-24 21:15:36 - initializeCommon
2018-05-24 21:15:36 - SP\Modules\Web\Init::initialize
2018-05-24 21:15:36 - Loaded icons cache
2018-05-24 21:15:36 - Attach: SP\Providers\Log\LogHandler
2018-05-24 21:15:36 - Attach: SP\Providers\Notification\NotificationHandler
2018-05-24 21:15:36 - Routing call: SP\Modules\Web\Controllers\AccountController::saveEditAction::Array
(
[0] => 3
)

2018-05-24 21:15:36 - Loaded actions cache
2018-05-24 21:15:37 - Routing error: String expected for argument 1. Integer given instead.
2018-05-24 21:15:37 - Routing error: #0 /var/www/html/syspass/lib/SP/Core/Crypt/Crypt.php(59): Defuse\Crypto\Crypto::encrypt(200, Object(Defuse\Crypto\Key))
#1 /var/www/html/syspass/lib/SP/Services/CustomField/CustomFieldService.php(199): SP\Core\Crypt\Crypt::encrypt(200, 'def10000def5020...', '$fkfdOfYc@xeVoo...')
#2 /var/www/html/syspass/lib/SP/Services/CustomField/CustomFieldService.php(178): SP\Services\CustomField\CustomFieldService->setSecureData(Object(SP\DataModel\CustomFieldData))
#3 /var/www/html/syspass/lib/SP/Services/CustomField/CustomFieldService.php(133): SP\Services\CustomField\CustomFieldService->create(Object(SP\DataModel\CustomFieldData))
#4 /var/www/html/syspass/app/modules/web/Controllers/Traits/ItemTrait.php(169): SP\Services\CustomField\CustomFieldService->update(Object(SP\DataModel\CustomFieldData))
#5 /var/www/html/syspass/app/modules/web/Controllers/AccountController.php(719): SP\Modules\Web\Controllers\AccountController->updateCustomFieldsForItem(10, 3)
#6 [internal function]: SP\Modules\Web\Controllers\AccountController->saveEditAction(3)
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(239): call_user_func_array(Array, Array)
#8 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#9 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure), Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#10 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route), Object(Klein\DataCollection\RouteCollection), Array)
#11 /var/www/html/syspass/lib/SP/Bootstrap.php(446): Klein\Klein->dispatch()
#12 /var/www/html/syspass/lib/Base.php(74): SP\Bootstrap::run(Object(DI\Container))
#13 /var/www/html/syspass/index.php(28): require('/var/www/html/s...')
#14 {main}

nuxsmin added a commit that referenced this issue May 30, 2018
…ry requires a string type argument for the data encrypted. Thanks to @fizard for the feedback. Closes #946
@nuxsmin
Copy link
Owner

nuxsmin commented May 30, 2018

Hello, it has been fixed in the latest commit. It was caused by a recent update of the encryption library which implemented a strict type checking of the data to be encrypted. It needs to be a "string".

Thanks for the feedback!

Kind regards

@nuxsmin nuxsmin closed this as completed May 30, 2018
@cristianoisaac
Copy link
Author

Thanks! It worked.

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

No branches or pull requests

2 participants