diff options
| author | Ben Fuhrmannek | 2021-11-11 12:02:07 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2021-11-11 12:02:07 +0100 |
| commit | 9111fdf5e6332923a5faf9f8a7e6b428eb91795a (patch) | |
| tree | 046703d4a95f8590a01e8a82631d3c061a6c2865 /src/tests/broken_configuration_php8/encrypt_key_too_short.phpt | |
| parent | 8e95c5d30f197716ba132e3f2494c5e220f3e5cd (diff) | |
detect dummy or short encryption key
Diffstat (limited to 'src/tests/broken_configuration_php8/encrypt_key_too_short.phpt')
| -rw-r--r-- | src/tests/broken_configuration_php8/encrypt_key_too_short.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tests/broken_configuration_php8/encrypt_key_too_short.phpt b/src/tests/broken_configuration_php8/encrypt_key_too_short.phpt new file mode 100644 index 0000000..c14785e --- /dev/null +++ b/src/tests/broken_configuration_php8/encrypt_key_too_short.phpt | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | --TEST-- | ||
| 2 | Cookie encryption key too short | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
| 5 | <?php if (PHP_VERSION_ID < 80000) print "skip"; ?> | ||
| 6 | --INI-- | ||
| 7 | sp.configuration_file={PWD}/../broken_configuration/config/config_encryption_key_short.ini | ||
| 8 | --COOKIE-- | ||
| 9 | --ENV-- | ||
| 10 | return <<<EOF | ||
| 11 | REMOTE_ADDR=2001:0db8:0000:0000:0000:fe00:0042:8329 | ||
| 12 | HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36 | ||
| 13 | HTTPS=1 | ||
| 14 | EOF; | ||
| 15 | --FILE-- | ||
| 16 | <?php | ||
| 17 | ?> | ||
| 18 | --EXPECT-- | ||
| 19 | Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] The encryption key set on line 1 is too short. please use at least 10 bytes in Unknown on line 0 | ||
| 20 | |||
| 21 | Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] Invalid configuration file in Unknown on line 0 | ||
| 22 | Could not startup. \ No newline at end of file | ||
