From 19524fc6feb44050bbb70c19717c59864ae4955d Mon Sep 17 00:00:00 2001 From: mk-j Date: Wed, 22 Jan 2014 12:58:44 -0700 Subject: Fix for bug66501 - "key type not supported in this PHP build" --- ext/openssl/openssl.c | 9 +++++++++ ext/openssl/tests/bug66501.phpt | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ext/openssl/tests/bug66501.phpt diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 2baf086ca0..a6e4d03157 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3013,6 +3013,15 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) return 0; } break; +#endif +#ifdef EVP_PKEY_EC + case EVP_PKEY_EC: + assert(pkey->pkey.ec != NULL); + + if ( NULL == EC_KEY_get0_private_key(pkey->pkey.ec)) { + return 0; + } + break; #endif default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); diff --git a/ext/openssl/tests/bug66501.phpt b/ext/openssl/tests/bug66501.phpt new file mode 100644 index 0000000000..5c57f2117f --- /dev/null +++ b/ext/openssl/tests/bug66501.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #66501: EC private key support in openssl_sign +--SKIPIF-- +