xref: /PHP-8.4/ext/openssl/tests/gh9339.phpt (revision 218a93b8)
1--TEST--
2GH-9339: oid_file path check warning contains uninitialized path
3--EXTENSIONS--
4openssl
5--FILE--
6<?php
7$configCode = <<<CONFIG
8oid_file = %s
9[ req ]
10default_bits = 1024
11CONFIG;
12
13$configFile = __DIR__ . '/gh9339.cnf';
14file_put_contents($configFile, sprintf($configCode,  __DIR__ . '/' . str_repeat('a', 9000)));
15openssl_pkey_new([ 'config' => $configFile ]);
16?>
17--CLEAN--
18<?php
19@unlink(__DIR__ . '/gh9339.cnf');
20?>
21--EXPECTF--
22
23Warning: openssl_pkey_new(): Path for oid_file option must be a valid file path in %s on line %d
24