summaryrefslogtreecommitdiff
path: root/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption_simulation.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/cookies_encryption/encrypt_cookies_invalid_decryption_simulation.phpt')
-rw-r--r--src/tests/cookies_encryption/encrypt_cookies_invalid_decryption_simulation.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption_simulation.phpt b/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption_simulation.phpt
new file mode 100644
index 0000000..d2004b9
--- /dev/null
+++ b/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption_simulation.phpt
@@ -0,0 +1,28 @@
1--TEST--
2Cookie encryption - invalid decryption in simulation mode
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_encrypted_cookies_simulation.ini
7display_errors=1
8display_startup_errors=1
9error_reporting=E_ALL
10--COOKIE--
11super_cookie=Wk9NR1RISVNJU05PVEVOQ1JZUFRFREFUQUxMV0hBVFRIRUhFTExJU0hIRUxMQVJFWU9VRE9JTkdaT01Hb2htYXliZXRoaXNpc2Fub2xkc2Vzc2lvbmNvb2tpZQo=;awfulcookie=awfulcookievalue;
12--ENV--
13return <<<EOF
14REMOTE_ADDR=127.0.0.1
15EOF;
16--FILE--
17<?php
18echo "1337\n";
19var_dump($_COOKIE); ?>
20--EXPECT--
21Warning: [snuffleupagus][cookie_encryption] Something went wrong with the decryption of super_cookie. Using the cookie 'as it' instead of decrypting it in Unknown on line 0
221337
23array(2) {
24 ["super_cookie"]=>
25 string(124) "Wk9NR1RISVNJU05PVEVOQ1JZUFRFREFUQUxMV0hBVFRIRUhFTExJU0hIRUxMQVJFWU9VRE9JTkdaT01Hb2htYXliZXRoaXNpc2Fub2xkc2Vzc2lvbmNvb2tpZQo="
26 ["awfulcookie"]=>
27 string(16) "awfulcookievalue"
28} \ No newline at end of file