summaryrefslogtreecommitdiff
path: root/ext/openssl/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/tests')
-rw-r--r--ext/openssl/tests/001.phpt74
-rw-r--r--ext/openssl/tests/bug25614.phpt11
-rw-r--r--ext/openssl/tests/skipif.inc11
3 files changed, 0 insertions, 96 deletions
diff --git a/ext/openssl/tests/001.phpt b/ext/openssl/tests/001.phpt
deleted file mode 100644
index 9b15e134a5..0000000000
--- a/ext/openssl/tests/001.phpt
+++ /dev/null
@@ -1,74 +0,0 @@
---TEST--
-OpenSSL private key functions
---SKIPIF--
-<?php // vim600:syn=php
-include('skipif.inc'); ?>
---POST--
---GET--
---FILE--
-<?php
-echo "Creating private key\n";
-
-/* stack up some entropy; performance is not critical,
- * and being slow will most likely even help the test.
- */
-for ($z = "", $i = 0; $i < 1024; $i++) {
- $z .= $i * $i;
- if (function_exists("usleep"))
- usleep($i);
-}
-
-$privkey = openssl_pkey_new();
-
-if ($privkey === false)
- die("failed to create private key");
-
-$passphrase = "banana";
-$key_file_name = tempnam("/tmp", "ssl");
-if ($key_file_name === false)
- die("failed to get a temporary filename!");
-
-echo "Export key to file\n";
-
-openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase) or die("failed to export to file $key_file_name");
-
-echo "Load key from file - array syntax\n";
-
-$loaded_key = openssl_pkey_get_private(array("file://$key_file_name", $passphrase));
-
-if ($loaded_key === false)
- die("failed to load key using array syntax");
-
-openssl_pkey_free($loaded_key);
-
-echo "Load key using direct syntax\n";
-
-$loaded_key = openssl_pkey_get_private("file://$key_file_name", $passphrase);
-
-if ($loaded_key === false)
- die("failed to load key using direct syntax");
-
-openssl_pkey_free($loaded_key);
-
-echo "Load key manually and use string syntax\n";
-
-$key_content = file_get_contents($key_file_name);
-$loaded_key = openssl_pkey_get_private($key_content, $passphrase);
-
-if ($loaded_key === false)
- die("failed to load key using string syntax");
-
-openssl_pkey_free($loaded_key);
-
-echo "OK!\n";
-
-@unlink($key_file_name);
-
-?>
---EXPECT--
-Creating private key
-Export key to file
-Load key from file - array syntax
-Load key using direct syntax
-Load key manually and use string syntax
-OK!
diff --git a/ext/openssl/tests/bug25614.phpt b/ext/openssl/tests/bug25614.phpt
deleted file mode 100644
index dc8b23ffd6..0000000000
--- a/ext/openssl/tests/bug25614.phpt
+++ /dev/null
@@ -1,11 +0,0 @@
---TEST--
-openssl: get public key from generated private key
---SKIPIF--
-<?php if (!extension_loaded("openssl")) print "skip"; ?>
---FILE--
-<?php
-$priv = openssl_pkey_new();
-$pub = openssl_pkey_get_public($priv);
-?>
---EXPECTF--
-Warning: openssl_pkey_get_public(): Don't know how to get public key from this private key %s
diff --git a/ext/openssl/tests/skipif.inc b/ext/openssl/tests/skipif.inc
deleted file mode 100644
index 21e947d0b2..0000000000
--- a/ext/openssl/tests/skipif.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-// This script prints "skip" if condition does not meet.
-
-if (!extension_loaded("openssl") && ini_get("enable_dl")) {
- $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
- @dl("openssl$dlext");
-}
-if (!extension_loaded("openssl")) {
- die("skip\n");
-}
-?>