diff options
author | Anatol Belski <ab@php.net> | 2014-07-01 09:10:36 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-07-01 09:10:36 +0200 |
commit | 1a50c27f998769c5b3472d35c39852286900db69 (patch) | |
tree | 3c83075a87d566d3d2cac23523ce3f737805aa32 /ext/openssl/openssl.c | |
parent | d4cfc15514285d42f113facc1c296d32a818ccf2 (diff) | |
parent | 2330be5641c907b7edd7cffdd3074e85d0091df5 (diff) | |
download | php-git-1a50c27f998769c5b3472d35c39852286900db69.tar.gz |
Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (170 commits)
Fixed possible crash because of race conditions on modifying constants in shared memory
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
Revert "Fix Bug #67530 error_log=syslog ignored"
--enable-fpm for the travis build
fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
NEWS
NEWS
Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
adding NEWS entry for the fix for bug #65641
Updated NEWS file for recent phpdbg fixes
Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
Fixed test
Inform about back command existence in help - Fixes krakjoe/phpdbg#100 No way to list the current stack/frames
Fix issue krakjoe/phpdbg#98 break if does not seem to work
Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
Fix readline/libedit (Thanks to @remicollet)
Replace incorrect `E` command with `ev` in watch help
...
Conflicts:
Zend/zend_compile.c
ext/standard/basic_functions.c
ext/standard/http_fopen_wrapper.c
ext/standard/var.c
ext/tokenizer/tokenizer_data.c
sapi/phpdbg/phpdbg_list.c
Diffstat (limited to 'ext/openssl/openssl.c')
-rw-r--r-- | ext/openssl/openssl.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 8cea4a3a8d..9db641b475 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -710,7 +710,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ char * thestr; long gmadjust = 0; - if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME) { + if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME && ASN1_STRING_type(timestr) != V_ASN1_GENERALIZEDTIME) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal ASN1 data type for timestamp"); return (time_t)-1; } @@ -725,6 +725,11 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ return (time_t)-1; } + if (ASN1_STRING_type(timestr) == V_ASN1_GENERALIZEDTIME && ASN1_STRING_length(timestr) < 15) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data); + return (time_t)-1; + } + strbuf = estrdup((char *)ASN1_STRING_data(timestr)); memset(&thetime, 0, sizeof(thetime)); @@ -746,14 +751,21 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ *thestr = '\0'; thestr -= 2; thetime.tm_mon = atoi(thestr)-1; + *thestr = '\0'; - thestr -= 2; - thetime.tm_year = atoi(thestr); + if( ASN1_STRING_type(timestr) == V_ASN1_UTCTIME ) { + thestr -= 2; + thetime.tm_year = atoi(thestr); - if (thetime.tm_year < 68) { - thetime.tm_year += 100; + if (thetime.tm_year < 68) { + thetime.tm_year += 100; + } + } else if( ASN1_STRING_type(timestr) == V_ASN1_GENERALIZEDTIME ) { + thestr -= 4; + thetime.tm_year = atoi(thestr) - 1900; } + thetime.tm_isdst = -1; ret = mktime(&thetime); |