1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Files
archived-php-src/ext/openssl/tests/bug80747.phpt
Remi Collet ae0585c98e skip test with openssl < 1.1.0
The test fails, but without any crash
(this test is designed to catch a crash)
2021-02-25 13:52:35 +01:00

25 lines
533 B
PHP

--TEST--
Bug #80747: Providing RSA key size < 512 generates key that crash PHP
--FILE--
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (OPENSSL_VERSION_NUMBER < 0x10100000) die("skip OpenSSL >= v1.1.0 required");
?>
--FILE--
<?php
$conf = array(
'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf',
'private_key_bits' => 511,
);
var_dump(openssl_pkey_new($conf));
while ($e = openssl_error_string()) {
echo $e, "\n";
}
?>
--EXPECTF--
bool(false)
error:%s:key size too small