Bug #74715 [NEW]: openssl_pkcs12_export allows invalid extracerts

From: Date: Thu, 08 Jun 2017 18:00:04 +0000
Subject: Bug #74715 [NEW]: openssl_pkcs12_export allows invalid extracerts
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209425@lists.php.net to get a copy of this message
From: jelle at vdwaa dot nl Operating system: Arch Linux PHP version: 7.2.0alpha1 Package: OpenSSL related Bug Type: Bug Bug description:openssl_pkcs12_export allows invalid extracerts Description: ------------ openssl_pkcs12_read returns true when "garbage" is inserted in the optional extra certs. No error is logged, while an error is expected. The test can be executed in php-src's (git repo) in ext/openssl/tests/ Test script: --------------- $p12 = "./p12_with_extra_certs.p12"; $pass = "qwerty"; openssl_pkcs12_read(file_get_contents($p12), $certs, $pass); //var_dump($certs); $ok = openssl_pkcs12_export($certs['cert'], $out, $certs['pkey'], $pass, array('blup')); var_dump($ok); Expected result: ---------------- Expect a warning to be throw about "blup" not being a valid X509 certificate. Actual result: -------------- bool(true) -- Edit bug report at https://bugs.php.net/bug.php?id=74715&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74715&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74715&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74715&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74715&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74715&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74715&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74715&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74715&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74715&r=support Expected behavior: https://bugs.php.net/fix.php?id=74715&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74715&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74715&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74715&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74715&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74715&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74715&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74715&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74715&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74715&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74715&r=mysqlcfg

« previous php.bugs (#209425) next »