xref: /PHP-8.1/ext/openssl/tests/bug80747.phpt (revision 974dba3b)
1--TEST--
2Bug #80747: Providing RSA key size < 512 generates key that crash PHP
3--EXTENSIONS--
4openssl
5--SKIPIF--
6<?php
7if (OPENSSL_VERSION_NUMBER < 0x10100000) die("skip OpenSSL >= v1.1.0 required");
8?>
9--FILE--
10<?php
11
12$conf = array(
13    'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf',
14    'private_key_bits' => 511,
15);
16var_dump(openssl_pkey_new($conf));
17var_dump(openssl_error_string() !== false);
18
19?>
20--EXPECT--
21bool(false)
22bool(true)
23