summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/bug68912.phpt
blob: 97e75df54572d6b0569774443812b7182b88eae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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(): Argument #1 ($private_key) must be of type OpenSSLAsymmetricKey, resource given