Support ciphers in openssl_seal()/openssl_open() that require an IV
commit0e853b502ae123b225bdbb3b61a75e10a9f459f6
authorBenjamin Strahs <benjaminstrahs@fb.com>
Sat, 26 Dec 2015 13:40:28 +0000 (26 05:40 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Sat, 26 Dec 2015 14:00:38 +0000 (26 06:00 -0800)
treefecaf79a05ae68992cf9448ca86b041dba8ca160
parentf4169931e00a3148cb111695829b384b661f19ba
Support ciphers in openssl_seal()/openssl_open() that require an IV

Summary: There has been a longstanding bug in both HHVM and PHP where any cipher that requires an IV will fail when used in openssl_seal() and openssl_open() (https://bugs.php.net/bug.php?id=70438). In PHP 7 this is fixed by adding a reference parameter to openssl_seal() that will return the generated IV. The semantics of this are a bit confusing, but we should maintain compatability.

Reviewed By: sgolemon

Differential Revision: D2788754

fb-gh-sync-id: c866fa4345370297f10445689e0425acb45a00fd
hphp/runtime/ext/openssl/ext_openssl.cpp
hphp/runtime/ext/openssl/ext_openssl.h
hphp/runtime/ext/openssl/ext_openssl.php
hphp/test/zend/good/ext/openssl/tests/bug70438.php [new file with mode: 0644]
hphp/test/zend/good/ext/openssl/tests/bug70438.php.expectf [new file with mode: 0644]