php-src/ext/openssl/tests/bug68912.phpt
Nikita Popov 1df8175b61 Convert fetch_resource warnings into TypeErrors
More type checks that are not part of zpp and should generate a
TypeError in PHP 8.
2019-06-03 09:17:12 +02:00

23 lines
459 B
PHP

--TEST--
Bug #68912 (Segmentation fault at openssl_spki_new)
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
if (!@openssl_pkey_new()) die("skip cannot create private key");
?>
--FILE--
<?php
$var1=fopen(__FILE__, 'r');
$var2=2;
$var3=3;
try {
openssl_spki_new($var1, $var2, $var3);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
openssl_spki_new(): supplied resource is not a valid OpenSSL X.509/key resource