From 6e211dc4afbd70b681983f73ffbf143833082ca4 Mon Sep 17 00:00:00 2001 From: Henrique do Nascimento Angelo Date: Sat, 19 Jul 2008 00:02:46 +0000 Subject: [PATCH] Fix tests --- ext/openssl/tests/003.phpt | 2 +- ext/openssl/tests/012.phpt | 6 +++++- ext/openssl/tests/023.phpt | 12 +++++++++--- ext/openssl/tests/025.phpt | 16 ++++++++++++---- ext/openssl/tests/bug37820.phpt | 2 +- ext/openssl/tests/bug38255.phpt | 24 ++++++++++++------------ ext/openssl/tests/bug38261.phpt | 2 +- 7 files changed, 41 insertions(+), 23 deletions(-) diff --git a/ext/openssl/tests/003.phpt b/ext/openssl/tests/003.phpt index 939de51bf5b..cfaffe41126 100644 --- a/ext/openssl/tests/003.phpt +++ b/ext/openssl/tests/003.phpt @@ -19,7 +19,7 @@ var_dump(openssl_pkcs7_decrypt($a, $b, $c, $d)); var_dump($c); var_dump(openssl_pkcs7_decrypt($b, $b, $b, $b)); -var_dump(openssl_pkcs7_decrypt($a, $b, "", "")); +var_dump(openssl_pkcs7_decrypt($a, $b, b"", b"")); var_dump(openssl_pkcs7_decrypt($a, $b, true, false)); var_dump(openssl_pkcs7_decrypt($a, $b, 0, 0)); diff --git a/ext/openssl/tests/012.phpt b/ext/openssl/tests/012.phpt index 52009806019..1df2f159436 100644 --- a/ext/openssl/tests/012.phpt +++ b/ext/openssl/tests/012.phpt @@ -8,7 +8,7 @@ $data = b"openssl_open() test"; $pub_key = "file://" . dirname(__FILE__) . "/public.key"; $wrong = "wrong"; -openssl_seal($data, $sealed, $ekeys, array($pub_key)); +openssl_seal($data, $sealed, $ekeys, array($pub_key)); // no output openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key)); // no output openssl_seal($data, $sealed, $ekeys, array($pub_key, $wrong)); openssl_seal($data, $sealed, $ekeys, array($pub_key, (binary)$wrong)); @@ -19,6 +19,8 @@ openssl_seal($data, $sealed, $ekeys, array($wrong)); ?> --EXPECTF-- +Warning: openssl_seal(): Binary string expected, Unicode string received in %s on line %d + Warning: openssl_seal(): not a public key (2th member of pubkeys) in %s on line %d Warning: openssl_seal(): not a public key (2th member of pubkeys) in %s on line %d @@ -29,5 +31,7 @@ Warning: openssl_seal() expects parameter 4 to be array, binary string given in Warning: openssl_seal(): Fourth argument to openssl_seal() must be a non-empty array in %s on line %d +Warning: openssl_seal(): Binary string expected, Unicode string received in %s on line %d + Warning: openssl_seal(): not a public key (1th member of pubkeys) in %s on line %d diff --git a/ext/openssl/tests/023.phpt b/ext/openssl/tests/023.phpt index 905e77e48a9..6a712827bcf 100644 --- a/ext/openssl/tests/023.phpt +++ b/ext/openssl/tests/023.phpt @@ -4,12 +4,12 @@ openssl_pkcs7_encrypt() tests --FILE-- "test@test", "Subject" => "testing openssl_pkcs7_encrypt()"); $assoc_headers_bin = array(b"To" => b"test@test", b"Subject" => b"testing openssl_pkcs7_encrypt()"); @@ -48,6 +48,10 @@ bool(true) bool(true) bool(true) bool(true) + +Warning: openssl_pkcs7_encrypt(): Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received. Skipping it. in %s on line %d + +Warning: openssl_pkcs7_encrypt(): Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received. Skipping it. in %s on line %d bool(true) Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, Unicode string given in %s on line %d @@ -55,6 +59,8 @@ bool(false) bool(false) bool(false) bool(false) + +Warning: openssl_pkcs7_encrypt(): Binary string expected, Unicode string received in %s on line %d bool(false) bool(false) bool(false) diff --git a/ext/openssl/tests/025.phpt b/ext/openssl/tests/025.phpt index b0d655b404a..b2e2715233b 100644 --- a/ext/openssl/tests/025.phpt +++ b/ext/openssl/tests/025.phpt @@ -4,13 +4,13 @@ openssl_pkcs7_sign() tests --FILE-- "test@test", "Subject" => "testing openssl_pkcs7_sign()"); $assoc_headers_bin = array(b"To" => b"test@test", b"Subject" => b"testing openssl_pkcs7_sign()"); $headers = array("test@test", "testing openssl_pkcs7_sign()"); @@ -49,6 +49,10 @@ bool(true) bool(true) bool(true) bool(true) + +Warning: openssl_pkcs7_sign(): Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received. Skipping it. in %s on line %d + +Warning: openssl_pkcs7_sign(): Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received. Skipping it. in %s on line %d bool(true) Warning: openssl_pkcs7_sign() expects parameter 5 to be array, Unicode string given in %s on line %d @@ -63,6 +67,8 @@ bool(false) Warning: openssl_pkcs7_sign(): error opening output file %s in %s on line %d bool(false) +Warning: openssl_pkcs7_sign(): Binary string expected, Unicode string received in %s on line %d + Warning: openssl_pkcs7_sign(): error getting cert in %s on line %d bool(false) @@ -75,6 +81,8 @@ bool(false) Warning: openssl_pkcs7_sign() expects parameter 5 to be array, binary string given in %s on line %d NULL +Warning: openssl_pkcs7_sign(): Binary string expected, Unicode string received in %s on line %d + Warning: openssl_pkcs7_sign(): error getting private key in %s on line %d bool(false) diff --git a/ext/openssl/tests/bug37820.phpt b/ext/openssl/tests/bug37820.phpt index 2eef8c5bdc6..68729e75798 100644 --- a/ext/openssl/tests/bug37820.phpt +++ b/ext/openssl/tests/bug37820.phpt @@ -18,7 +18,7 @@ $priv_key_id = openssl_get_privatekey($priv_key); $pub_key = file_get_contents($file_pub); $pub_key_id = openssl_get_publickey($pub_key); -$data = "some custom data"; +$data = b"some custom data"; if (!openssl_sign($data, $signature, $priv_key_id, OPENSSL_ALGO_MD5)) { echo "openssl_sign failed."; } diff --git a/ext/openssl/tests/bug38255.phpt b/ext/openssl/tests/bug38255.phpt index a647c5cf51d..539f0180761 100644 --- a/ext/openssl/tests/bug38255.phpt +++ b/ext/openssl/tests/bug38255.phpt @@ -7,8 +7,8 @@ if (!extension_loaded("openssl")) die("skip"); --FILE--