diff options
author | Remi Collet <remi@remirepo.net> | 2024-10-08 10:43:15 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-10-08 10:43:15 +0200 |
commit | d256a74edfec7568501fd18e0060f7545124441a (patch) | |
tree | 5aca2ed2fd008173248ddf7d7b779976352639f1 | |
parent | 9d6b2d38a22e0302b9f7ce697fbb29f1aa4130f2 (diff) |
drop patches merged upstream
-rw-r--r-- | 0001-restore-7.0-compatibility.patch | 28 | ||||
-rw-r--r-- | PHPINFO | 2 | ||||
-rw-r--r-- | REFLECTION | 103 | ||||
-rw-r--r-- | oauth-pcre.patch | 23 | ||||
-rw-r--r-- | oauth-php82.patch | 85 | ||||
-rw-r--r-- | oauth-php84.patch | 100 | ||||
-rw-r--r-- | php-pecl-oauth.spec | 19 |
7 files changed, 107 insertions, 253 deletions
diff --git a/0001-restore-7.0-compatibility.patch b/0001-restore-7.0-compatibility.patch new file mode 100644 index 0000000..766e600 --- /dev/null +++ b/0001-restore-7.0-compatibility.patch @@ -0,0 +1,28 @@ +From 70f260f6e395af7c6061e2b07ea91b85b28532f1 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@php.net> +Date: Tue, 8 Oct 2024 10:31:48 +0200 +Subject: [PATCH] restore 7.0 compatibility + +--- + provider.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/provider.c b/provider.c +index f1f8e2a..5f988b5 100644 +--- a/provider.c ++++ b/provider.c +@@ -960,7 +960,11 @@ SOP_METHOD(generateToken) + php_error_docref(NULL, E_WARNING, "Could not gather enough random data, falling back on rand()"); + } + while (reaped < size) { ++#if PHP_VERSION_ID < 70100 ++ iv[reaped++] = (char) (255.0 * php_rand() / RAND_MAX); ++#else + iv[reaped++] = (char)php_mt_rand_range(0, 255); ++#endif + } + } + +-- +2.46.2 + @@ -6,4 +6,4 @@ PLAINTEXT support => enabled RSA-SHA1 support => enabled HMAC-SHA1 support => enabled Request engine support => php_streams, curl -version => 2.0.7 +version => 2.0.9 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { +Extension [ <persistent> extension #88 OAuth version 2.0.9 ] { - Constants [32] { Constant [ string OAUTH_SIG_METHOD_HMACSHA1 ] { HMAC-SHA1 } @@ -47,7 +47,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [3] { Parameter #0 [ <required> $http_method ] Parameter #1 [ <required> $uri ] - Parameter #2 [ <required> $parameters ] + Parameter #2 [ <optional> $parameters = <default> ] } } } @@ -65,9 +65,9 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { } - Properties [3] { - Property [ <default> public $debug ] - Property [ <default> public $sslChecks ] - Property [ <default> public $debugInfo ] + Property [ public $debug = 0 ] + Property [ public $sslChecks = 1 ] + Property [ public $debugInfo = '' ] } - Methods [26] { @@ -76,8 +76,8 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [4] { Parameter #0 [ <required> $consumer_key ] Parameter #1 [ <required> $consumer_secret ] - Parameter #2 [ <optional> $signature_method ] - Parameter #3 [ <optional> $auth_type ] + Parameter #2 [ <optional> $signature_method = <default> ] + Parameter #3 [ <optional> $auth_type = <default> ] } } @@ -90,18 +90,20 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { Method [ <internal:OAuth> public method getRequestToken ] { - - Parameters [2] { + - Parameters [3] { Parameter #0 [ <required> $request_token_url ] - Parameter #1 [ <optional> $callback_url ] + Parameter #1 [ <optional> $callback_url = <default> ] + Parameter #2 [ <optional> $http_method = <default> ] } } Method [ <internal:OAuth> public method getAccessToken ] { - - Parameters [3] { + - Parameters [4] { Parameter #0 [ <required> $access_token_url ] - Parameter #1 [ <optional> $auth_session_handle ] - Parameter #2 [ <optional> $auth_verifier ] + Parameter #1 [ <optional> $auth_session_handle = <default> ] + Parameter #2 [ <optional> $auth_verifier = <default> ] + Parameter #3 [ <optional> $http_method = <default> ] } } @@ -170,9 +172,9 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [4] { Parameter #0 [ <required> $protected_resource_url ] - Parameter #1 [ <optional> $extra_parameters ] - Parameter #2 [ <optional> $http_method ] - Parameter #3 [ <optional> $request_headers ] + Parameter #1 [ <optional> $extra_parameters = <default> ] + Parameter #2 [ <optional> $http_method = <default> ] + Parameter #3 [ <optional> $request_headers = <default> ] } } @@ -231,7 +233,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [3] { Parameter #0 [ <required> $http_method ] Parameter #1 [ <required> $url ] - Parameter #2 [ <optional> $extra_parameters ] + Parameter #2 [ <optional> $extra_parameters = <default> ] } } @@ -254,13 +256,13 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [3] { Parameter #0 [ <required> $http_method ] Parameter #1 [ <required> $url ] - Parameter #2 [ <optional> $extra_parameters ] + Parameter #2 [ <optional> $extra_parameters = <default> ] } } } } - Class [ <internal:OAuth> class OAuthException extends Exception implements Throwable ] { + Class [ <internal:OAuth> class OAuthException extends Exception implements Throwable, Stringable ] { - Constants [0] { } @@ -272,49 +274,84 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { } - Properties [6] { - Property [ <default> protected $message ] - Property [ <default> protected $code ] - Property [ <default> protected $file ] - Property [ <default> protected $line ] - Property [ <default> public $lastResponse ] - Property [ <default> public $debugInfo ] + Property [ protected $message = '' ] + Property [ protected $code = 0 ] + Property [ protected string $file = '' ] + Property [ protected int $line = 0 ] + Property [ public $lastResponse = NULL ] + Property [ public $debugInfo = NULL ] } - Methods [10] { Method [ <internal:Core, inherits Exception, ctor> public method __construct ] { - Parameters [3] { - Parameter #0 [ <optional> $message ] - Parameter #1 [ <optional> $code ] - Parameter #2 [ <optional> $previous ] + Parameter #0 [ <optional> string $message = "" ] + Parameter #1 [ <optional> int $code = 0 ] + Parameter #2 [ <optional> ?Throwable $previous = null ] } } Method [ <internal:Core, inherits Exception> public method __wakeup ] { + + - Parameters [0] { + } + - Tentative return [ void ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] { + + - Parameters [0] { + } + - Return [ string ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] { + + - Parameters [0] { + } } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] { + + - Parameters [0] { + } + - Return [ string ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] { + + - Parameters [0] { + } + - Return [ int ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] { + + - Parameters [0] { + } + - Return [ array ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] { + + - Parameters [0] { + } + - Return [ ?Throwable ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] { + + - Parameters [0] { + } + - Return [ string ] } - Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] { + Method [ <internal:Core, inherits Exception, prototype Stringable> public method __toString ] { + + - Parameters [0] { + } + - Return [ string ] } } } @@ -339,7 +376,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [2] { Parameter #0 [ <required> $size ] - Parameter #1 [ <optional> $strong ] + Parameter #1 [ <optional> $strong = <default> ] } } } @@ -351,7 +388,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { Method [ <internal:OAuth, ctor> public method __construct ] { - Parameters [1] { - Parameter #0 [ <optional> $params_array ] + Parameter #0 [ <optional> $params_array = <default> ] } } @@ -397,8 +434,8 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { Method [ <internal:OAuth> public method checkOAuthRequest ] { - Parameters [2] { - Parameter #0 [ <optional> $uri ] - Parameter #1 [ <optional> $method ] + Parameter #0 [ <optional> $uri = <default> ] + Parameter #1 [ <optional> $method = <default> ] } } @@ -427,7 +464,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] { - Parameters [2] { Parameter #0 [ <required> $param_key ] - Parameter #1 [ <optional> $param_val ] + Parameter #1 [ <optional> $param_val = <default> ] } } diff --git a/oauth-pcre.patch b/oauth-pcre.patch deleted file mode 100644 index 31635ca..0000000 --- a/oauth-pcre.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 2e02631fa424639b10d105ff47e9cf650403cef7 Mon Sep 17 00:00:00 2001 -From: Andy Postnikov <apostnikov@gmail.com> -Date: Fri, 18 Sep 2020 16:22:33 +0300 -Subject: [PATCH] Remove pcre.h dependency - -PHP using pcre2 and I see no usage of pcre 1 ---- - config.m4 | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/config.m4 b/config.m4 -index f4a6899..2adf937 100644 ---- a/config.m4 -+++ b/config.m4 -@@ -10,8 +10,6 @@ if test "$PHP_OAUTH" != "no"; then - PHP_NEW_EXTENSION(oauth, oauth.c provider.c, $ext_shared) - CFLAGS="$CFLAGS -Wall -g" - -- AC_CHECK_HEADER(pcre.h, , [AC_MSG_ERROR([Couldn't find pcre.h, try installing the libpcre development/headers package])]) -- - AS_IF([test "x$with_curl" != "xno"], - [ - AC_MSG_CHECKING(for cURL in default path) diff --git a/oauth-php82.patch b/oauth-php82.patch deleted file mode 100644 index ad8eb4a..0000000 --- a/oauth-php82.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 66e8e9cf9805c96dd9aa6a7c08ec0da5c2c6b656 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@php.net> -Date: Fri, 9 Sep 2022 14:03:57 +0200 -Subject: [PATCH] fix for php 8.2: declare used properties - ---- - oauth.c | 1 + - provider.c | 13 +++++++++++++ - tests/oauthprovider_001.phpt | 12 ++++++++---- - 3 files changed, 22 insertions(+), 4 deletions(-) - -diff --git a/oauth.c b/oauth.c -index f845893..46eccda 100644 ---- a/oauth.c -+++ b/oauth.c -@@ -2781,6 +2781,7 @@ PHP_MINIT_FUNCTION(oauth) - soo_exception_ce = zend_register_internal_class_ex(&soo_ex_ce, zend_exception_get_default()); - zend_declare_property_null(soo_exception_ce, "lastResponse", sizeof("lastResponse")-1, ZEND_ACC_PUBLIC); - zend_declare_property_null(soo_exception_ce, "debugInfo", sizeof("debugInfo")-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(soo_exception_ce, "additionalInfo", sizeof("additionalInfo")-1, ZEND_ACC_PUBLIC); - - REGISTER_STRING_CONSTANT("OAUTH_SIG_METHOD_HMACSHA1", OAUTH_SIG_METHOD_HMACSHA1, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("OAUTH_SIG_METHOD_HMACSHA256", OAUTH_SIG_METHOD_HMACSHA256, CONST_CS | CONST_PERSISTENT); -diff --git a/provider.c b/provider.c -index 45880fb..43f2bc0 100644 ---- a/provider.c -+++ b/provider.c -@@ -1184,6 +1184,19 @@ extern int oauth_provider_register_class(void) /* {{{ */ - osce.create_object = oauth_provider_new; - oauthprovider = zend_register_internal_class(&osce); - -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CONSUMER_KEY, sizeof(OAUTH_PROVIDER_CONSUMER_KEY)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CONSUMER_SECRET, sizeof(OAUTH_PROVIDER_CONSUMER_SECRET)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_SIGNATURE, sizeof(OAUTH_PROVIDER_SIGNATURE)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_SIGNATURE_METHOD, sizeof(OAUTH_PROVIDER_SIGNATURE_METHOD)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TOKEN, sizeof(OAUTH_PROVIDER_TOKEN)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TOKEN_SECRET, sizeof(OAUTH_PROVIDER_TOKEN_SECRET)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_NONCE, sizeof(OAUTH_PROVIDER_NONCE)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TIMESTAMP, sizeof(OAUTH_PROVIDER_TIMESTAMP)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_VERSION, sizeof(OAUTH_PROVIDER_VERSION)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CALLBACK, sizeof(OAUTH_PROVIDER_CALLBACK)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_VERIFIER, sizeof(OAUTH_PROVIDER_VERIFIER)-1, ZEND_ACC_PUBLIC); -+ zend_declare_property_null(oauthprovider, "request_token_endpoint", sizeof("request_token_endpoint")-1, ZEND_ACC_PUBLIC); -+ - memcpy(&oauth_provider_obj_hndlrs, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - oauth_provider_obj_hndlrs.offset = XtOffsetOf(php_oauth_provider, zo); - oauth_provider_obj_hndlrs.free_obj = oauth_provider_free_storage; -diff --git a/tests/oauthprovider_001.phpt b/tests/oauthprovider_001.phpt -index e93af65..ab005c4 100644 ---- a/tests/oauthprovider_001.phpt -+++ b/tests/oauthprovider_001.phpt -@@ -6,25 +6,29 @@ $provider = new OAuthProvider(['foo' => 'bar']); - var_dump($provider); - - --EXPECT-- --object(OAuthProvider)#1 (10) { -+object(OAuthProvider)#1 (12) { - ["consumer_key"]=> - NULL - ["consumer_secret"]=> - NULL -- ["nonce"]=> -+ ["signature"]=> -+ NULL -+ ["signature_method"]=> - NULL - ["token"]=> - NULL - ["token_secret"]=> - NULL -+ ["nonce"]=> -+ NULL - ["timestamp"]=> - NULL - ["version"]=> - NULL -- ["signature_method"]=> -- NULL - ["callback"]=> - NULL -+ ["verifier"]=> -+ NULL - ["request_token_endpoint"]=> - bool(false) - } diff --git a/oauth-php84.patch b/oauth-php84.patch deleted file mode 100644 index 3eacf17..0000000 --- a/oauth-php84.patch +++ /dev/null @@ -1,100 +0,0 @@ -From e7f262becf3feb65c8195fff4591d9dbd8acbace Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@php.net> -Date: Tue, 9 Jul 2024 15:09:40 +0200 -Subject: [PATCH 1/2] fix for PHP 8.4 - ---- - oauth.c | 2 +- - php_oauth.h | 6 +++++- - provider.c | 6 +++++- - 3 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/oauth.c b/oauth.c -index 46fe08b..9bd8d2a 100644 ---- a/oauth.c -+++ b/oauth.c -@@ -1330,7 +1330,7 @@ static void make_standard_query(HashTable *ht, php_so_object *soo) /* {{{ */ - gettimeofday((struct timeval *) &tv, (struct timezone *) NULL); - sec = (int) tv.tv_sec; - usec = (int) (tv.tv_usec % 0x100000); -- spprintf(&nonce, 0, "%ld%08x%05x%.8f", php_rand(), sec, usec, php_combined_lcg() * 10); -+ spprintf(&nonce, 0, "%d%08x%05x%.8f", php_mt_rand(), sec, usec, php_combined_lcg() * 10); - } - - add_arg_for_req(ht, OAUTH_PARAM_CONSUMER_KEY, Z_STRVAL_P(soo_get_property(soo, OAUTH_ATTR_CONSUMER_KEY))); -diff --git a/php_oauth.h b/php_oauth.h -index e5a1225..63a29ec 100644 ---- a/php_oauth.h -+++ b/php_oauth.h -@@ -29,7 +29,12 @@ - #include "php_main.h" - #include "php_ini.h" - #include "ext/standard/php_string.h" -+#if PHP_VERSION_ID < 80400 - #include "ext/standard/php_rand.h" -+#include "ext/standard/php_lcg.h" -+#else -+#include "ext/random/php_random.h" -+#endif - #include "ext/standard/php_smart_string.h" - #include "ext/standard/info.h" - #include "ext/standard/php_string.h" -@@ -41,7 +46,6 @@ - #include "php_globals.h" - #include "ext/standard/file.h" - #include "ext/standard/base64.h" --#include "ext/standard/php_lcg.h" - #include "ext/pcre/php_pcre.h" - #include "php_network.h" - -diff --git a/provider.c b/provider.c -index cd853f0..f1f8e2a 100644 ---- a/provider.c -+++ b/provider.c -@@ -235,8 +235,12 @@ static int oauth_provider_parse_auth_header(php_oauth_provider *sop, char *auth_ - #endif - &return_value, - &subpats, -+#if PHP_VERSION_ID < 80400 - 1, /* global */ - 1, /* use flags */ -+#else -+ true, /* global */ -+#endif - 2, /* PREG_SET_ORDER */ - 0 - ); -@@ -956,7 +960,7 @@ SOP_METHOD(generateToken) - php_error_docref(NULL, E_WARNING, "Could not gather enough random data, falling back on rand()"); - } - while (reaped < size) { -- iv[reaped++] = (char) (255.0 * php_rand() / RAND_MAX); -+ iv[reaped++] = (char)php_mt_rand_range(0, 255); - } - } - - -From 95f349152e6e0797068970ca7e6b265310316c0f Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@php.net> -Date: Mon, 30 Sep 2024 09:36:58 +0200 -Subject: [PATCH 2/2] use zend_str_tolower - ---- - oauth.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/oauth.c b/oauth.c -index 9bd8d2a..24c60c9 100644 ---- a/oauth.c -+++ b/oauth.c -@@ -599,8 +599,8 @@ zend_string *oauth_generate_sig_base(php_so_object *soo, const char *http_method - php_url_free(urlparts); - return NULL; - } -- php_strtolower(OAUTH_URL_STR(urlparts->scheme), OAUTH_URL_LEN(urlparts->scheme)); -- php_strtolower(OAUTH_URL_STR(urlparts->host), OAUTH_URL_LEN(urlparts->host)); -+ zend_str_tolower(OAUTH_URL_STR(urlparts->scheme), OAUTH_URL_LEN(urlparts->scheme)); -+ zend_str_tolower(OAUTH_URL_STR(urlparts->host), OAUTH_URL_LEN(urlparts->host)); - smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->scheme)); - smart_string_appends(&sbuf, "://"); - smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->host)); diff --git a/php-pecl-oauth.spec b/php-pecl-oauth.spec index 0b92684..c21426c 100644 --- a/php-pecl-oauth.spec +++ b/php-pecl-oauth.spec @@ -20,20 +20,17 @@ %global _configure ../%{sources}/configure Name: %{?scl_prefix}php-pecl-oauth -Version: 2.0.7 -Release: 11%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 2.0.9 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Summary: PHP OAuth consumer extension License: BSD-3-Clause URL: https://pecl.php.net/package/oauth Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz -Patch0: %{pecl_name}-pcre.patch -Patch1: %{pecl_name}-php82.patch -Patch2: %{pecl_name}-php84.patch - BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7 +# see https://github.com/php/pecl-web_services-oauth/pull/31 +BuildRequires: %{?scl_prefix}php-devel >= 7.1 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-posix BuildRequires: pcre-devel @@ -67,10 +64,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd %{sources} -%patch -P0 -p1 -b .up -%patch -P1 -p1 -b .pr24 -%patch -P2 -p1 -b .pr30 - #sed -e '/PHP_OAUTH_VERSION/s/2.0.3-dev/2.0.3/' -i php_oauth.h # Sanity check, really often broken extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' php_oauth.h) @@ -173,6 +166,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Tue Oct 8 2024 Remi Collet <remi@remirepo.net> - 2.0.9-1 +- update to 2.0.9 +- drop patches merged upstream + * Mon Sep 30 2024 Remi Collet <remi@remirepo.net> - 2.0.7-11 - more patch for 8.4 |