Nikita Popov [Sat, 1 Mar 2014 14:42:07 +0000 (15:42 +0100)]
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).
Nikita Popov [Sat, 1 Mar 2014 14:29:20 +0000 (15:29 +0100)]
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.
Remi Collet [Wed, 5 Mar 2014 09:40:36 +0000 (10:40 +0100)]
Fixed Bug #66815 imagecrop(): insufficient fix for NULL defer CVE-2013-7327
This amends commit 8f4a537, which aimed to correct NULL dereference because of
missing check of gdImageCreateTrueColor() / gdImageCreate() return value. That
commit checks for negative crop rectangle width and height, but
gdImageCreate*() can also return NULL when width * height overflows. Hence
NULL deref is still possible, as gdImageSaveAlpha() and gdImagePaletteCopy()
is called before dst == NULL check.
This moves NULL check to happen right after gdImageCreate*(). It also removes
width and height check before gdImageCreate*(), as the same check is done by
image create functions (with an extra warning).
Daniel Lowrey [Sun, 2 Mar 2014 14:03:39 +0000 (07:03 -0700)]
Capture peer cert even if verify fails
Previously the "capture_peer_cert" SSL context option only
captured the peer's certificate if the verification routine
succeeded.
By also capturing the on verify failure applications have the
ability to parse the cert and ask users whether they wish to
proceed given the information presented by the peer.
Chris Wright [Sun, 2 Mar 2014 01:57:20 +0000 (01:57 +0000)]
Windows cert verify improvements + leak fixes
- Clean up properly at all fail points in native Windows peer
verification routine
- Bring certificate usages and chain flags into line with chromium
implementation in windows environments
The reason behind this change is a stack allocation issue pointed
out by Dmitry: As of PHP 5.5 the stack necessary for pushing
arguments is precomputed and preallocated, as such the individual
SEND opcodes no longer verify that there is enough stack space.
The unpacked arguments will occupy some of that preallocated
space and as such following positional arguments could write past
a stack page boundary.
An alternative resolution for this issue is to ensure that there
is enough space for the remaining arguments in the UNPACK opcode.
However making this allocation precise (rather than using a
conversative over-estimate) would require some effort. Given that
this particular aspect of the feature wasn't very popular in the
first place, it doesn't seem worth the effort.
Nikita Popov [Tue, 25 Feb 2014 23:14:50 +0000 (00:14 +0100)]
Store arg_num in fcall entry
Instead of storing the argument number in the znode of the parameter
list, store it in fcall->arg_num. This mainly cleans up the parameter
parsing code, which previously had to duplicate all rules (this
becomes more excessive as more features are added, e.g. named params
would already require a minimum of 14 rules...)
Nikita Popov [Tue, 25 Feb 2014 22:39:50 +0000 (23:39 +0100)]
Introduce zend_function_call_entry structure
Instead of directly pushing the zend_function* onto the
function_call_stack, push this structure. This allows us to store
additional data on this stack.
Ferenc Kovacs [Wed, 26 Feb 2014 14:13:40 +0000 (15:13 +0100)]
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
add news entry
add news entry
add clear_env option to FPM config
add clear_env option to FPM config
Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
Daniel Lowrey [Tue, 25 Feb 2014 19:43:52 +0000 (12:43 -0700)]
Merge branch 'windowsPeerVerification' of https://github.com/DaveRandom/php-src into PHP-5.6
* 'windowsPeerVerification' of https://github.com/DaveRandom/php-src:
Update openssl tests with new server/client test harness
Add peer certificate verification on windows