gh9339.phpt 596 B

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