summaryrefslogtreecommitdiff
path: root/src/tests/session_encryption
diff options
context:
space:
mode:
authorBen Fuhrmannek2022-01-12 19:51:09 +0100
committerBen Fuhrmannek2022-01-12 19:51:09 +0100
commit80228c69c19b131764cd5848071d25f7ba0ad249 (patch)
tree4a35b22dbbb34ed4f334dc8fe591b57670e917ff /src/tests/session_encryption
parente8da4951dabcddd04c6a2e6daa0dea08003e476f (diff)
removed redundant tests + minor fixes
Diffstat (limited to 'src/tests/session_encryption')
-rw-r--r--src/tests/session_encryption/crypt_session_corrupted_session.phpt5
-rw-r--r--src/tests/session_encryption/crypt_session_invalid.phpt5
-rw-r--r--src/tests/session_encryption/crypt_session_invalid_simul.phpt8
-rw-r--r--src/tests/session_encryption/crypt_session_invalid_simul_php8.phpt33
-rw-r--r--src/tests/session_encryption/crypt_session_read_uncrypt.phpt3
-rw-r--r--src/tests/session_encryption/crypt_session_valid.phpt3
-rw-r--r--src/tests/session_encryption/crypt_session_valid_simul.phpt3
-rw-r--r--src/tests/session_encryption/set_custom_session_handler.phpt3
-rw-r--r--src/tests/session_encryption/set_custom_session_handler2.phpt3
-rw-r--r--src/tests/session_encryption/set_custom_session_handler_ini.phpt3
10 files changed, 29 insertions, 40 deletions
diff --git a/src/tests/session_encryption/crypt_session_corrupted_session.phpt b/src/tests/session_encryption/crypt_session_corrupted_session.phpt
index db3f949..eca43b4 100644
--- a/src/tests/session_encryption/crypt_session_corrupted_session.phpt
+++ b/src/tests/session_encryption/crypt_session_corrupted_session.phpt
@@ -2,8 +2,9 @@
2Set a custom session handler 2Set a custom session handler
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?> 5<?php if (!extension_loaded("session")) print "skip"; ?>
6<?php if (PHP_VERSION_ID >= 70400) print "skip"; ?> 6--EXTENSIONS--
7session
7--INI-- 8--INI--
8sp.configuration_file={PWD}/config/config_crypt_session.ini 9sp.configuration_file={PWD}/config/config_crypt_session.ini
9session.save_path="/tmp" 10session.save_path="/tmp"
diff --git a/src/tests/session_encryption/crypt_session_invalid.phpt b/src/tests/session_encryption/crypt_session_invalid.phpt
index 967d9d1..a71a601 100644
--- a/src/tests/session_encryption/crypt_session_invalid.phpt
+++ b/src/tests/session_encryption/crypt_session_invalid.phpt
@@ -2,8 +2,9 @@
2SESSION crypt and bad decrypt 2SESSION crypt and bad decrypt
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (PHP_VERSION_ID >= 80000) print "skip"; ?> 5<?php if (!extension_loaded("session")) print "skip"; ?>
6<?php if (PHP_VERSION_ID >= 70400) print "skip"; ?> 6--EXTENSIONS--
7session
7--INI-- 8--INI--
8sp.configuration_file={PWD}/config/config_crypt_session.ini 9sp.configuration_file={PWD}/config/config_crypt_session.ini
9--ENV-- 10--ENV--
diff --git a/src/tests/session_encryption/crypt_session_invalid_simul.phpt b/src/tests/session_encryption/crypt_session_invalid_simul.phpt
index 02db524..3eb619c 100644
--- a/src/tests/session_encryption/crypt_session_invalid_simul.phpt
+++ b/src/tests/session_encryption/crypt_session_invalid_simul.phpt
@@ -1,7 +1,10 @@
1--TEST-- 1--TEST--
2SESSION crypt and bad decrypt 2SESSION crypt and bad decrypt
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus") || PHP_VERSION_ID < 80000) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session_simul.ini 9sp.configuration_file={PWD}/config/config_crypt_session_simul.ini
7display_errors=0 10display_errors=0
@@ -30,5 +33,4 @@ unlink(dirname(__FILE__) . "/crypt_session_invalid_simul.tmp");
30--EXPECTF-- 33--EXPECTF--
31array(0) { 34array(0) {
32} 35}
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 36%sPHP 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%A \ No newline at end of file
34%aPHP Warning: session_start(): Failed to decode session object. Session has been destroyed in %a/crypt_session_invalid_simul.php on line 9
diff --git a/src/tests/session_encryption/crypt_session_invalid_simul_php8.phpt b/src/tests/session_encryption/crypt_session_invalid_simul_php8.phpt
deleted file mode 100644
index a05b828..0000000
--- a/src/tests/session_encryption/crypt_session_invalid_simul_php8.phpt
+++ /dev/null
@@ -1,33 +0,0 @@
1--TEST--
2SESSION crypt and bad decrypt
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus") || PHP_VERSION_ID >= 80000) 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
diff --git a/src/tests/session_encryption/crypt_session_read_uncrypt.phpt b/src/tests/session_encryption/crypt_session_read_uncrypt.phpt
index e2e1737..5966f8e 100644
--- a/src/tests/session_encryption/crypt_session_read_uncrypt.phpt
+++ b/src/tests/session_encryption/crypt_session_read_uncrypt.phpt
@@ -2,6 +2,9 @@
2SESSION crypt/decrypt valid 2SESSION crypt/decrypt valid
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session_simul.ini 9sp.configuration_file={PWD}/config/config_crypt_session_simul.ini
7session.save_path="{PWD}" 10session.save_path="{PWD}"
diff --git a/src/tests/session_encryption/crypt_session_valid.phpt b/src/tests/session_encryption/crypt_session_valid.phpt
index c272486..a28685b 100644
--- a/src/tests/session_encryption/crypt_session_valid.phpt
+++ b/src/tests/session_encryption/crypt_session_valid.phpt
@@ -2,6 +2,9 @@
2SESSION crypt/decrypt valid 2SESSION crypt/decrypt valid
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session.ini 9sp.configuration_file={PWD}/config/config_crypt_session.ini
7--ENV-- 10--ENV--
diff --git a/src/tests/session_encryption/crypt_session_valid_simul.phpt b/src/tests/session_encryption/crypt_session_valid_simul.phpt
index d63277d..6af015e 100644
--- a/src/tests/session_encryption/crypt_session_valid_simul.phpt
+++ b/src/tests/session_encryption/crypt_session_valid_simul.phpt
@@ -2,6 +2,9 @@
2SESSION crypt/decrypt valid 2SESSION crypt/decrypt valid
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session_simul.ini 9sp.configuration_file={PWD}/config/config_crypt_session_simul.ini
7--ENV-- 10--ENV--
diff --git a/src/tests/session_encryption/set_custom_session_handler.phpt b/src/tests/session_encryption/set_custom_session_handler.phpt
index 1b81a04..04edcd0 100644
--- a/src/tests/session_encryption/set_custom_session_handler.phpt
+++ b/src/tests/session_encryption/set_custom_session_handler.phpt
@@ -2,6 +2,9 @@
2Set a custom session handler 2Set a custom session handler
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session.ini 9sp.configuration_file={PWD}/config/config_crypt_session.ini
7session.save_path="/tmp" 10session.save_path="/tmp"
diff --git a/src/tests/session_encryption/set_custom_session_handler2.phpt b/src/tests/session_encryption/set_custom_session_handler2.phpt
index 58b6595..0ebf7b6 100644
--- a/src/tests/session_encryption/set_custom_session_handler2.phpt
+++ b/src/tests/session_encryption/set_custom_session_handler2.phpt
@@ -2,6 +2,9 @@
2Set a custom session handler, twice 2Set a custom session handler, twice
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session.ini 9sp.configuration_file={PWD}/config/config_crypt_session.ini
7session.save_path="/tmp" 10session.save_path="/tmp"
diff --git a/src/tests/session_encryption/set_custom_session_handler_ini.phpt b/src/tests/session_encryption/set_custom_session_handler_ini.phpt
index f9fbfb2..a454fc6 100644
--- a/src/tests/session_encryption/set_custom_session_handler_ini.phpt
+++ b/src/tests/session_encryption/set_custom_session_handler_ini.phpt
@@ -2,6 +2,9 @@
2Set a custom session handler 2Set a custom session handler
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?>
6--EXTENSIONS--
7session
5--INI-- 8--INI--
6sp.configuration_file={PWD}/config/config_crypt_session.ini 9sp.configuration_file={PWD}/config/config_crypt_session.ini
7session.save_handler = 10session.save_handler =