Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #80747: Providing RSA key size < 512 generates key that crash PHP --EXTENSION..

Decoded Output download

--TEST--
Bug #80747: Providing RSA key size < 512 generates key that crash PHP
--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)

Did this file decode correctly?

Original Code

--TEST--
Bug #80747: Providing RSA key size < 512 generates key that crash PHP
--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)

Function Calls

None

Variables

None

Stats

MD5 5f5aad139b1c3f6e03eefec41ed2133c
Eval Count 0
Decode Time 77 ms