Commit Graph

266 Commits

Author SHA1 Message Date
Nikita Popov
fd5fbba98c Use /dev/urandom as the default mcrypt_create_iv() source
Also fixes the ARGINFO for mcrypt_create_iv() and adds missing
UPGRADING entries.
2014-03-11 14:06:13 +01:00
Tjerk Meesters
03e9878c78 Fixed mcrypt test case 2014-03-11 20:49:41 +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
eb0eac75ef Remove a number of macros that are no longer used 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
b9737aa08e Call mcrypt_module_close on error 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
32333abe3e Clean up do_crypt code
Avoid unnecessary alloc/copy/free cycles and clean up structure in
general. Add a few extra checks for the key length.
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
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Christopher Jones
c6d977dd39 Fix long-standing visual pain point: the misalignment of './configure help' text.
Whitespace changes and a couple of grammar fixes.
2013-08-06 11:06:09 -07:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08: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
Sherif Ramadan
29a0efccef Fixes mcrypt_ecb not issuing an E_DEPRECATED level notice, despite having been deprecated for some time. Please reference bug #62374 as well. 2012-07-21 19:38:03 -04:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00: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
Felipe Pena
23e438594d - Make usage of new PHP_FE_END macro 2011-07-25 11:42:53 +00:00
Felipe Pena
4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena
da376383e8 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Pierre Joye
9805e1674a - remove magic quotes support, functions are kept (see the NEWS entry for the details) for BC reasons but do not allow to set enable MQ 2011-07-22 11:25:30 +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
Pierre Joye
8ec6ada087 - use warning here to match unix behavior 2011-07-10 14:19:51 +00:00
Pierre Joye
b8dd53b713 - use warning here to match unix behavior 2011-07-10 14:19:51 +00:00
Pierre Joye
8a18b29d23 - use warning here to match unix behavior 2011-07-10 14:19:51 +00:00
Stanislav Malyshev
845d0805a8 MFH: Fixes for broken tests. 2011-05-27 19:27:05 +00:00
Jeraimee Hughes
daecb2c0f4 Fixes for broken tests. 2011-05-17 15:08:15 +00:00
Pierre Joye
0e61859b1f - force static, can't be built yet shared anyway 2011-01-19 21:19:45 +00:00
Pierre Joye
a2a62aeb5f - force static, can't be built yet shared anyway 2011-01-19 21:19:45 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00