summaryrefslogtreecommitdiff
path: root/src/tests/session_encryption/crypt_session_invalid_simul_php73.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/session_encryption/crypt_session_invalid_simul_php73.phpt')
-rw-r--r--src/tests/session_encryption/crypt_session_invalid_simul_php73.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tests/session_encryption/crypt_session_invalid_simul_php73.phpt b/src/tests/session_encryption/crypt_session_invalid_simul_php73.phpt
new file mode 100644
index 0000000..4d1f747
--- /dev/null
+++ b/src/tests/session_encryption/crypt_session_invalid_simul_php73.phpt
@@ -0,0 +1,33 @@
1--TEST--
2SESSION crypt and bad decrypt
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus") || PHP_VERSION_ID >= 70400) print "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_crypt_session_simul.ini
7display_errors=0
8log_errors=1
9error_log="{PWD}"/crypt_session_invalid_simul.tmp
10--ENV--
11return <<<EOF
12REMOTE_ADDR=127.0.0.1
13EOF;
14--FILE--
15<?php
16// Do it like that to write (encrypt) the session and then to read (decrypt) the session
17session_start(); // Start new_session , it will read an empty session
18$_SESSION["toto"] = "tata"; // Encrypt and write the session
19$id = session_id(); // Get the session_id to use it later
20session_write_close(); // Close the session
21putenv("REMOTE_ADDR=127.0.0.2");
22session_id($id); // Recover the session with the previous session_id
23session_start(); // Re start the session, It will read and decrypt the non empty session
24var_dump($_SESSION); // Dump the session
25
26echo file_get_contents(dirname(__FILE__) . "/crypt_session_invalid_simul.tmp");
27unlink(dirname(__FILE__) . "/crypt_session_invalid_simul.tmp");
28
29?>
30--EXPECTF--
31array(0) {
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%a.php on line 9