diff --git a/NEWS b/NEWS index 2660df8f63193..999cedf7b5e50 100644 --- a/NEWS +++ b/NEWS @@ -45,6 +45,7 @@ PHP NEWS - Openssl: . Added crypto_method option for the ssl stream context. (Martin Jansen) . Added certificate fingerprint support. (Tjerk Meesters) + . Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey) . Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters) - PDO_pgsql: diff --git a/Zend/RFCs/003.txt b/Zend/RFCs/003.txt index 30fb4cec4912f..ac042183d426c 100644 --- a/Zend/RFCs/003.txt +++ b/Zend/RFCs/003.txt @@ -9,11 +9,11 @@ Modified: 2001-09-17 1. Background/Need ================== -Many internal function of PHP will reject parameters because of their +Many internal functions of PHP will reject parameters because of their type (the array and variable function come to mind). For userland this is not an easy task as there is no uniform way to do it. An addition to the engine for requiring loose types would allow -delevopers to know that the data passed to their functions is of the +developers to know that the data passed to their functions are of the correct type and reduce the need for duplicating the same code in every function to check for the type of data. @@ -57,7 +57,7 @@ function foo (array $var){ =========== Mis-matches in type should be reported as fatal errors and should halt -the execution of a script as that function can not be run and code +the execution of a script as that function cannot be run and code following could not reliably run. diff --git a/Zend/zend.c b/Zend/zend.c index b98d264a3c050..a5ed953cd0de0 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -921,7 +921,9 @@ ZEND_API char *get_zend_version(void) /* {{{ */ void zend_activate(TSRMLS_D) /* {{{ */ { +#ifdef ZTS virtual_cwd_activate(TSRMLS_C); +#endif gc_reset(TSRMLS_C); init_compiler(TSRMLS_C); init_executor(TSRMLS_C); diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 75bf3d252280d..d9da5cf4c0c8e 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -127,7 +127,6 @@ static int php_check_dots(const char *element, int n) #define TOKENIZER_STRING "/" #endif - /* default macros */ #ifndef IS_DIRECTORY_UP @@ -154,8 +153,17 @@ static int php_check_dots(const char *element, int n) memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1); #define CWD_STATE_FREE(s) \ - efree((s)->cwd); \ - (s)->cwd = NULL; + efree((s)->cwd); + +#ifdef TSRM_WIN32 +# define CWD_STATE_FREE_ERR(state) do { \ + DWORD last_error = GetLastError(); \ + CWD_STATE_FREE(state); \ + SetLastError(last_error); \ + } while (0) +#else +# define CWD_STATE_FREE_ERR(state) CWD_STATE_FREE(state) +#endif #ifdef TSRM_WIN32 @@ -426,13 +434,11 @@ static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */ cwd_g->realpath_cache_size_limit = REALPATH_CACHE_SIZE; cwd_g->realpath_cache_ttl = REALPATH_CACHE_TTL; memset(cwd_g->realpath_cache, 0, sizeof(cwd_g->realpath_cache)); - virtual_cwd_activate(TSRMLS_C); } /* }}} */ static void cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */ { -/* CWD_STATE_FREE(&cwd_globals->cwd); */ realpath_cache_clean(TSRMLS_C); } /* }}} */ @@ -506,6 +512,7 @@ CWD_API int virtual_cwd_deactivate(TSRMLS_D) /* {{{ */ { if (CWDG(cwd).cwd != NULL) { CWD_STATE_FREE(&CWDG(cwd)); + CWDG(cwd).cwd = NULL; } return 0; } @@ -1488,9 +1495,6 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ { cwd_state new_state; FILE *f; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif if (path[0] == '\0') { /* Fail to open empty path */ return NULL; @@ -1498,25 +1502,14 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return NULL; } f = fopen(new_state.cwd, mode); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); + return f; } /* }}} */ @@ -1525,33 +1518,20 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */ { cwd_state new_state; int ret; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } #if defined(TSRM_WIN32) ret = tsrm_win32_access(new_state.cwd, mode TSRMLS_CC); - last_error = GetLastError(); #else ret = access(new_state.cwd, mode); #endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return ret; } @@ -1611,33 +1591,20 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) / { cwd_state new_state; int ret; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } #ifdef TSRM_WIN32 ret = win32_utime(new_state.cwd, buf); - last_error = GetLastError(); #else ret = utime(new_state.cwd, buf); #endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return ret; } /* }}} */ @@ -1647,31 +1614,16 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */ { cwd_state new_state; int ret; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } ret = chmod(new_state.cwd, mode); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return ret; } /* }}} */ @@ -1681,19 +1633,10 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li { cwd_state new_state; int ret; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } @@ -1707,13 +1650,7 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li ret = chown(new_state.cwd, owner, group); } -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return ret; } /* }}} */ @@ -1723,19 +1660,10 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */ { cwd_state new_state; int f; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } @@ -1751,13 +1679,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */ } else { f = open(new_state.cwd, flags); } -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return f; } /* }}} */ @@ -1766,31 +1688,16 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */ { cwd_state new_state; int f; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } f = creat(new_state.cwd, mode); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return f; } /* }}} */ @@ -1800,33 +1707,18 @@ CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) / cwd_state old_state; cwd_state new_state; int retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&old_state, &CWDG(cwd)); if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&old_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&old_state); return -1; } oldname = old_state.cwd; CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&old_state); - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&old_state); + CWD_STATE_FREE_ERR(&new_state); return -1; } newname = new_state.cwd; @@ -1836,17 +1728,12 @@ CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) / #ifdef TSRM_WIN32 /* MoveFileEx returns 0 on failure, other way 'round for this function */ retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0; - last_error = GetLastError(); #else retval = rename(oldname, newname); #endif - CWD_STATE_FREE(&old_state); - CWD_STATE_FREE(&new_state); - -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&old_state); + CWD_STATE_FREE_ERR(&new_state); return retval; } @@ -1856,31 +1743,16 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */ { cwd_state new_state; int retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } retval = php_sys_stat(new_state.cwd, buf); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return retval; } /* }}} */ @@ -1889,31 +1761,16 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ * { cwd_state new_state; int retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } retval = php_sys_lstat(new_state.cwd, buf); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return retval; } /* }}} */ @@ -1922,31 +1779,16 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */ { cwd_state new_state; int retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } retval = unlink(new_state.cwd); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return retval; } /* }}} */ @@ -1955,32 +1797,19 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */ { cwd_state new_state; int retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } #ifdef TSRM_WIN32 retval = mkdir(new_state.cwd); - last_error = GetLastError(); #else retval = mkdir(new_state.cwd, mode); #endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return retval; } /* }}} */ @@ -1989,31 +1818,16 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */ { cwd_state new_state; int retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return -1; } retval = rmdir(new_state.cwd); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return retval; } /* }}} */ @@ -2026,31 +1840,16 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */ { cwd_state new_state; DIR *retval; -#ifdef TSRM_WIN32 - DWORD last_error; -#endif CWD_STATE_COPY(&new_state, &CWDG(cwd)); if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return NULL; } retval = opendir(new_state.cwd); -#ifdef TSRM_WIN32 - last_error = GetLastError(); -#endif - CWD_STATE_FREE(&new_state); -#ifdef TSRM_WIN32 - SetLastError(last_error); -#endif + CWD_STATE_FREE_ERR(&new_state); return retval; } /* }}} */ diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index e95f898c156f7..d50b78321fb89 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -67,6 +67,9 @@ #include #endif +#define PHP_LDAP_ESCAPE_FILTER 0x01 +#define PHP_LDAP_ESCAPE_DN 0x02 + typedef struct { LDAP *link; #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) @@ -195,6 +198,9 @@ PHP_MINIT_FUNCTION(ldap) REGISTER_LONG_CONSTANT("GSLC_SSL_TWOWAY_AUTH", GSLC_SSL_TWOWAY_AUTH, CONST_PERSISTENT | CONST_CS); #endif + REGISTER_LONG_CONSTANT("LDAP_ESCAPE_FILTER", PHP_LDAP_ESCAPE_FILTER, CONST_PERSISTENT | CONST_CS); + REGISTER_LONG_CONSTANT("LDAP_ESCAPE_DN", PHP_LDAP_ESCAPE_DN, CONST_PERSISTENT | CONST_CS); + le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, "ldap link", module_number); le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, "ldap result", module_number); le_result_entry = zend_register_list_destructors_ex(_free_ldap_result_entry, NULL, "ldap result entry", module_number); @@ -2137,6 +2143,83 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* }}} */ #endif +static void php_ldap_do_escape(const zend_bool *map, const char *value, size_t valuelen, char **result, size_t *resultlen) +{ + char hex[] = "0123456789abcdef"; + int i, p = 0; + size_t len = 0; + + for (i = 0; i < valuelen; i++) { + len += (map[(unsigned char) value[i]]) ? 3 : 1; + } + + (*result) = (char *) safe_emalloc(1, len, 1); + (*resultlen) = len; + + for (i = 0; i < valuelen; i++) { + unsigned char v = (unsigned char) value[i]; + + if (map[v]) { + (*result)[p++] = '\\'; + (*result)[p++] = hex[v >> 4]; + (*result)[p++] = hex[v & 0x0f]; + } else { + (*result)[p++] = v; + } + } + + (*result)[p++] = '\0'; +} + +static void php_ldap_escape_map_set_chars(zend_bool *map, const char *chars, const int charslen, char escape) +{ + int i = 0; + while (i < charslen) { + map[(unsigned char) chars[i++]] = escape; + } +} + +PHP_FUNCTION(ldap_escape) +{ + char *value, *ignores, *result; + int valuelen = 0, ignoreslen = 0, i; + size_t resultlen; + long flags = 0; + zend_bool map[256] = {0}, havecharlist = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) { + return; + } + + if (!valuelen) { + RETURN_EMPTY_STRING(); + } + + if (flags & PHP_LDAP_ESCAPE_FILTER) { + havecharlist = 1; + php_ldap_escape_map_set_chars(map, "\\*()\0", sizeof("\\*()\0") - 1, 1); + } + + if (flags & PHP_LDAP_ESCAPE_DN) { + havecharlist = 1; + php_ldap_escape_map_set_chars(map, "\\,=+<>;\"#", sizeof("\\,=+<>;\"#") - 1, 1); + } + + if (!havecharlist) { + for (i = 0; i < 256; i++) { + map[i] = 1; + } + } + + if (ignoreslen) { + php_ldap_escape_map_set_chars(map, ignores, ignoreslen, 0); + } + + php_ldap_do_escape(map, value, valuelen, &result, &resultlen); + + RETURN_STRINGL(result, resultlen, 0); +} + #ifdef STR_TRANSLATION /* {{{ php_ldap_do_translate */ @@ -2626,6 +2709,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_set_rebind_proc, 0, 0, 2) ZEND_END_ARG_INFO() #endif +ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_escape, 0, 0, 1) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, ignore) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + #ifdef STR_TRANSLATION ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_t61_to_8859, 0, 0, 1) ZEND_ARG_INFO(0, value) @@ -2704,6 +2793,8 @@ const zend_function_entry ldap_functions[] = { PHP_FE(ldap_set_rebind_proc, arginfo_ldap_set_rebind_proc) #endif + PHP_FE(ldap_escape, arginfo_ldap_escape) + #ifdef STR_TRANSLATION PHP_FE(ldap_t61_to_8859, arginfo_ldap_t61_to_8859) PHP_FE(ldap_8859_to_t61, arginfo_ldap_8859_to_t61) diff --git a/ext/ldap/tests/ldap_escape_all.phpt b/ext/ldap/tests/ldap_escape_all.phpt new file mode 100644 index 0000000000000..a79be004ffe56 --- /dev/null +++ b/ext/ldap/tests/ldap_escape_all.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test all +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(39) "\66\6f\6f\3d\62\61\72\28\62\61\7a\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_both.phpt b/ext/ldap/tests/ldap_escape_both.phpt new file mode 100644 index 0000000000000..2169c0ad2e75c --- /dev/null +++ b/ext/ldap/tests/ldap_escape_both.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test filter and DN +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(21) "foo\3dbar\28baz\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_dn.phpt b/ext/ldap/tests/ldap_escape_dn.phpt new file mode 100644 index 0000000000000..fbcb0545ae4e8 --- /dev/null +++ b/ext/ldap/tests/ldap_escape_dn.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test DN +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(15) "foo\3dbar(baz)*" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_filter.phpt b/ext/ldap/tests/ldap_escape_filter.phpt new file mode 100644 index 0000000000000..e4540a452d3f6 --- /dev/null +++ b/ext/ldap/tests/ldap_escape_filter.phpt @@ -0,0 +1,14 @@ +--TEST-- +ldap_escape() test filter +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(19) "foo=bar\28baz\29\2a" \ No newline at end of file diff --git a/ext/ldap/tests/ldap_escape_ignore.phpt b/ext/ldap/tests/ldap_escape_ignore.phpt new file mode 100644 index 0000000000000..ab56aa2d0e91f --- /dev/null +++ b/ext/ldap/tests/ldap_escape_ignore.phpt @@ -0,0 +1,15 @@ +--TEST-- +ldap_escape() test ignore +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(31) "\66oo\3d\62a\72\28\62a\7a\29\2a" \ No newline at end of file diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 7eccd9d8f9950..b180b0d5f0bdc 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -58,13 +58,12 @@ libraries are available. PHP -Bump mininum requirements for PHP OCI8 2.0 to PHP 5.2 and Oracle -client library 10.2 (Note this will connect to Oracle Database 8.1.7 -onwards). Use the older OCI8 1.4 if an earlier PHP version or older -Oracle client library support is necessary. +Bump PHP OCI8 2.0 mininum requirements to PHP 5.2 and Oracle client +library 10.2. (Use OCI8 1.4 for older PHP version support or if only +Oracle 9.2 client libraries are available.) Re-enable php_oci8.dll and php_oci8_11g.dll for Windows builds so URL -linking works in the new Windows PECL infrastructure. +links work in the new Windows PECL infrastructure. @@ -277,6 +276,7 @@ linking works in the new Windows PECL infrastructure. + diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 1ea0411073e2e..ee8d83122114f 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -41,12 +41,11 @@ */ #ifdef PHP_OCI8_VERSION /* The definition of PHP_OCI8_VERSION changed in PHP 5.3 and building - * this code with PHP 5.2 and earlier (e.g. when using OCI8 from PECL) - * will conflict. + * this code with PHP 5.2 (e.g. when using OCI8 from PECL) will conflict. */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.0.5-dev" +#define PHP_OCI8_VERSION "2.0.5" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index a52ade0e5ce17..7cf637c7f6cbd 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1183,6 +1183,10 @@ PHP_MINIT_FUNCTION(openssl) php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC); #endif php_stream_xport_register("tls", php_openssl_ssl_socket_factory TSRMLS_CC); +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + php_stream_xport_register("tlsv1.1", php_openssl_ssl_socket_factory TSRMLS_CC); + php_stream_xport_register("tlsv1.2", php_openssl_ssl_socket_factory TSRMLS_CC); +#endif /* override the default tcp socket provider */ php_stream_xport_register("tcp", php_openssl_ssl_socket_factory TSRMLS_CC); @@ -1221,6 +1225,10 @@ PHP_MSHUTDOWN_FUNCTION(openssl) #endif php_stream_xport_unregister("sslv3" TSRMLS_CC); php_stream_xport_unregister("tls" TSRMLS_CC); +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + php_stream_xport_unregister("tlsv1.1" TSRMLS_CC); + php_stream_xport_unregister("tlsv1.2" TSRMLS_CC); +#endif /* reinstate the default tcp handler */ php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC); @@ -1602,7 +1610,7 @@ PHP_FUNCTION(openssl_spki_export_challenge) goto cleanup; } - RETVAL_STRING(ASN1_STRING_data(spki->spkac->challenge), 1); + RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge), 1); goto cleanup; cleanup: @@ -1676,7 +1684,7 @@ static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_boo { unsigned char md[EVP_MAX_MD_SIZE]; const EVP_MD *mdtype; - int n; + unsigned int n; if (!(mdtype = EVP_get_digestbyname(method))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm"); @@ -1688,7 +1696,7 @@ static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_boo if (raw) { *out_len = n; - *out = estrndup(md, n); + *out = estrndup((char *) md, n); } else { *out_len = n * 2; *out = emalloc(*out_len + 1); @@ -4916,14 +4924,12 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */ { php_stream *stream; SSL *ssl; - X509 *err_cert; int err, depth, ret; zval **val; ret = preverify_ok; /* determine the status for the current cert */ - err_cert = X509_STORE_CTX_get_current_cert(ctx); err = X509_STORE_CTX_get_error(ctx); depth = X509_STORE_CTX_get_error_depth(ctx); @@ -4997,7 +5003,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name) if (GEN_DNS == san->type) { ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName); - is_match = matches_wildcard_name(subject_name, cert_name); + is_match = matches_wildcard_name(subject_name, (char *) cert_name); OPENSSL_free(cert_name); } diff --git a/ext/openssl/tests/streams_crypto_method.phpt b/ext/openssl/tests/streams_crypto_method.phpt index 7ac195bfb6ad9..97a6e9ee8ba85 100644 --- a/ext/openssl/tests/streams_crypto_method.phpt +++ b/ext/openssl/tests/streams_crypto_method.phpt @@ -19,13 +19,13 @@ function client($port, $method) { } function server($port, $transport) { - $context = stream_context_create(); + $context = stream_context_create(); - stream_context_set_option($context, 'ssl', 'local_cert', dirname(__FILE__) . '/streams_crypto_method.pem'); - stream_context_set_option($context, 'ssl', 'allow_self_signed', true); - stream_context_set_option($context, 'ssl', 'verify_peer', false); + stream_context_set_option($context, 'ssl', 'local_cert', dirname(__FILE__) . '/streams_crypto_method.pem'); + stream_context_set_option($context, 'ssl', 'allow_self_signed', true); + stream_context_set_option($context, 'ssl', 'verify_peer', false); - $server = stream_socket_server($transport . '127.0.0.1:' . $port, $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context); + $server = stream_socket_server($transport . '127.0.0.1:' . $port, $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context); $client = @stream_socket_accept($server); diff --git a/ext/openssl/tests/tlsv1.1_wrapper_001.phpt b/ext/openssl/tests/tlsv1.1_wrapper_001.phpt new file mode 100644 index 0000000000000..56211f0b965e0 --- /dev/null +++ b/ext/openssl/tests/tlsv1.1_wrapper_001.phpt @@ -0,0 +1,46 @@ +--TEST-- +tlsv1.1 stream wrapper +--SKIPIF-- + array( + 'local_cert' => __DIR__ . '/streams_crypto_method.pem', +))); + +$server = stream_socket_server('tlsv1.1://127.0.0.1:64321', $errno, $errstr, $flags, $ctx); +var_dump($server); + +$pid = pcntl_fork(); +if ($pid == -1) { + die('could not fork'); +} elseif ($pid) { + $flags = STREAM_CLIENT_CONNECT; + $ctx = stream_context_create(array('ssl' => array( + 'verify_peer' => false + ))); + + $client = stream_socket_client("tlsv1.1://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("sslv3://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("tlsv1.2://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + +} else { + @pcntl_wait($status); + for ($i=0; $i < 3; $i++) { + @stream_socket_accept($server, 1); + } +} +--EXPECTF-- +resource(%d) of type (stream) +resource(%d) of type (stream) +bool(false) +bool(false) diff --git a/ext/openssl/tests/tlsv1.2_wrapper_002.phpt b/ext/openssl/tests/tlsv1.2_wrapper_002.phpt new file mode 100644 index 0000000000000..cb3f4106c727e --- /dev/null +++ b/ext/openssl/tests/tlsv1.2_wrapper_002.phpt @@ -0,0 +1,46 @@ +--TEST-- +tlsv1.2 stream wrapper +--SKIPIF-- + array( + 'local_cert' => __DIR__ . '/streams_crypto_method.pem', +))); + +$server = stream_socket_server('tlsv1.2://127.0.0.1:64321', $errno, $errstr, $flags, $ctx); +var_dump($server); + +$pid = pcntl_fork(); +if ($pid == -1) { + die('could not fork'); +} elseif ($pid) { + $flags = STREAM_CLIENT_CONNECT; + $ctx = stream_context_create(array('ssl' => array( + 'verify_peer' => false + ))); + + $client = stream_socket_client("tlsv1.2://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("sslv3://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + + $client = @stream_socket_client("tlsv1.1://127.0.0.1:64321", $errno, $errstr, 1, $flags, $ctx); + var_dump($client); + +} else { + @pcntl_wait($status); + for ($i=0; $i < 3; $i++) { + @stream_socket_accept($server, 1); + } +} +--EXPECTF-- +resource(%d) of type (stream) +resource(%d) of type (stream) +bool(false) +bool(false) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 1ac8a0220e3a0..2e7f0cdc3f676 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -346,6 +346,24 @@ static inline int php_openssl_setup_crypto(php_stream *stream, sslsock->is_client = 1; method = TLSv1_client_method(); break; + case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 1; + method = TLSv1_1_client_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif + case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 1; + method = TLSv1_2_client_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif case STREAM_CRYPTO_METHOD_SSLv23_SERVER: sslsock->is_client = 0; method = SSLv23_server_method(); @@ -367,6 +385,24 @@ static inline int php_openssl_setup_crypto(php_stream *stream, sslsock->is_client = 0; method = TLSv1_server_method(); break; + case STREAM_CRYPTO_METHOD_TLSv1_1_SERVER: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 0; + method = TLSv1_1_server_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif + case STREAM_CRYPTO_METHOD_TLSv1_2_SERVER: +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->is_client = 0; + method = TLSv1_2_server_method(); + break; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); + return -1; +#endif default: return -1; @@ -667,6 +703,12 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_ case STREAM_CRYPTO_METHOD_TLS_CLIENT: sock->method = STREAM_CRYPTO_METHOD_TLS_SERVER; break; + case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT: + sock->method = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; + break; + case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT: + sock->method = STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; + break; default: break; } @@ -867,6 +909,8 @@ static int get_crypto_method(php_stream_context *ctx) { case STREAM_CRYPTO_METHOD_SSLv3_CLIENT: case STREAM_CRYPTO_METHOD_SSLv23_CLIENT: case STREAM_CRYPTO_METHOD_TLS_CLIENT: + case STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT: + case STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT: return crypto_method; } @@ -877,7 +921,6 @@ static int get_crypto_method(php_stream_context *ctx) { } static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC) { - php_url *url; if (ctx) { @@ -982,8 +1025,24 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen, } else if (strncmp(proto, "tls", protolen) == 0) { sslsock->enable_on_connect = 1; sslsock->method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + } else if (strncmp(proto, "tlsv1.1", protolen) == 0) { +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->enable_on_connect = 1; + sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); + return NULL; +#endif + } else if (strncmp(proto, "tlsv1.2", protolen) == 0) { +#if OPENSSL_VERSION_NUMBER >= 0x10001001L + sslsock->enable_on_connect = 1; + sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; +#else + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); + return NULL; +#endif } - + return stream; } diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h index 4146e28f770da..f8325d0c635e3 100644 --- a/ext/phar/php_phar.h +++ b/ext/phar/php_phar.h @@ -34,7 +34,6 @@ extern zend_module_entry phar_module_entry; #define PHP_PHAR_API PHPAPI #endif -#define PHAR_HAVE_RESOLVE_ALIAS PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC); #endif /* PHP_PHAR_H */ diff --git a/ext/phar/util.c b/ext/phar/util.c index 697c35767dfa9..dfb2c92f9ec52 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -932,9 +932,9 @@ PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, if (SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len, (void**)&fd_ptr)) { *filename = (*fd_ptr)->fname; *filename_len = (*fd_ptr)->fname_len; - return 1; + return SUCCESS; } - return 0; + return FAILURE; } /* }}} */ diff --git a/ext/standard/file.c b/ext/standard/file.c index 1ec6a74f3f0b5..2bd35bf8941ae 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -223,10 +223,14 @@ PHP_MINIT_FUNCTION(file) REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT", STREAM_CRYPTO_METHOD_SSLv3_CLIENT, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_CLIENT", STREAM_CRYPTO_METHOD_SSLv23_CLIENT, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_CLIENT", STREAM_CRYPTO_METHOD_TLS_CLIENT, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT", STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_SERVER", STREAM_CRYPTO_METHOD_SSLv2_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_SERVER", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_SERVER", STREAM_CRYPTO_METHOD_SSLv23_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_SERVER", STREAM_CRYPTO_METHOD_TLS_SERVER, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_1_SERVER", STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLSv1_2_SERVER", STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_SHUT_RD", STREAM_SHUT_RD, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("STREAM_SHUT_WR", STREAM_SHUT_WR, CONST_CS|CONST_PERSISTENT); diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index bfa1db9397f34..bff30d9043077 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -33,7 +33,7 @@ echo "\n Free Space after writing to a file\n"; $space2 = disk_free_space($file_path.$dir); var_dump( $space2 ); -if( $space1 > $space2 ) +if(getenv('TRAVIS') === 'true' || $space1 > $space2 ) echo "\n Free Space Value Is Correct\n"; else { echo "\n Free Space Value Is Incorrect\n"; diff --git a/main/main.c b/main/main.c index 2d018a74670fb..f2bf878426cb0 100644 --- a/main/main.c +++ b/main/main.c @@ -2412,13 +2412,14 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) volatile int old_cwd_fd = -1; #else char *old_cwd; + ALLOCA_FLAG(use_heap) #endif int retval = 0; EG(exit_status) = 0; #ifndef HAVE_BROKEN_GETCWD # define OLD_CWD_SIZE 4096 - old_cwd = emalloc(OLD_CWD_SIZE); + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); old_cwd[0] = '\0'; #endif @@ -2499,7 +2500,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) if (old_cwd[0] != '\0') { php_ignore_value(VCWD_CHDIR(old_cwd)); } - efree(old_cwd); + free_alloca(old_cwd, use_heap); #endif return retval; } @@ -2510,10 +2511,11 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC) { char *old_cwd; + ALLOCA_FLAG(use_heap) EG(exit_status) = 0; #define OLD_CWD_SIZE 4096 - old_cwd = emalloc(OLD_CWD_SIZE); + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); old_cwd[0] = '\0'; zend_try { @@ -2536,7 +2538,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret php_ignore_value(VCWD_CHDIR(old_cwd)); } - efree(old_cwd); + free_alloca(old_cwd, use_heap); return EG(exit_status); } /* }}} */ diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 52df73d731a44..15ba09430f981 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -170,10 +170,14 @@ typedef enum { STREAM_CRYPTO_METHOD_SSLv3_CLIENT, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, STREAM_CRYPTO_METHOD_TLS_CLIENT, + STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT, + STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT, STREAM_CRYPTO_METHOD_SSLv2_SERVER, STREAM_CRYPTO_METHOD_SSLv3_SERVER, STREAM_CRYPTO_METHOD_SSLv23_SERVER, - STREAM_CRYPTO_METHOD_TLS_SERVER + STREAM_CRYPTO_METHOD_TLS_SERVER, + STREAM_CRYPTO_METHOD_TLSv1_1_SERVER, + STREAM_CRYPTO_METHOD_TLSv1_2_SERVER } php_stream_xport_crypt_method_t; BEGIN_EXTERN_C()