From d8ccffa79a983a8f4ce0304d6d69beb52f20579c Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Mon, 30 Oct 2017 16:05:00 +0000 Subject: Extend and speed up pkey export tests --- ext/openssl/tests/001.phpt | 11 ++--------- ext/openssl/tests/openssl_pkey_export_basic.phpt | 3 ++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/ext/openssl/tests/001.phpt b/ext/openssl/tests/001.phpt index 627077e8f4..1baa958895 100644 --- a/ext/openssl/tests/001.phpt +++ b/ext/openssl/tests/001.phpt @@ -9,15 +9,6 @@ if (!@openssl_pkey_new()) die("skip cannot create private key"); dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf'); $privkey = openssl_pkey_new($conf); @@ -32,6 +23,7 @@ if ($key_file_name === false) echo "Export key to file\n"; openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to export to file $key_file_name"); +var_dump(is_resource($privkey)); echo "Load key from file - array syntax\n"; @@ -69,6 +61,7 @@ echo "OK!\n"; --EXPECT-- Creating private key Export key to file +bool(true) Load key from file - array syntax Load key using direct syntax Load key manually and use string syntax diff --git a/ext/openssl/tests/openssl_pkey_export_basic.phpt b/ext/openssl/tests/openssl_pkey_export_basic.phpt index d229d6b135..b591bfecd3 100644 --- a/ext/openssl/tests/openssl_pkey_export_basic.phpt +++ b/ext/openssl/tests/openssl_pkey_export_basic.phpt @@ -37,7 +37,7 @@ $tempname = tempnam(sys_get_temp_dir(), 'openssl_ec'); var_dump(openssl_pkey_export_to_file($key, $tempname, NULL, $config_arg)); $details = openssl_pkey_get_details(openssl_pkey_get_private('file://' . $tempname)); var_dump(OPENSSL_KEYTYPE_EC === $details['type']); - +var_dump(is_resource($key)); // Clean the temporary file @unlink($tempname); @@ -52,3 +52,4 @@ resource(%d) of type (OpenSSL key) bool(true) bool(true) bool(true) +bool(true) -- cgit v1.2.1