diff options
| author | Ben Fuhrmannek | 2021-09-03 13:25:33 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-09-03 13:25:33 +0200 |
| commit | 2e4fda2c67ce98c9be9092effe2522c1de9f7efc (patch) | |
| tree | 334d38d09c70220db4c2b3f6fd442638d305d3a7 /src/tests/session_encryption/crypt_session_invalid_simul.phpt | |
| parent | 6900dbd5573d7ddb04c2ccb59a4aefca841e124b (diff) | |
fixed session encryption in php8 + related test cases
Diffstat (limited to 'src/tests/session_encryption/crypt_session_invalid_simul.phpt')
| -rw-r--r-- | src/tests/session_encryption/crypt_session_invalid_simul.phpt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tests/session_encryption/crypt_session_invalid_simul.phpt b/src/tests/session_encryption/crypt_session_invalid_simul.phpt index cbb80dc..80edb8a 100644 --- a/src/tests/session_encryption/crypt_session_invalid_simul.phpt +++ b/src/tests/session_encryption/crypt_session_invalid_simul.phpt | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | --TEST-- | 1 | --TEST-- |
| 2 | SESSION crypt and bad decrypt | 2 | SESSION crypt and bad decrypt |
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | 4 | <?php if (!extension_loaded("snuffleupagus") || PHP_VERSION_ID < 70400) print "skip"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | sp.configuration_file={PWD}/config/config_crypt_session_simul.ini | 6 | sp.configuration_file={PWD}/config/config_crypt_session_simul.ini |
| 7 | display_errors=0 | ||
| 8 | log_errors=1 | ||
| 9 | error_log="{PWD}"/crypt_session_invalid_simul.tmp | ||
| 7 | --ENV-- | 10 | --ENV-- |
| 8 | return <<<EOF | 11 | return <<<EOF |
| 9 | REMOTE_ADDR=127.0.0.1 | 12 | REMOTE_ADDR=127.0.0.1 |
| @@ -19,9 +22,13 @@ putenv("REMOTE_ADDR=127.0.0.2"); | |||
| 19 | session_id($id); // Recover the session with the previous session_id | 22 | session_id($id); // Recover the session with the previous session_id |
| 20 | session_start(); // Re start the session, It will read and decrypt the non empty session | 23 | session_start(); // Re start the session, It will read and decrypt the non empty session |
| 21 | var_dump($_SESSION); // Dump the session | 24 | var_dump($_SESSION); // Dump the session |
| 25 | |||
| 26 | echo file_get_contents(dirname(__FILE__) . "/crypt_session_invalid_simul.tmp"); | ||
| 27 | unlink(dirname(__FILE__) . "/crypt_session_invalid_simul.tmp"); | ||
| 28 | |||
| 22 | ?> | 29 | ?> |
| 23 | --EXPECTF-- | 30 | --EXPECTF-- |
| 24 | array(1) { | 31 | array(0) { |
| 25 | ["toto"]=> | ||
| 26 | string(4) "tata" | ||
| 27 | } | 32 | } |
| 33 | %aPHP Warning: [snuffleupagus][127.0.0.2][cookie_encryption][simulation] Something went wrong with the decryption of the session. Using the cookie 'as is' instead of decrypting it in %a/crypt_session_invalid_simul.php on line 9 | ||
| 34 | %aPHP Warning: session_start(): Failed to decode session object. Session has been destroyed in %a/crypt_session_invalid_simul.php on line 9 | ||
