Commit Graph
82 Commits
Author SHA1 Message Date
Peter Kokot 113213f027 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:29:24 +02:00
Peter Kokot 7af945e271 Trim trailing whitespace in *.phpt 2018-10-14 19:43:12 +02:00
Peter Kokot 3f72c77ce4 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:21:27 +02:00
Anatol Belski 8ad71bc1d2 Fix test 2017-10-24 14:58:01 +02:00
Anatol Belski 9138966c67 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72535 arcfour encryption stream filter crashes php
2017-10-24 14:05:18 +02:00
Anatol Belski 968c8fc0d5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72535 arcfour encryption stream filter crashes php
2017-10-24 14:04:08 +02:00
Anatol Belski 37acebcc8c Fixed bug #72535 arcfour encryption stream filter crashes php 2017-10-24 13:59:18 +02:00
Nikita Popov 5999874886 Merge branch 'PHP-7.0' into PHP-7.1 2017-01-10 23:44:45 +01:00
Robrecht Plaisier d9cd2876d9 Fixed bug #67707 IV not needed for ECB encryption mode, but it returns a warning 2017-01-10 23:42:44 +01:00
Christoph M. Becker a8e25877a2 Deprecate mcrypt and mdecrypt stream filters 2016-07-11 13:17:44 +02:00
Christoph M. Becker dadef20305 Fix tests according to changed deprecation message 2016-07-11 13:17:44 +02:00
Christoph M. Becker dda1c9a0f8 Fix missed test 2016-07-11 13:17:44 +02:00
Christoph M. Becker 3dd380c41e Implement RFC: Deprecate (then Remove) Mcrypt
<https://wiki.php.net/rfc/mcrypt-viking-funeral> has already been accepted,
so we implement it.
2016-07-11 13:17:44 +02:00
Stanislav Malyshev e7f7164e87 Merge branch 'pull-request/1511'
* pull-request/1511:
  Changed from testing cast-128 to cast-256
2015-10-18 15:05:09 -07:00
Nikita Popov e892e2e253 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-03 10:13:44 +02:00
Nikita Popov fe1933aae2 Fixed bug #70625 2015-10-03 10:12:11 +02:00
Daniel Persson e7414a48ef Changed from testing cast-128 to cast-256 2015-09-08 23:01:09 +02:00
Xinchen Hui 0981345734 Merge branch 'PHP-5.6' 2015-04-12 12:12:38 +08:00
Xinchen Hui dd50ec1538 Remove failing test
<nikic> [19:57:28] debian has a libmcrypt patch that makes it work
<nikic> [19:57:43] but not all other distros have it
2015-04-12 12:12:16 +08:00
Nikita Popov 7810659cc3 Removed deprecated mcrypt_ecb() etc 2015-03-09 11:37:13 +01:00
Veres Lajos 06fdf359e3 typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-23 14:52:47 -08:00
Veres Lajos 4dc994571d typo fixes - https://github.com/vlajos/misspell_fixer
Conflicts:
	ext/ftp/ftp.h
	ext/pcre/pcrelib/pcre_printint.c
	ext/pcre/pcrelib/sljit/sljitLir.c
	ext/pcre/pcrelib/sljit/sljitLir.h
	ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
	ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
	ext/pgsql/pgsql.c
	ext/phar/func_interceptors.c
	ext/soap/soap.c
	ext/standard/image.c
