xref: /PHP-5.4/ext/openssl/tests/004.phpt (revision bff81525)
1--TEST--
2openssl_csr_new() tests
3--SKIPIF--
4<?php if (!extension_loaded("openssl")) print "skip"; ?>
5--FILE--
6<?php
7
8$a = 1;
9var_dump(openssl_csr_new(1,$a));
10var_dump(openssl_csr_new(1,$a,1,1));
11$a = array();
12var_dump(openssl_csr_new(array(), $a, array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'), array()));
13
14//this leaks
15$a = array(1,2);
16$b = array(1,2);
17var_dump(openssl_csr_new($a, $b, array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf')));
18
19
20echo "Done\n";
21?>
22--EXPECTF--
23Warning: openssl_csr_new() expects parameter 1 to be array, integer given in %s on line %d
24NULL
25
26Warning: openssl_csr_new() expects parameter 1 to be array, integer given in %s on line %d
27NULL
28
29Warning: openssl_csr_new(): key array must be of the form array(0 => key, 1 => phrase) in %s on line %d
30
31Warning: openssl_csr_new(): add1_attr_by_txt challengePassword_min -> 4 (failed; check error queue and value of string_mask OpenSSL option if illegal characters are reported) in %s on line %d
32bool(false)
33resource(%d) of type (OpenSSL X.509 CSR)
34Done
35