hnangelo                Sat Jul 19 00:02:46 2008 UTC

  Modified files:              
    /php-src/ext/openssl/tests  003.phpt 012.phpt 023.phpt 025.phpt 
                                bug37820.phpt bug38255.phpt 
                                bug38261.phpt 
  Log:
  Fix tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/003.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/openssl/tests/003.phpt
diff -u php-src/ext/openssl/tests/003.phpt:1.3 
php-src/ext/openssl/tests/003.phpt:1.4
--- php-src/ext/openssl/tests/003.phpt:1.3      Tue May 27 13:54:30 2008
+++ php-src/ext/openssl/tests/003.phpt  Sat Jul 19 00:02:46 2008
@@ -19,7 +19,7 @@
 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));
 
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/012.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/openssl/tests/012.phpt
diff -u php-src/ext/openssl/tests/012.phpt:1.2 
php-src/ext/openssl/tests/012.phpt:1.3
--- php-src/ext/openssl/tests/012.phpt:1.2      Tue Jul 15 03:21:56 2008
+++ php-src/ext/openssl/tests/012.phpt  Sat Jul 19 00:02:46 2008
@@ -8,7 +8,7 @@
 $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 @@
 ?>
 --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(): 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
 
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/023.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/openssl/tests/023.phpt
diff -u php-src/ext/openssl/tests/023.phpt:1.2 
php-src/ext/openssl/tests/023.phpt:1.3
--- php-src/ext/openssl/tests/023.phpt:1.2      Tue Jul 15 03:04:26 2008
+++ php-src/ext/openssl/tests/023.phpt  Sat Jul 19 00:02:46 2008
@@ -4,12 +4,12 @@
 <?php if (!extension_loaded("openssl")) print "skip"; ?>
 --FILE--
 <?php
-$infile = (binary) (dirname(__FILE__) . "/cert.crt");
-$outfile = (binary) tempnam(b"/tmp", b"ssl");
+$infile = dirname(__FILE__) . "/cert.crt";
+$outfile = tempnam(b"/tmp", b"ssl");
 if ($outfile === false)
        die("failed to get a temporary filename!");
 
-$single_cert = (binary) ("file://" . dirname(__FILE__) . "/cert.crt");
+$single_cert = "file://" . dirname(__FILE__) . "/cert.crt";
 $multi_certs = array($single_cert, $single_cert);
 $assoc_headers = array("To" => "[EMAIL PROTECTED]", "Subject" => "testing 
openssl_pkcs7_encrypt()");
 $assoc_headers_bin = array(b"To" => b"[EMAIL PROTECTED]", b"Subject" => 
b"testing openssl_pkcs7_encrypt()");
@@ -48,6 +48,10 @@
 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)
+
+Warning: openssl_pkcs7_encrypt(): Binary string expected, Unicode string 
received in %s on line %d
 bool(false)
 bool(false)
 bool(false)
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/025.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/openssl/tests/025.phpt
diff -u php-src/ext/openssl/tests/025.phpt:1.2 
php-src/ext/openssl/tests/025.phpt:1.3
--- php-src/ext/openssl/tests/025.phpt:1.2      Tue Jul 15 03:04:26 2008
+++ php-src/ext/openssl/tests/025.phpt  Sat Jul 19 00:02:46 2008
@@ -4,13 +4,13 @@
 <?php if (!extension_loaded("openssl")) print "skip"; ?>
 --FILE--
 <?php
-$infile = (binary) (dirname(__FILE__) . "/cert.crt");
-$outfile = (binary) tempnam(b"/tmp", b"ssl");
+$infile = dirname(__FILE__) . "/cert.crt";
+$outfile = tempnam(b"/tmp", b"ssl");
 if ($outfile === false)
        die("failed to get a temporary filename!");
 
