Bug #69272 [NEW]: openssl_spki_export outputs public key to stdout

From: Date: Fri, 20 Mar 2015 16:24:17 +0000
Subject: Bug #69272 [NEW]: openssl_spki_export outputs public key to stdout
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191494@lists.php.net to get a copy of this message
From: fkooman at tuxed dot net Operating system: Linux PHP version: 5.6.7 Package: OpenSSL related Bug Type: Bug Bug description:openssl_spki_export outputs public key to stdout Description: ------------ the openssl_spki_export() function outputs the pubkey to stdout instead of in the return value as is suggested by the documentation on http://php.net/manual/en/function.openssl-spki-export.php. Test script: --------------- $ cat openssl_spki_export.php <?php $spkac = 'MIICYDCCAUgwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQtftB35r7naJsELxZyQj64Sshxu2QEtb0cWWbxijxduHR4JecLzBEHG4hKCRoIqSkRVFAWqWKxYIDq3JFNkA3172u0Dv2eNiTf+hQ/tNCzjtgUebeosJNalNCMz/HVNJWZaiN1as7wE6q+d8jTuZjQmEmN7g1jAqN5E2ntl5ABQk84/fzJyQLsYXfKcZYLeIxQOn9X8xLLUcW1oAsPmZj6sG/nbPmYBTyvC2eveVaW7//3ZY0WK8q0bREKu/YF1jj18W4OSAI0hWkjiKW7yVzZZHzEO71YaRA6CcfoOGx4HCA+VG09kCXdlHD9KHaEM4IoYXfimq1xE40LnOQx1dtAgMBAAEWIGZhNjFlYzgxMzY0OGFlMTU3NDY2NTQyN2NmZDhmZTFkMA0GCSqGSIb3DQEBBAUAA4IBAQARDf9DVVv8P/4xhmTEyJWMBd7gy55JqJ/aAusjMRqqlX19c3xOGofjbHlDsGB91rbX8AhrUqN1dJS69cjNgPuWv/ZgMEjm2mctajZYBdE7b1HBWx/B9nxSIt5esB+H+Lt74I4AWLWQb/Y4UXRdOxKgGS1uUMQEHPfH1hkf4OBEamI+PoVyksvQpNarTFXbybiGmNfRcc9kJFLrZTNLK/MtY8wHA0yai9tsJOn/kN+KnmaTqk18QwEV0Lco+4SmH8wEu3Xo/JMIa6S+MAsI8u/D0sgiRYk/PKW/VGPb17PLX1e9F4QZbRpNmpVUfS3MCE6afaw4vEvmsjBQnU3BHDAG'; openssl_spki_export($spkac); $ php openssl_spki_export.php -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0LX7Qd+a+52ibBC8WckI +uErIcbtkBLW9HFlm8Yo8Xbh0eCXnC8wRBxuISgkaCKkpEVRQFqlisWCA6tyRTZA N9e9rtA79njYk3/oUP7TQs47YFHm3qLCTWpTQjM/x1TSVmWojdWrO8BOqvnfI07m Y0JhJje4NYwKjeRNp7ZeQAUJPOP38yckC7GF3ynGWC3iMUDp/V/MSy1HFtaALD5m Y+rBv52z5mAU8rwtnr3lWlu//92WNFivKtG0RCrv2BdY49fFuDkgCNIVpI4ilu8l c2WR8xDu9WGkQOgnH6DhseBwgPlRtPZAl3ZRw/Sh2hDOCKGF34pqtcRONC5zkMdX bQIDAQAB -----END PUBLIC KEY----- [fkooman@franet data]$ Expected result: ---------------- expect to place the pubkey in the return variable and not on stdout Actual result: -------------- pubkey is placed in stdout -- Edit bug report at https://bugs.php.net/bug.php?id=69272&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69272&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69272&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69272&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69272&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69272&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69272&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69272&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69272&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69272&r=support Expected behavior: https://bugs.php.net/fix.php?id=69272&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69272&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69272&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69272&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69272&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69272&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69272&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69272&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69272&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69272&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69272&r=mysqlcfg

« previous php.bugs (#191494) next »