]> granicus.if.org Git - php/commitdiff
- MFH:
authorPierre Joye <pajoye@php.net>
Mon, 28 May 2007 13:55:30 +0000 (13:55 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 28 May 2007 13:55:30 +0000 (13:55 +0000)
 - tests for #39217
 - skip test if openssl is too old

ext/openssl/tests/bug37820.phpt
ext/openssl/tests/bug39217.phpt [new file with mode: 0644]

index 485114e2019a9e082c6c90e556abc68296aefd27..2eef8c5bdc6511d0aca7b0a6be2e9bb927a86853 100644 (file)
@@ -2,7 +2,8 @@
 openssl_sign/verify: accept different algos 
 --SKIPIF--
 <?php 
-if (!extension_loaded("openssl")) die("skip"); 
+if (!extension_loaded("openssl")) die("skip");
+if (OPENSSL_VERSION_NUMBER < 0x009070af) die("skip");
 ?>
 --FILE--
 <?php 
diff --git a/ext/openssl/tests/bug39217.phpt b/ext/openssl/tests/bug39217.phpt
new file mode 100644 (file)
index 0000000..7d9456b
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+#39217, Large serial number return -1
+--SKIPIF--
+<?php 
+if (!extension_loaded("openssl")) die("skip");
+?>
+--FILE--
+<?php 
+$dir = dirname(__FILE__);
+$certs = array('bug39217cert2.txt', 'bug39217cert1.txt');
+foreach($certs as $cert) {
+       $res = openssl_x509_parse(file_get_contents($dir . '/' . $cert));
+       print_r($res['serialNumber']);
+       echo "\n";
+}
+?>
+--EXPECTF--
+163040343498260435477161879008842183802
+15