-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-9339: OpenSSL oid_file path check warning contains uninitializ…
…ed path
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
GH-9339: oid_file path check warning contains uninitialized path | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded("openssl")) die("skip openssl not loaded"); | ||
?> | ||
--FILE-- | ||
<?php | ||
$configCode = <<<CONFIG | ||
oid_file = %s | ||
[ req ] | ||
default_bits = 1024 | ||
CONFIG; | ||
|
||
$configFile = __DIR__ . '/gh9339.cnf'; | ||
file_put_contents($configFile, sprintf($configCode, __DIR__ . '/' . str_repeat('a', 9000))); | ||
openssl_pkey_new([ 'config' => $configFile ]); | ||
?> | ||
--CLEAN-- | ||
<?php | ||
@unlink(__DIR__ . '/gh9339.cnf'); | ||
?> | ||
--EXPECTF-- | ||
|
||
Warning: openssl_pkey_new(): Path for oid_file option must be a valid file path in %s on line %d |