xref: /PHP-8.0/ext/openssl/tests/bug68912.phpt (revision e8e4ddce)
1--TEST--
2Bug #68912 (Segmentation fault at openssl_spki_new)
3--SKIPIF--
4<?php
5if (!extension_loaded("openssl")) die("skip");
6if (!@openssl_pkey_new()) die("skip cannot create private key");
7?>
8--FILE--
9<?php
10
11$var1=fopen(__FILE__, 'r');
12$var2=2;
13$var3=3;
14
15try {
16    openssl_spki_new($var1, $var2, $var3);
17} catch (TypeError $e) {
18    echo $e->getMessage(), "\n";
19}
20?>
21--EXPECT--
22openssl_spki_new(): Argument #1 ($private_key) must be of type OpenSSLAsymmetricKey, resource given
23