-$privkey = (binary) ("file://" . dirname(__FILE__) . "/private.key");
-$single_cert = (binary) ("file://" . dirname(__FILE__) . "/cert.crt");
+$privkey = "file://" . dirname(__FILE__) . "/private.key";
+$single_cert = "file://" . dirname(__FILE__) . "/cert.crt";
 $assoc_headers = array("To" => "[EMAIL PROTECTED]", "Subject" => "testing 
openssl_pkcs7_sign()");
 $assoc_headers_bin = array(b"To" => b"[EMAIL PROTECTED]", b"Subject" => 
b"testing openssl_pkcs7_sign()");
 $headers = array("[EMAIL PROTECTED]", "testing openssl_pkcs7_sign()");
@@ -49,6 +49,10 @@
 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 @@
 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 @@
 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)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug37820.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/openssl/tests/bug37820.phpt
diff -u php-src/ext/openssl/tests/bug37820.phpt:1.2 
php-src/ext/openssl/tests/bug37820.phpt:1.3
--- php-src/ext/openssl/tests/bug37820.phpt:1.2 Mon Oct  9 14:42:47 2006
+++ php-src/ext/openssl/tests/bug37820.phpt     Sat Jul 19 00:02:46 2008
@@ -18,7 +18,7 @@
 
 $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.";
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug38255.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/openssl/tests/bug38255.phpt
diff -u php-src/ext/openssl/tests/bug38255.phpt:1.4 
php-src/ext/openssl/tests/bug38255.phpt:1.5
--- php-src/ext/openssl/tests/bug38255.phpt:1.4 Tue May 27 13:54:30 2008
+++ php-src/ext/openssl/tests/bug38255.phpt     Sat Jul 19 00:02:46 2008
@@ -7,8 +7,8 @@
 --FILE--
 <?php
 $pub_key_id = false; 
-$signature = '';
-$ok = openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5);
+$signature = b'';
+$ok = openssl_verify(b"foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5);
 
 class test {
        function __toString() {
@@ -18,11 +18,11 @@
 $t = new test;
 
 
-var_dump(openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5));
-var_dump(openssl_verify("foo", $t, $pub_key_id, OPENSSL_ALGO_MD5));
-var_dump(openssl_verify("foo", new stdClass, $pub_key_id, OPENSSL_ALGO_MD5));
-var_dump(openssl_verify("foo", new stdClass, array(), OPENSSL_ALGO_MD5));
-var_dump(openssl_verify("foo", array(), array(), OPENSSL_ALGO_MD5));
+var_dump(openssl_verify(b"foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5));
+var_dump(openssl_verify(b"foo", $t, $pub_key_id, OPENSSL_ALGO_MD5));
+var_dump(openssl_verify(b"foo", new stdClass, $pub_key_id, OPENSSL_ALGO_MD5));
+var_dump(openssl_verify(b"foo", new stdClass, array(), OPENSSL_ALGO_MD5));
+var_dump(openssl_verify(b"foo", array(), array(), OPENSSL_ALGO_MD5));
 var_dump(openssl_verify());
 var_dump(openssl_verify(new stdClass, new stdClass, array(), 10000));
 
@@ -39,17 +39,17 @@
 bool(false)
 
 Warning: openssl_verify() expects parameter 2 to be binary string, object 
given in %s on line %d
-NULL
+bool(false)
 
 Warning: openssl_verify() expects parameter 2 to be binary string, object 
given in %s on line %d
-NULL
+bool(false)
 
 Warning: openssl_verify() expects parameter 2 to be binary string, array given 
in %s on line %d
-NULL
+bool(false)
 
 Warning: openssl_verify() expects at least 3 parameters, 0 given in %s on line 
%d
-NULL
+bool(false)
 
 Warning: openssl_verify() expects parameter 1 to be binary string, object 
given in %s on line %d
-NULL
+bool(false)
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug38261.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/openssl/tests/bug38261.phpt
diff -u php-src/ext/openssl/tests/bug38261.phpt:1.5 
php-src/ext/openssl/tests/bug38261.phpt:1.6
--- php-src/ext/openssl/tests/bug38261.phpt:1.5 Tue May 27 13:54:30 2008
+++ php-src/ext/openssl/tests/bug38261.phpt     Sat Jul 19 00:02:46 2008
@@ -14,7 +14,7 @@
 }
 $t = new test;
 
-var_dump(openssl_x509_parse("foo"));
+var_dump(openssl_x509_parse(b"foo"));
 var_dump(openssl_x509_parse($t));
 var_dump(openssl_x509_parse(array()));
 var_dump(openssl_x509_parse());

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to