]> granicus.if.org Git - php/commitdiff
Fix occasionally failing OpenSSL DH bug test
authorJakub Zelenka <bukka@php.net>
Thu, 16 Jun 2016 19:09:17 +0000 (20:09 +0100)
committerJakub Zelenka <bukka@php.net>
Thu, 16 Jun 2016 19:09:17 +0000 (20:09 +0100)
The test was failing when first byte was 0

ext/openssl/tests/bug55259.phpt

index 27ededdb185e6054c24be147817776b6a2f74a07..b58d28ad73eaf575616056944407697d613c8d20 100644 (file)
@@ -16,14 +16,14 @@ $dh = openssl_pkey_new(array( 'dh'=> array( 'p' => hex2bin($phex), 'g' => '2' ))
 $details = openssl_pkey_get_details($dh);
 var_dump(bin2hex($details['dh']['p']));
 var_dump($details['dh']['g']);
-var_dump(strlen($details['dh']['pub_key']));
-var_dump(strlen($details['dh']['priv_key']));
+var_dump(strlen($details['dh']['pub_key']) > 0);
+var_dump(strlen($details['dh']['priv_key']) > 0);
 echo "Done";
 ?>
 --EXPECT--
 bool(false)
 string(256) "dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61ef75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d2683705577d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e3826634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab"
 string(1) "2"
-int(128)
-int(128)
+bool(true)
+bool(true)
 Done