com php-src: Skip failing tests when EC unavailable (RHEL): ext/openssl/openssl.c ext/openssl/tests/bug64802.phpt ext/openssl/tests/bug66501.phpt

From: Date: Wed, 19 Feb 2014 10:57:37 +0000
Subject: com php-src: Skip failing tests when EC unavailable (RHEL): 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-76117@lists.php.net to get a copy of this message
Commit: 633f898f1520253d3530fe91fc82f68bca7c4627 Author: Daniel Lowrey <rdlowrey@php.net> Wed, 19 Feb 2014 03:57:37 -0700 Parents: a289b37f48f730bbb46159f2fab2bbc95d4c7d64 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=633f898f1520253d3530fe91fc82f68bca7c4627 Log: Skip failing tests when EC unavailable (RHEL) 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 3e60cd5..d20ca83 100755 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -78,6 +78,10 @@ #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 @@ -88,7 +92,7 @@ enum php_openssl_key_type { OPENSSL_KEYTYPE_DSA, OPENSSL_KEYTYPE_DH, OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA, -#ifdef EVP_PKEY_EC +#ifdef HAVE_EVP_PKEY_EC OPENSSL_KEYTYPE_EC = OPENSSL_KEYTYPE_DH +1 #endif }; @@ -1116,7 +1120,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 EVP_PKEY_EC +#ifdef HAVE_EVP_PKEY_EC REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_EC", OPENSSL_KEYTYPE_EC, CONST_CS|CONST_PERSISTENT); #endif @@ -3014,7 +3018,7 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) } break; #endif -#if OPENSSL_VERSION_NUMBER >= 0x0090800fL && !defined(OPENSSL_NO_EC) && defined(EVP_PKEY_EC) +#ifdef HAVE_EVP_PKEY_EC case EVP_PKEY_EC: assert(pkey->pkey.ec != NULL); @@ -3423,7 +3427,7 @@ PHP_FUNCTION(openssl_pkey_get_details) } break; -#ifdef EVP_PKEY_EC +#ifdef HAVE_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 9a59701..be0b5f9 100644 --- a/ext/openssl/tests/bug64802.phpt +++ b/ext/openssl/tests/bug64802.phpt @@ -3,6 +3,7 @@ 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 5c57f21..cd0da1f 100644 --- a/ext/openssl/tests/bug66501.phpt +++ b/ext/openssl/tests/bug66501.phpt @@ -3,6 +3,7 @@ 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

« previous php.cvs (#76117) next »