diff options
| author | jvoisin | 2018-10-06 16:15:00 +0000 |
|---|---|---|
| committer | GitHub | 2018-10-06 16:15:00 +0000 |
| commit | aa550b9abadc109a2c89a7cd6dd047ac2a953027 (patch) | |
| tree | 1892e9ce8f833f3f13278cd424368fe1b5e26d91 /src/tests/encrypt_cookies_invalid_decryption.phpt | |
| parent | 228fadf307b167a22ad6ec760f3b2ee2e9f2fee3 (diff) | |
Bump a bit the coverage
* `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
Diffstat (limited to 'src/tests/encrypt_cookies_invalid_decryption.phpt')
| -rw-r--r-- | src/tests/encrypt_cookies_invalid_decryption.phpt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tests/encrypt_cookies_invalid_decryption.phpt b/src/tests/encrypt_cookies_invalid_decryption.phpt index c64675d..d4a0b0f 100644 --- a/src/tests/encrypt_cookies_invalid_decryption.phpt +++ b/src/tests/encrypt_cookies_invalid_decryption.phpt | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | --TEST-- | 1 | --TEST-- |
| 2 | Cookie encryption | 2 | Cookie encryption - invalid decryption |
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| @@ -8,12 +8,19 @@ display_errors=1 | |||
| 8 | display_startup_errors=1 | 8 | display_startup_errors=1 |
| 9 | error_reporting=E_ALL | 9 | error_reporting=E_ALL |
| 10 | --COOKIE-- | 10 | --COOKIE-- |
| 11 | super_cookie=jWjORGsgZyqzk3WA63XZBmUoSknXWnXDfAAAAAAAAAAAAAAAAAAAAAA7LiMDfkpP94jDnMVH%2Fm41GeL0Y00q3mbOFYz%2FS9mQGySu;awful_cookie=awful_cookie_value; | 11 | super_cookie=Wk9NR1RISVNJU05PVEVOQ1JZUFRFREFUQUxMV0hBVFRIRUhFTExJU0hIRUxMQVJFWU9VRE9JTkdaT01Hb2htYXliZXRoaXNpc2Fub2xkc2Vzc2lvbmNvb2tpZQo=;awfulcookie=awfulcookievalue; |
| 12 | --ENV-- | 12 | --ENV-- |
| 13 | return <<<EOF | 13 | return <<<EOF |
| 14 | REMOTE_ADDR=127.0.0.1 | 14 | REMOTE_ADDR=127.0.0.1 |
| 15 | EOF; | 15 | EOF; |
| 16 | --FILE-- | 16 | --FILE-- |
| 17 | <?php var_dump($_COOKIE); ?> | 17 | <?php |
| 18 | echo "1337\n"; | ||
| 19 | var_dump($_COOKIE); ?> | ||
| 18 | --EXPECT-- | 20 | --EXPECT-- |
| 19 | Fatal error: [snuffleupagus][cookie_encryption] Something went wrong with the decryption of super_cookie in Unknown on line 0 \ No newline at end of file | 21 | Warning: [snuffleupagus][cookie_encryption] Something went wrong with the decryption of super_cookie in Unknown on line 0 |
| 22 | 1337 | ||
| 23 | array(1) { | ||
| 24 | ["awfulcookie"]=> | ||
| 25 | string(16) "awfulcookievalue" | ||
| 26 | } | ||
