Skip to content

Commit 314bef5

Browse files
jellybukka
authored andcommitted
openssl: Fix openssl_pkcs12_export extracerts test
Fix the openssl_pkcs12_export testcase for extracerts, the 'extracerts' option needs to be the key of the certificate value otherwise openssl_pkcs12_export will ignore it.
1 parent 1d781fb commit 314bef5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/openssl/tests/openssl_pkcs12_export_basic.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ var_dump(openssl_pkcs12_export($cert_path, $output, $priv_path, $pass)); // read
2323
var_dump(openssl_pkcs12_read($output, $opts, $pass));
2424
var_dump(openssl_pkcs12_export($cert_res, $output, $priv_res, $pass)); // read certs from a resource
2525
var_dump(openssl_pkcs12_read($output, $opts, $pass));
26-
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array($cert))); // extra optional cert
26+
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array('extracerts' => $cert))); // extra optional cert
2727
var_dump(openssl_pkcs12_read($output, $opts, $pass));
28-
//var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert
28+
var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert
2929

3030

3131
var_dump(openssl_pkcs12_export($invalid, $output, $invalid, $pass));
@@ -42,6 +42,7 @@ bool(true)
4242
bool(true)
4343
bool(true)
4444
bool(true)
45+
int(3)
4546

4647
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
4748
bool(false)

0 commit comments

Comments
 (0)