summaryrefslogtreecommitdiff
path: root/src/sp_crypt.c (follow)
AgeCommit message (Collapse)Author
2024-06-06Avoid dropping const qualifier in castsChristian Göttsche
Adjusts casts to void dropping const qualifiers. This helps to avoid mistakes, e.g. modifying string literals. Also use size_t for length, similar to the upstream php interfaces.
2022-07-13Remove some useless conditionsjvoisin
2021-09-23config is stack allocated now + some code improvements (see details)Ben Fuhrmannek
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible * SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read * execution_depth is re-initialized to 0 for each request * function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1 * execution is actually hooked if recursion protection is enabled * some line breaks were removed to make the code more readable
2021-09-03fixed session encryption in php8 + related test casesBen Fuhrmannek
2021-08-03fixed memleaks in zval encryption/decryption routinesBen Fuhrmannek
2020-08-12Allow empty configuration (#342)jvoisin
This commit allows php to run (with a warning) if there is no specified snuffleupagus configuration, instead of refusing to start.
2020-07-22refactoring sp_log_* (#340)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2019-06-20Fix snufflepagus_globals linking issues and one mac compatibility issuebef
2019-02-23Try to unify the includesjvoisin
2019-01-01Fix a harmless-but-invalid zend_string_releasejvoisin
2018-12-15Improve simulation mode for session cookies (#259)jvoisin
Since decrypt_zval doesn't provide a way to tell apart failed and successful decryption when used in simulation mode, we'll have to restore the original value if something goes wrong, because crypto_secretbox_open might modify the value.
2018-10-06Bump a bit the coveragejvoisin
* `setcookie` doesn't always return `true` anymore * clang-format * Cookies with invalid decryption are dropped, but the request isn't anymore * faulty unserialize are now dumpable
2018-09-10Bump the coveragejvoisin
2018-08-30Minor code cleanupxXx-caillou-xXx
2018-08-28Use php's logging functionsxXx-caillou-xXx
This commit replace our usage of `php_log_err` with `zend_error`. This should allow administrators to display errors in the webpage, should they want to; and to properly manipulate the verbosity's level. This should close #217
2018-07-13Massively optimize how rules are handledxXx-caillou-xXx
This commit does a lot of things: - Use hashtables instead of lists to store the rules - Rules that can be applied at launch time won't be tried at runtime - Improve feedback when writing nonsensical rules - Make intensive use of `zend_string` instead of `char*`
2018-06-28Better handling of filters for builtinskkadosh
2018-05-29Support session encryptionkkadosh
Implement session encryption.
2018-05-15Refactor the encryption process to extract encrypt/decrypt functions (#176)kkadosh
Refactor the encryption process to extract encrypt/decrypt functions