Test Failure Report for ext/openssl/tests/bug55646.phpt ('Bug #55646: textual input in openssl_csr_new() is not expected in UTF-8')
Script
1:
<?php 2: function stringAsHex($string){$unpacked = unpack("H*", $string);return implode(" ", str_split($unpacked[1],2));} 3: 4: $config = array("digest_alg" => "sha1","x509_extensions" => "v3_ca","req_extensions" => "v3_req","private_key_bits" => 2048,"private_key_type" => OPENSSL_KEYTYPE_RSA,"encrypt_key" => false,); 5: $csr_info = array( 6: "countryName" => "US", 7: "stateOrProvinceName" => "Utah", 8: "localityName" => "Lindon", 9: "organizationName" => "Chinese", 10: "organizationalUnitName" => "IT \xe4\xba\x92", 11: "commonName" => "www.example.com",); 12: $private = openssl_pkey_new($config); 13: while (openssl_error_string()) {} 14: $csr_res = openssl_csr_new($csr_info, $private, 15: ['config' => __DIR__."/openssl.cnf"]); 16: if (!$csr_res) { 17: while ($e = openssl_error_string()) { $err = $e; } 18: die("Failed; last error: $err"); 19: } 20: openssl_csr_export($csr_res, $csr); 21: $output = openssl_csr_get_subject($csr); 22: 23: echo "A: ".$csr_info["organizationalUnitName"]."\n"; 24: echo "B: ".stringAsHex($csr_info["organizationalUnitName"])."\n"; 25: echo "C: ".$output['OU']."\n"; 26: echo "D: ".stringAsHex($output['OU'])."\n"; 27:
Expected
A: IT 互
B: 49 54 20 e4 ba 92
C: IT 互
D: 49 54 20 e4 ba 92
Output
** ERROR: process timed out **
Diff
001+ ** ERROR: process timed out **
001- A: IT 互
002- B: 49 54 20 e4 ba 92
003- C: IT 互
004- D: 49 54 20 e4 ba 92
Generated at Fri, 17 May 2013 23:23:52 +0000 (8 hours ago)
|