From dfd730dd45078c4305cd6fff8ed5ebba3c700665 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 5 Apr 2023 08:27:30 +0200 Subject: update to 0.2.0 drop patches merged upstream --- 3.patch | 22 ---- 4.patch | 31 ----- 5.patch | 334 ------------------------------------------------------ 6.patch | 24 ---- PHPINFO | 4 +- REFLECTION | 2 +- php-pecl-rnp.spec | 22 ++-- 7 files changed, 11 insertions(+), 428 deletions(-) delete mode 100644 3.patch delete mode 100644 4.patch delete mode 100644 5.patch delete mode 100644 6.patch diff --git a/3.patch b/3.patch deleted file mode 100644 index f5726a8..0000000 --- a/3.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 05b5abd244759ad8cd18d0a7d0b17109ace3800f Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Thu, 27 Oct 2022 16:10:20 +0200 -Subject: [PATCH] add extension and library version - ---- - rnp.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rnp.c b/rnp.c -index 5b58a0b..3c89a7a 100644 ---- a/rnp.c -+++ b/rnp.c -@@ -2190,6 +2190,8 @@ PHP_MINFO_FUNCTION(rnp) - { - php_info_print_table_start(); - php_info_print_table_header(2, "rnp support", "enabled"); -+ php_info_print_table_row(2, "rnp extension version", PHP_RNP_VERSION); -+ php_info_print_table_row(2, "rnp library version", rnp_version_string()); - php_info_print_table_end(); - } - /* }}} */ diff --git a/4.patch b/4.patch deleted file mode 100644 index 1e22a0a..0000000 --- a/4.patch +++ /dev/null @@ -1,31 +0,0 @@ -From f907913b8cc9c06e7703fdc5093464510a9c9793 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 28 Oct 2022 09:18:27 +0200 -Subject: [PATCH] add backend name/version in info - ---- - rnp.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/rnp.c b/rnp.c -index 3c89a7a..d326f4c 100644 ---- a/rnp.c -+++ b/rnp.c -@@ -2188,11 +2188,17 @@ PHP_RINIT_FUNCTION(rnp) - /* {{{ PHP_MINFO_FUNCTION */ - PHP_MINFO_FUNCTION(rnp) - { -+ char *backend = NULL; -+ - php_info_print_table_start(); - php_info_print_table_header(2, "rnp support", "enabled"); - php_info_print_table_row(2, "rnp extension version", PHP_RNP_VERSION); - php_info_print_table_row(2, "rnp library version", rnp_version_string()); -+ spprintf(&backend, 0, "%s version %s", rnp_backend_string(), rnp_backend_version()); -+ php_info_print_table_row(2, "rnp backend", backend); -+ efree(backend); - php_info_print_table_end(); -+ - } - /* }}} */ - diff --git a/5.patch b/5.patch deleted file mode 100644 index 7eb7007..0000000 --- a/5.patch +++ /dev/null @@ -1,334 +0,0 @@ -From 83eb9f4b17d112444640e8f470911c22a57a4881 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 28 Oct 2022 09:24:32 +0200 -Subject: [PATCH 1/4] Fix [-Wunused-label] - ---- - rnp.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/rnp.c b/rnp.c -index 3c89a7a..dd2cee7 100644 ---- a/rnp.c -+++ b/rnp.c -@@ -1950,7 +1950,6 @@ PHP_FUNCTION(rnp_import_keys) - rnp_buffer_destroy(results); - } - --done: - (void) rnp_input_destroy(mem_input); - - if (ret != RNP_SUCCESS) { -@@ -2166,7 +2165,6 @@ PHP_FUNCTION(rnp_import_signatures) - rnp_buffer_destroy(results); - } - --done: - (void) rnp_input_destroy(mem_input); - - if (ret != RNP_SUCCESS) { - -From 633bfec407711dc8d3d5d14b9f0857400a1f5135 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 28 Oct 2022 09:26:39 +0200 -Subject: [PATCH 2/4] Fix [-Wreturn-type] - ---- - rnp.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rnp.c b/rnp.c -index dd2cee7..78ca158 100644 ---- a/rnp.c -+++ b/rnp.c -@@ -2270,6 +2270,8 @@ PHP_MINIT_FUNCTION(rnp) - REGISTER_LONG_CONSTANT("RNP_KEY_REMOVE_PUBLIC", RNP_KEY_REMOVE_PUBLIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("RNP_KEY_REMOVE_SECRET", RNP_KEY_REMOVE_SECRET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("RNP_KEY_REMOVE_SUBKEYS", RNP_KEY_REMOVE_SUBKEYS, CONST_CS | CONST_PERSISTENT); -+ -+ return SUCCESS; - } - - - -From 83f993cd6030487be35154794303f6df17df69a8 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 28 Oct 2022 09:41:27 +0200 -Subject: [PATCH 3/4] cast to fix [-Wpointer-sign] - ---- - rnp.c | 62 +++++++++++++++++++++++++++++------------------------------ - 1 file changed, 31 insertions(+), 31 deletions(-) - -diff --git a/rnp.c b/rnp.c -index 78ca158..e50e02b 100644 ---- a/rnp.c -+++ b/rnp.c -@@ -178,7 +178,7 @@ PHP_FUNCTION(rnp_load_keys) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(input), ZSTR_LEN(input), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); - - if (ret != RNP_SUCCESS) { - RETURN_FALSE; -@@ -266,7 +266,7 @@ PHP_FUNCTION(rnp_save_keys) - ret = rnp_output_memory_get_buf(mem_output, &buf, &len, false); - - if (ret == RNP_SUCCESS) { -- ZEND_TRY_ASSIGN_REF_STRINGL(output_ref, buf, len); -+ ZEND_TRY_ASSIGN_REF_STRINGL(output_ref, (char *)buf, len); - } - } - -@@ -330,7 +330,7 @@ PHP_FUNCTION(rnp_dump_packets) - Z_PARAM_LONG(flags) - ZEND_PARSE_PARAMETERS_END(); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(input), ZSTR_LEN(input), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); - - if (ret != RNP_SUCCESS) { - RETURN_FALSE; -@@ -351,7 +351,7 @@ PHP_FUNCTION(rnp_dump_packets) - ret = rnp_output_memory_get_buf(mem_output, &buf, &len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, buf, len); -+ ZVAL_STRINGL(return_value, (char *)buf, len); - } - } - -@@ -377,7 +377,7 @@ PHP_FUNCTION(rnp_dump_packets_to_json) - Z_PARAM_LONG(flags) - ZEND_PARSE_PARAMETERS_END(); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(input), ZSTR_LEN(input), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); - - if (ret != RNP_SUCCESS) { - RETURN_FALSE; -@@ -683,7 +683,7 @@ PHP_FUNCTION(rnp_op_sign) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(data), ZSTR_LEN(data), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(data), ZSTR_LEN(data), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } -@@ -799,7 +799,7 @@ PHP_FUNCTION(rnp_op_sign) - ret = rnp_output_memory_get_buf(mem_output, &sig_buf, &sig_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, sig_buf, sig_len); -+ ZVAL_STRINGL(return_value, (char *)sig_buf, sig_len); - } - - done: -@@ -838,7 +838,7 @@ PHP_FUNCTION(rnp_op_sign_cleartext) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(data), ZSTR_LEN(data), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(data), ZSTR_LEN(data), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } -@@ -921,7 +921,7 @@ PHP_FUNCTION(rnp_op_sign_cleartext) - ret = rnp_output_memory_get_buf(mem_output, &sig_buf, &sig_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, sig_buf, sig_len); -+ ZVAL_STRINGL(return_value, (char *)sig_buf, sig_len); - } - - done: -@@ -960,7 +960,7 @@ PHP_FUNCTION(rnp_op_sign_detached) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(data), ZSTR_LEN(data), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(data), ZSTR_LEN(data), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } -@@ -1043,7 +1043,7 @@ PHP_FUNCTION(rnp_op_sign_detached) - ret = rnp_output_memory_get_buf(mem_output, &sig_buf, &sig_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, sig_buf, sig_len); -+ ZVAL_STRINGL(return_value, (char *)sig_buf, sig_len); - } - - done: -@@ -1182,7 +1182,7 @@ PHP_FUNCTION(rnp_op_verify) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(data), ZSTR_LEN(data), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(data), ZSTR_LEN(data), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } -@@ -1233,12 +1233,12 @@ PHP_FUNCTION(rnp_op_verify_detached) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_data_input, ZSTR_VAL(data), ZSTR_LEN(data), false); -+ ret = rnp_input_from_memory(&mem_data_input, (uint8_t *)ZSTR_VAL(data), ZSTR_LEN(data), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } - -- ret = rnp_input_from_memory(&mem_sig_input, ZSTR_VAL(signature), ZSTR_LEN(signature), false); -+ ret = rnp_input_from_memory(&mem_sig_input, (uint8_t *)ZSTR_VAL(signature), ZSTR_LEN(signature), false); - if (ret != RNP_SUCCESS) { - goto done; - } -@@ -1289,7 +1289,7 @@ PHP_FUNCTION(rnp_op_encrypt) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(message), ZSTR_LEN(message), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(message), ZSTR_LEN(message), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } -@@ -1455,7 +1455,7 @@ PHP_FUNCTION(rnp_op_encrypt) - ret = rnp_output_memory_get_buf(mem_output, &encrypted_buf, &encrypted_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, encrypted_buf, encrypted_len); -+ ZVAL_STRINGL(return_value, (char *)encrypted_buf, encrypted_len); - } - - done: -@@ -1488,7 +1488,7 @@ PHP_FUNCTION(rnp_decrypt) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(input), ZSTR_LEN(input), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - } -@@ -1506,7 +1506,7 @@ PHP_FUNCTION(rnp_decrypt) - ret = rnp_output_memory_get_buf(mem_output, &decrypted_buf, &decrypted_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, decrypted_buf, decrypted_len); -+ ZVAL_STRINGL(return_value, (char *)decrypted_buf, decrypted_len); - } - done: - (void) rnp_input_destroy(mem_input); -@@ -1621,10 +1621,10 @@ PHP_FUNCTION(rnp_key_get_info) - php_rnp_ffi_t *pffi; - rnp_key_handle_t kh = NULL; - bool boolval = false; -- zend_long longval = 0; - char *strval = NULL; - char *fprint = NULL; -- uint32_t bits = 0; -+ uint32_t val32; -+ uint64_t val64; - zval subkeys; - zval uids; - -@@ -1766,21 +1766,21 @@ PHP_FUNCTION(rnp_key_get_info) - add_assoc_bool(return_value, "have_public", boolval); - - #ifdef ZEND_ENABLE_ZVAL_LONG64 -- if ((ret = rnp_key_valid_till64(kh, &longval))) { -+ if ((ret = rnp_key_valid_till64(kh, &val64))) { - goto done; - } -- add_assoc_long(return_value, "valid_till", longval); -+ add_assoc_long(return_value, "valid_till", (zend_long)val64); - #else -- if ((ret = rnp_key_valid_till(kh, &longval))) { -+ if ((ret = rnp_key_valid_till(kh, &val32))) { - goto done; - } -- add_assoc_long(return_value, "valid_till", longval); -+ add_assoc_long(return_value, "valid_till", (zend_long)val32); - #endif - -- if ((ret = rnp_key_get_bits(kh, &bits))) { -+ if ((ret = rnp_key_get_bits(kh, &val32))) { - goto done; - } -- add_assoc_long(return_value, "bits", bits); -+ add_assoc_long(return_value, "bits", (zend_long)val32); - - if ((ret = rnp_key_get_alg(kh, &strval))) { - goto done; -@@ -1836,7 +1836,7 @@ PHP_FUNCTION(rnp_key_export) - ret = rnp_output_memory_get_buf(mem_output, &exported_buf, &exported_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, exported_buf, exported_len); -+ ZVAL_STRINGL(return_value, (char *)exported_buf, exported_len); - } - done: - (void) rnp_key_handle_destroy(kh); -@@ -1906,7 +1906,7 @@ PHP_FUNCTION(rnp_key_export_autocrypt) - ret = rnp_output_memory_get_buf(mem_output, &exported_buf, &exported_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, exported_buf, exported_len); -+ ZVAL_STRINGL(return_value, (char *)exported_buf, exported_len); - } - done: - (void) rnp_key_handle_destroy(kh); -@@ -1937,7 +1937,7 @@ PHP_FUNCTION(rnp_import_keys) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(input), ZSTR_LEN(input), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); - - if (ret != RNP_SUCCESS) { - RETURN_FALSE; -@@ -2122,7 +2122,7 @@ PHP_FUNCTION(rnp_key_export_revocation) - ret = rnp_output_memory_get_buf(mem_output, &exported_buf, &exported_len, false); - - if (ret == RNP_SUCCESS) { -- ZVAL_STRINGL(return_value, exported_buf, exported_len); -+ ZVAL_STRINGL(return_value, (char *)exported_buf, exported_len); - } - done: - (void) rnp_key_handle_destroy(kh); -@@ -2152,7 +2152,7 @@ PHP_FUNCTION(rnp_import_signatures) - - pffi = Z_FFI_P(zffi); - -- ret = rnp_input_from_memory(&mem_input, ZSTR_VAL(input), ZSTR_LEN(input), false); -+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); - - if (ret != RNP_SUCCESS) { - RETURN_FALSE; - -From 3e8e52a1d6364402d74ac6456ca4f4dae31c2229 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 28 Oct 2022 09:42:07 +0200 -Subject: [PATCH 4/4] Fix [-Wunused-variable] - ---- - rnp.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/rnp.c b/rnp.c -index e50e02b..77d54d8 100644 ---- a/rnp.c -+++ b/rnp.c -@@ -1222,8 +1222,6 @@ PHP_FUNCTION(rnp_op_verify_detached) - rnp_input_t mem_data_input = NULL; - rnp_input_t mem_sig_input = NULL; - rnp_op_verify_t verify = NULL; -- size_t sigcount = 0; -- size_t i; - - ZEND_PARSE_PARAMETERS_START(3, 3); - Z_PARAM_OBJECT_OF_CLASS(zffi, rnp_ffi_t_ce) diff --git a/6.patch b/6.patch deleted file mode 100644 index 1851702..0000000 --- a/6.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 929e63fc6ebbd6156a498c4cde95efc9f2aa9fbf Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 28 Oct 2022 10:47:34 +0200 -Subject: [PATCH] skip test using unavailable algo with OpenSSL - ---- - tests/010.phpt | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tests/010.phpt b/tests/010.phpt -index 931bbe3..c60ee1c 100644 ---- a/tests/010.phpt -+++ b/tests/010.phpt -@@ -2,6 +2,10 @@ - encrypt/decrypt test - --EXTENSIONS-- - rnp -+--SKIPIF-- -+ - --CAPTURE_STDIO-- - STDIN STDOUT - --FILE-- diff --git a/PHPINFO b/PHPINFO index 11c522b..a7e4415 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,6 +2,6 @@ rnp rnp support => enabled -rnp extension version => 0.1.1 +rnp extension version => 0.2.0 rnp library version => 0.16.2 -rnp backend => Botan version 2.18.2 +rnp backend => Botan version 2.19.1 diff --git a/REFLECTION b/REFLECTION index 8671b61..3bec818 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #97 rnp version 0.1.1 ] { +Extension [ extension #95 rnp version 0.2.0 ] { - Constants [30] { Constant [ int RNP_LOAD_SAVE_PUBLIC_KEYS ] { 1 } diff --git a/php-pecl-rnp.spec b/php-pecl-rnp.spec index ea9cde9..37fffe2 100644 --- a/php-pecl-rnp.spec +++ b/php-pecl-rnp.spec @@ -1,7 +1,7 @@ # remirepo spec file for php-pecl-rnp # -# Copyright (c) 2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2022-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -19,23 +19,18 @@ %global pecl_name rnp %global ini_name 40-%{pecl_name}.ini -%global upstream_version 0.1.1 +%global upstream_version 0.2.0 #global upstream_prever a1 Summary: wrapper around the RNP library Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD-2-Clause URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz -Patch0: https://patch-diff.githubusercontent.com/raw/rnpgp/php-rnp/pull/3.patch -Patch1: https://patch-diff.githubusercontent.com/raw/rnpgp/php-rnp/pull/4.patch -Patch2: https://patch-diff.githubusercontent.com/raw/rnpgp/php-rnp/pull/5.patch -Patch3: https://patch-diff.githubusercontent.com/raw/rnpgp/php-rnp/pull/6.patch - BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 8.0 @@ -68,11 +63,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr3 -%patch1 -p1 -b .pr4 -%patch2 -p1 -b .pr5 -%patch3 -p1 -b .pr6 - # Check version as upstream often forget to update this extver=$(sed -n '/define PHP_RNP_VERSION/{s/.* "//;s/".*$//;p}' php_rnp.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then @@ -195,6 +185,10 @@ fi %changelog +* Wed Apr 5 2023 Remi Collet - 0.2.0-1 +- update to 0.2.0 +- drop patches merged upstream + * Fri Oct 28 2022 Remi Collet - 1.2.8-2 - open https://github.com/rnpgp/php-rnp/pull/3 extension version - open https://github.com/rnpgp/php-rnp/pull/4 backend name/version -- cgit