From 314bef5d037ac2db7fe971b5e6a0c1852ebe66ec Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Sat, 12 Aug 2017 01:46:34 +0200 Subject: [PATCH] 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. --- ext/openssl/tests/openssl_pkcs12_export_basic.phpt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/openssl/tests/openssl_pkcs12_export_basic.phpt b/ext/openssl/tests/openssl_pkcs12_export_basic.phpt index 572c9d9266..dba4b0e1ce 100644 --- a/ext/openssl/tests/openssl_pkcs12_export_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs12_export_basic.phpt @@ -23,9 +23,9 @@ var_dump(openssl_pkcs12_export($cert_path, $output, $priv_path, $pass)); // read var_dump(openssl_pkcs12_read($output, $opts, $pass)); var_dump(openssl_pkcs12_export($cert_res, $output, $priv_res, $pass)); // read certs from a resource var_dump(openssl_pkcs12_read($output, $opts, $pass)); -var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array($cert))); // extra optional cert +var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array('extracerts' => $cert))); // extra optional cert var_dump(openssl_pkcs12_read($output, $opts, $pass)); -//var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert +var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert var_dump(openssl_pkcs12_export($invalid, $output, $invalid, $pass)); @@ -42,6 +42,7 @@ bool(true) bool(true) bool(true) bool(true) +int(3) Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d bool(false) -- 2.40.0