Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/openssl/tests/bug55646.phpt trunk/ext/openssl/tests/bug55646.phpt

2011-09-14 Thread Gustavo Lopes
Em Wed, 14 Sep 2011 09:05:42 +0100, Hannes Magnusson  
 escreveu:



2011/9/12 Gustavo André dos Santos Lopes :

cataphract   Mon, 12 Sep 2011 20:05:07 +

Revision: http://svn.php.net/viewvc?view=revision&revision=316568

Log:
- Test for bug #55646.

Bug: https://bugs.php.net/55646 (Closed) decoding csr corrupts UTF8  
characters


Changed paths:
   A   php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
   A   php/php-src/trunk/ext/openssl/tests/bug55646.phpt


This test is failing for me:

001+ Warning: openssl_csr_new(): dn: add_entry_by_NID 18 -> IT 互
(failed; check error queue and value of string_mask OpenSSL option if
illegal characters are reported) in
/home/bjori/Work/src/php/php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.php
on line 13
002+
003+ Warning: openssl_csr_export() expects parameter 1 to be resource,
boolean given in
/home/bjori/Work/src/php/php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.php
on line 14
003- C: IT 互
004- D: 49 54 20 e4 ba 92
006+ C:
007+ D:



Thanks, I've made the test more portable and also fixed 004.phpt.

--
Gustavo Lopes

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



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/openssl/tests/bug55646.phpt trunk/ext/openssl/tests/bug55646.phpt

2011-09-14 Thread Hannes Magnusson
2011/9/12 Gustavo André dos Santos Lopes :
> cataphract                               Mon, 12 Sep 2011 20:05:07 +
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=316568
>
> Log:
> - Test for bug #55646.
>
> Bug: https://bugs.php.net/55646 (Closed) decoding csr corrupts UTF8 characters
>
> Changed paths:
>    A   php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
>    A   php/php-src/trunk/ext/openssl/tests/bug55646.phpt

This test is failing for me:

001+ Warning: openssl_csr_new(): dn: add_entry_by_NID 18 -> IT 互
(failed; check error queue and value of string_mask OpenSSL option if
illegal characters are reported) in
/home/bjori/Work/src/php/php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.php
on line 13
002+
003+ Warning: openssl_csr_export() expects parameter 1 to be resource,
boolean given in
/home/bjori/Work/src/php/php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.php
on line 14
003- C: IT 互
004- D: 49 54 20 e4 ba 92
006+ C:
007+ D:


-Hannes

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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/openssl/tests/bug55646.phpt trunk/ext/openssl/tests/bug55646.phpt

2011-09-12 Thread Gustavo André dos Santos Lopes
cataphract   Mon, 12 Sep 2011 20:05:07 +

Revision: http://svn.php.net/viewvc?view=revision&revision=316568

Log:
- Test for bug #55646.

Bug: https://bugs.php.net/55646 (Closed) decoding csr corrupts UTF8 characters
  
Changed paths:
A   php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
A   php/php-src/trunk/ext/openssl/tests/bug55646.phpt

Added: php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
===
--- php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
2011-09-12 20:05:07 UTC (rev 316568)
@@ -0,0 +1,32 @@
+--TEST--
+Bug #55646: textual input in openssl_csr_new() is not expected in UTF-8
+--SKIPIF--
+ "sha1","x509_extensions" => 
"v3_ca","req_extensions" => "v3_req","private_key_bits" => 
2048,"private_key_type" => OPENSSL_KEYTYPE_RSA,"encrypt_key" => false,);
+$csr_info = array(
+  "countryName" => "US",
+  "stateOrProvinceName" => "Utah",
+  "localityName" => "Lindon",
+  "organizationName" => "Chinese",
+  "organizationalUnitName" => "IT \xe4\xba\x92",
+  "commonName" => "www.example.com",);
+$private = openssl_pkey_new($config);
+$csr_res = openssl_csr_new($csr_info, $private);
+openssl_csr_export($csr_res, $csr);
+$output = openssl_csr_get_subject($csr);
+
+echo "A: ".$csr_info["organizationalUnitName"]."\n";
+echo "B: ".stringAsHex($csr_info["organizationalUnitName"])."\n";
+echo "C: ".$output['OU']."\n";
+echo "D: ".stringAsHex($output['OU'])."\n";
+--EXPECT--
+A: IT 互
+B: 49 54 20 e4 ba 92
+C: IT 互
+D: 49 54 20 e4 ba 92


Property changes on: 
php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55646.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Added: php/php-src/trunk/ext/openssl/tests/bug55646.phpt
===
--- php/php-src/trunk/ext/openssl/tests/bug55646.phpt   
(rev 0)
+++ php/php-src/trunk/ext/openssl/tests/bug55646.phpt   2011-09-12 20:05:07 UTC 
(rev 316568)
@@ -0,0 +1,32 @@
+--TEST--
+Bug #55646: textual input in openssl_csr_new() is not expected in UTF-8
+--SKIPIF--
+ "sha1","x509_extensions" => 
"v3_ca","req_extensions" => "v3_req","private_key_bits" => 
2048,"private_key_type" => OPENSSL_KEYTYPE_RSA,"encrypt_key" => false,);
+$csr_info = array(
+  "countryName" => "US",
+  "stateOrProvinceName" => "Utah",
+  "localityName" => "Lindon",
+  "organizationName" => "Chinese",
+  "organizationalUnitName" => "IT \xe4\xba\x92",
+  "commonName" => "www.example.com",);
+$private = openssl_pkey_new($config);
+$csr_res = openssl_csr_new($csr_info, $private);
+openssl_csr_export($csr_res, $csr);
+$output = openssl_csr_get_subject($csr);
+
+echo "A: ".$csr_info["organizationalUnitName"]."\n";
+echo "B: ".stringAsHex($csr_info["organizationalUnitName"])."\n";
+echo "C: ".$output['OU']."\n";
+echo "D: ".stringAsHex($output['OU'])."\n";
+--EXPECT--
+A: IT 互
+B: 49 54 20 e4 ba 92
+C: IT 互
+D: 49 54 20 e4 ba 92


Property changes on: php/php-src/trunk/ext/openssl/tests/bug55646.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

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