diff options
author | Jakub Zelenka <bukka@php.net> | 2017-10-30 14:16:03 +0000 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2017-10-30 16:40:56 +0000 |
commit | 548798818bc0d834a525299d97c69c3a55db11da (patch) | |
tree | 4614dc2b15fe3bd9e8cc6eb1339424799c8e244d /ext/openssl | |
parent | 55d92413b9d6afe4489ddee7924548ea3b6656c4 (diff) | |
download | php-git-548798818bc0d834a525299d97c69c3a55db11da.tar.gz |
Extend openssl_pkcs7_* tests to cover resource cert
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt | 2 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt | 4 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_pkcs7_sign_basic.phpt | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt b/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt index 5589abb039..5d0f3cbb9e 100644 --- a/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt @@ -22,6 +22,7 @@ $empty = ""; openssl_pkcs7_encrypt($infile, $encrypted, $single_cert, $headers); var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $single_cert, $privkey)); +var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, openssl_x509_read($single_cert), $privkey)); var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $single_cert, $wrong)); var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $wrong, $privkey)); var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, null, $privkey)); @@ -42,6 +43,7 @@ if (file_exists($outfile)) { ?> --EXPECTF-- bool(true) +bool(true) Warning: openssl_pkcs7_decrypt(): unable to get private key in %s on line %d bool(false) diff --git a/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt b/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt index 5f74f97b0c..dee417692d 100644 --- a/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt @@ -22,6 +22,7 @@ $wrong = "wrong"; $empty = ""; var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $headers)); +var_dump(openssl_pkcs7_encrypt($infile, $outfile, openssl_x509_read($single_cert), $headers)); var_dump(openssl_pkcs7_decrypt($outfile, $outfile2, $single_cert, $privkey)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $assoc_headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $empty_headers)); @@ -33,6 +34,7 @@ var_dump(openssl_pkcs7_encrypt($infile, $outfile, $wrong, $headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $empty, $headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $empty)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $multi_certs, $headers)); +var_dump(openssl_pkcs7_encrypt($infile, $outfile, array_map('openssl_x509_read', $multi_certs) , $headers)); if (file_exists($outfile)) { echo "true\n"; @@ -48,6 +50,7 @@ bool(true) bool(true) bool(true) bool(true) +bool(true) Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, string given in %s on line %d bool(false) @@ -60,5 +63,6 @@ bool(false) Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, string given in %s on line %d bool(false) bool(true) +bool(true) true true diff --git a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt index ac8edf19a9..0aae1fbdfa 100644 --- a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt @@ -18,6 +18,7 @@ $empty_headers = array(); $wrong = "wrong"; $empty = ""; +var_dump(openssl_pkcs7_sign($infile, $outfile, openssl_x509_read($single_cert), $privkey, $headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $assoc_headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $empty_headers)); @@ -39,6 +40,7 @@ if (file_exists($outfile)) { bool(true) bool(true) bool(true) +bool(true) Warning: openssl_pkcs7_sign() expects parameter 5 to be array, string given in %s on line %d NULL |