2014-11-23 14:33:43 -08:00
Tjerk Meesters 03e9878c78 Fixed mcrypt test case 2014-03-11 20:49:41 +08:00
Tjerk Meesters d09eb1504a Fixed mcrypt test case 2014-03-08 16:16:46 +08:00
Andrey Andreev eb8dfc85ce Add test for bug #62102 / RFC 2144
Using test vectors from RFC 2144, section B.1 (http://tools.ietf.org/rfc/rfc2144.txt)
2014-03-06 22:40:26 +01:00
Nikita Popov d8ed84e4c4 Use zpp for accepting encryption mode string
Leaving the non-zpp usage for the mcrypt_{MODE} functions, as
they're deprecated and I'm too lazy to update all their tests.
2014-03-05 15:32:32 +01:00
Nikita Popov e5738d3bc9 Provide expected IV length in IV error messages 2014-03-05 15:32:32 +01:00
Nikita Popov e4876ecbfb Print supported key sizes in error message 2014-03-05 15:32:32 +01:00
Nikita Popov a861a3a93d Abort on invalid key size
Previously an incorrectly sized key was either silently padded
with NUL bytes or truncated. Especially the silent nature of this
behavior makes it extremely easy to use weak encryption. A common
mistake - which has also been extensively made in our tests - is
to use a password instead of a key.

Incorrectly sized keys will now be rejected.
2014-03-05 15:32:32 +01:00
Nikita Popov 25d801f97e Abort on missing IV if the enc_mode requires it
Previously the code fell back on using a NUL IV if no IV was
passed and the encryption mode required it. This is dangerous and
makes no sense from a practical point of view (as you could just
as well use ECB then).
2014-03-05 15:32:31 +01:00
Nikita Popov c4b7cdb41e Abort on invalid IV size
Previously, if the size of the IV did not match the block size
mcrypt would throw a warning and fall back to a NUL IV. This
behavior is both dangerous and makes no practical sense.

mcrypt_encrypt etc. will now return false if the IV has an incorrect
size.
2014-03-05 15:32:31 +01:00
Sherif Ramadan 7014a0eb6d Fixed Mcrypt deprecated functions and related tests 2012-08-16 10:21:22 -04:00
Nikita Popov 5bf4c5f82c Merge branch 'PHP-5.4' 2012-08-13 22:06:43 +02:00
Nikita Popov f19351b503 Merge branch 'PHP-5.3' into PHP-5.4 2012-08-13 22:06:18 +02:00
Nikita Popov 7aed239050 Ask for less random data in mcrypt_create_iv
Otherwise the RNG blocks and the test takes a lot of time to run (and
occasionally fails).
2012-08-13 22:01:19 +02:00
Nikita Popov 9bc1af1e58 Rename mcrypt_cbf -> mcrypt_cfb
Also fix ECB -> CFB in the initialization vector size call (not that it
makes a difference, they have the same size).
2012-08-13 22:01:03 +02:00
Nikita Popov 544f5ad35b Fix mcrypt_ecb tests after deprecation 2012-08-13 20:30:53 +02:00
Pierre Joye 255913f5f4 - skip if no hash 2011-09-08 10:00:47 +00:00
Pierre Joye 0e05312d03 - skip if no hash 2011-09-08 10:00:47 +00:00
Pierre Joye 567fb34eb3 - skip if no hash 2011-09-08 10:00:47 +00:00
Xinchen Hui 30d1410817 Added skipif 2011-09-06 09:19:46 +00:00
Pierre Joye 17f78b92c4 - add skipif 2011-09-06 06:47:12 +00:00
Pierre Joye 09b6360c71 - add skipif 2011-09-06 06:47:12 +00:00
Pierre Joye 7921f410fc - add skipif 2011-09-06 06:47:12 +00:00
Stanislav Malyshev 3b7cdd0227 fix failing tests 2011-08-01 01:00:57 +00:00
Stanislav Malyshev 553a08c4e1 fix failing tests 2011-08-01 01:00:57 +00:00
Ryan Biesemeyer 292abd1240 tests for bug #55169 (mcrypt and openssl) 2011-07-20 18:59:05 +00:00
Ryan Biesemeyer cd6f4bcf8d tests for bug #55169 (mcrypt and openssl) 2011-07-20 18:59:05 +00:00
Ryan Biesemeyer 80cff0c0e9 tests for bug #55169 (mcrypt and openssl) 2011-07-20 18:59:05 +00:00
Stanislav Malyshev 845d0805a8 MFH: Fixes for broken tests. 2011-05-27 19:27:05 +00:00