From c1503b10626b78b063996e8b58b654373b05b13a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 31 Jul 2025 10:42:07 +0200 Subject: fix behavior change with librnp 0.18 using patch from https://github.com/rnpgp/php-rnp/pull/11 fix segfault in php_rnp_password_callback using patch from https://github.com/rnpgp/php-rnp/pull/13 re-license spec file to CECILL-2.1 --- 11.patch | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 11.patch (limited to '11.patch') diff --git a/11.patch b/11.patch new file mode 100644 index 0000000..d5a4e79 --- /dev/null +++ b/11.patch @@ -0,0 +1,35 @@ +From f32b3b4c0a77096d256b4635b7183fb6dc53461b Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 31 Jul 2025 10:09:23 +0200 +Subject: [PATCH] check input length for librnp 0.18 + +--- + rnp.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/rnp.c b/rnp.c +index 0a41e03..632925b 100644 +--- a/rnp.c ++++ b/rnp.c +@@ -330,6 +330,10 @@ PHP_FUNCTION(rnp_dump_packets) + Z_PARAM_LONG(flags) + ZEND_PARSE_PARAMETERS_END(); + ++ if (!ZSTR_LEN(input)) { ++ RETURN_FALSE; ++ } ++ + ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); + + if (ret != RNP_SUCCESS) { +@@ -1938,6 +1942,10 @@ PHP_FUNCTION(rnp_import_keys) + Z_PARAM_LONG(flags) + ZEND_PARSE_PARAMETERS_END(); + ++ if (!ZSTR_LEN(input)) { ++ RETURN_FALSE; ++ } ++ + pffi = Z_FFI_P(zffi); + + ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false); -- cgit