xref: /PHP-7.1/ext/openssl/tests/bug73711.phpt (revision 366b1640)
1--TEST--
2Bug #73711: Segfault in openssl_pkey_new when generating DSA or DH key
3--SKIPIF--
4<?php
5if (!extension_loaded("openssl")) die("skip openssl not loaded");
6?>
7--FILE--
8<?php
9$cnf = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug73711.cnf';
10var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DSA, 'config' => $cnf]));
11var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DH, 'config' => $cnf]));
12echo "DONE";
13?>
14--EXPECTF--
15resource(%d) of type (OpenSSL key)
16resource(%d) of type (OpenSSL key)
17DONE
18