mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The error happens when the PEM contains a public key, as it will be first tried to be parsed as a certificate. The parsing as a certificate fails, which then leads to a corresponding error tracked by PHP with the next call to php_openssl_store_errors(). This change introduces an error marking to be able to reset the stored errors to the state before trying the certificate. Closes GH-11055
16 lines
299 B
PHP
16 lines
299 B
PHP
--TEST--
|
|
Bug #11054: Calling with a PEM public key results in error
|
|
--EXTENSIONS--
|
|
openssl
|
|
--FILE--
|
|
<?php
|
|
|
|
$key_file_name = __DIR__ . '/bug11054.pem';
|
|
$key_content = file_get_contents($key_file_name);
|
|
openssl_get_publickey($key_content);
|
|
var_dump(openssl_error_string());
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|