1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Files
archived-php-src/ext/openssl/tests/bug80747.phpt
Nikita Popov cd8bf0b6bd Relax error check
The precise error is version-dependent, just check that there
is some kind of error reported.
2021-08-05 11:50:11 +02:00

24 lines
457 B
PHP

--TEST--
Bug #80747: Providing RSA key size < 512 generates key that crash PHP
--FILE--
--EXTENSIONS--
openssl
--SKIPIF--
<?php
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));
var_dump(openssl_error_string() !== false);
?>
--EXPECT--
bool(false)
bool(true)