com php-src: Revert "Fix tests failing if EC unavailable": ext/openssl/openssl.c ext/openssl/tests/bug64802.phpt ext/openssl/tests/bug66501.phpt
| From: | rdlowrey@php.net | Date: | Wed, 19 Feb 2014 01:37:16 +0000 |
| Subject: | com php-src: Revert "Fix tests failing if EC unavailable": ext/openssl/openssl.c ext/openssl/tests/bug64802.phpt ext/openssl/tests/bug66501.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76102@lists.php.net to get a copy of this message | ||
Commit: 486ed38115450d2357a8d2e68291074d35c6aacf
Author: Daniel Lowrey <rdlowrey@php.net> Tue, 18 Feb 2014 18:37:16 -0700
Parents: 5e14a1269dbf9f2f73ad7f63be88174f9e5a49fd
Branches: PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=486ed38115450d2357a8d2e68291074d35c6aacf
Log:
Revert "Fix tests failing if EC unavailable"
This reverts commit 5e14a1269dbf9f2f73ad7f63be88174f9e5a49fd.
Changed paths:
M ext/openssl/openssl.c
M ext/openssl/tests/bug64802.phpt
M ext/openssl/tests/bug66501.phpt
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index d20ca83..3e60cd5 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -78,10 +78,6 @@
#endif
#define DEBUG_SMIME 0
-#if !defined(OPENSSL_NO_EC) && defined(EVP_PKEY_EC)
-#define HAVE_EVP_PKEY_EC 1
-#endif
-
/* FIXME: Use the openssl constants instead of
* enum. It is now impossible to match real values
* against php constants. Also sorry to break the
@@ -92,7 +88,7 @@ enum php_openssl_key_type {
OPENSSL_KEYTYPE_DSA,
OPENSSL_KEYTYPE_DH,
OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA,
-#ifdef HAVE_EVP_PKEY_EC
+#ifdef EVP_PKEY_EC
OPENSSL_KEYTYPE_EC = OPENSSL_KEYTYPE_DH +1
#endif
};
@@ -1120,7 +1116,7 @@ PHP_MINIT_FUNCTION(openssl)
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DSA", OPENSSL_KEYTYPE_DSA,
CONST_CS|CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DH", OPENSSL_KEYTYPE_DH,
CONST_CS|CONST_PERSISTENT);
-#ifdef HAVE_EVP_PKEY_EC
+#ifdef EVP_PKEY_EC
REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_EC", OPENSSL_KEYTYPE_EC,
CONST_CS|CONST_PERSISTENT);
#endif
@@ -3018,7 +3014,7 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
}
break;
#endif
-#ifdef HAVE_EVP_PKEY_EC
+#if OPENSSL_VERSION_NUMBER >= 0x0090800fL && !defined(OPENSSL_NO_EC) &&
defined(EVP_PKEY_EC)
case EVP_PKEY_EC:
assert(pkey->pkey.ec != NULL);
@@ -3427,7 +3423,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
}
break;
-#ifdef HAVE_EVP_PKEY_EC
+#ifdef EVP_PKEY_EC
case EVP_PKEY_EC:
ktype = OPENSSL_KEYTYPE_EC;
break;
diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt
index be0b5f9..9a59701 100644
--- a/ext/openssl/tests/bug64802.phpt
+++ b/ext/openssl/tests/bug64802.phpt
@@ -3,7 +3,6 @@ Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
-if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
?>
--FILE--
<?php
diff --git a/ext/openssl/tests/bug66501.phpt b/ext/openssl/tests/bug66501.phpt
index cd0da1f..5c57f21 100644
--- a/ext/openssl/tests/bug66501.phpt
+++ b/ext/openssl/tests/bug66501.phpt
@@ -3,7 +3,6 @@ Bug #66501: EC private key support in openssl_sign
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
-if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
--FILE--
<?php
$pkey = 'ASN1 OID: prime256v1