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