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