diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 7413be453ca6b..5ceacdc4dce55 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -151,7 +151,7 @@ Naming Conventions 7. Classes should be given descriptive names. Avoid using abbreviations where possible. Each word in the class name should start with a capital letter, - without underscore delimiters (CampelCaps starting with a capital letter). + without underscore delimiters (CamelCaps starting with a capital letter). The class name should be prefixed with the name of the 'parent set' (e.g. the name of the extension):: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 4a9fcbc9e301f..2e948b098a367 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4676,9 +4676,6 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ GET_VER_OPT_STRING("local_cert", certfile); if (certfile) { - X509 *cert = NULL; - EVP_PKEY *key = NULL; - SSL *tmpssl; char resolved_path_buff[MAXPATHLEN]; const char * private_key = NULL; @@ -4705,7 +4702,11 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ } } - tmpssl = SSL_new(ctx); +#if OPENSSL_VERSION_NUMBER < 0x10001001L + /* Unnecessary as of OpenSSLv1.0.1 (will segfault if used with >= 10001001 ) */ + X509 *cert = NULL; + EVP_PKEY *key = NULL; + SSL *tmpssl = SSL_new(ctx); cert = SSL_get_certificate(tmpssl); if (cert) { @@ -4714,7 +4715,7 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ EVP_PKEY_free(key); } SSL_free(tmpssl); - +#endif if (!SSL_CTX_check_private_key(ctx)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Private key does not match certificate!"); }