From 4732b8f573cb252f8d4bec5c8fc3ee70fb4af15a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 27 Oct 2015 10:46:39 +0100 Subject: php-pecl-libsodium: 1.0.2 --- libsodium-pr62.patch | 38 --------------------- libsodium-pr63.patch | 88 ------------------------------------------------- php-pecl-libsodium.spec | 13 +++----- 3 files changed, 5 insertions(+), 134 deletions(-) delete mode 100644 libsodium-pr62.patch delete mode 100644 libsodium-pr63.patch diff --git a/libsodium-pr62.patch b/libsodium-pr62.patch deleted file mode 100644 index 0a08cd5..0000000 --- a/libsodium-pr62.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3d2f71927f26c65ce7a631793ece893a86bc818a Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 27 Oct 2015 08:02:26 +0100 -Subject: [PATCH] don't zero interned string - ---- - libsodium.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/libsodium.c b/libsodium.c -index bc03b49..8bd1036 100644 ---- a/libsodium.c -+++ b/libsodium.c -@@ -396,15 +396,21 @@ PHP_FUNCTION(sodium_memzero) - return; - } - ZVAL_DEREF(buf_zv); -+ if (Z_TYPE_P(buf_zv) != IS_STRING) { -+ zend_error(E_ERROR, "memzero: a PHP string is required"); -+ } - #if PHP_MAJOR_VERSION >= 7 -- if (Z_REFCOUNTED_P(buf_zv) == 0 || Z_REFCOUNT(*buf_zv) > 1) { -+ if (IS_INTERNED(Z_STR(*buf_zv)) || Z_REFCOUNTED_P(buf_zv) == 0 || Z_REFCOUNT(*buf_zv) > 1) { - convert_to_null(buf_zv); - return; - } - #endif -- if (Z_TYPE_P(buf_zv) != IS_STRING) { -- zend_error(E_ERROR, "memzero: a PHP string is required"); -+#if PHP_MAJOR_VERSION < 7 && defined(IS_INTERNED) -+ if (IS_INTERNED(Z_STRVAL(*buf_zv))) { -+ convert_to_null(buf_zv); -+ return; - } -+#endif - buf = Z_STRVAL(*buf_zv); - buf_len = Z_STRLEN(*buf_zv); - if (buf_len > 0) { diff --git a/libsodium-pr63.patch b/libsodium-pr63.patch deleted file mode 100644 index 3d28573..0000000 --- a/libsodium-pr63.patch +++ /dev/null @@ -1,88 +0,0 @@ -From fbecbcfcbe819a1fae9663689e9c34b9d904502a Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 27 Oct 2015 08:28:00 +0100 -Subject: [PATCH 1/2] fix build with old libsodium - ---- - libsodium.c | 3 +++ - tests/crypto_aead.phpt | 5 ++++- - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/libsodium.c b/libsodium.c -index bc03b49..f9f12f7 100644 ---- a/libsodium.c -+++ b/libsodium.c -@@ -2033,6 +2033,8 @@ PHP_FUNCTION(crypto_sign_ed25519_pk_to_curve25519) - RETURN_STR(ecdhkey); - } - -+#if SODIUM_LIBRARY_VERSION_MAJOR > 7 || \ -+ (SODIUM_LIBRARY_VERSION_MAJOR == 7 && SODIUM_LIBRARY_VERSION_MINOR >= 6) - PHP_FUNCTION(sodium_compare) - { - char *buf1; -@@ -2054,3 +2056,4 @@ PHP_FUNCTION(sodium_compare) - (const unsigned char *) buf2, (size_t) len1)); - } - } -+#endif -\ No newline at end of file -diff --git a/tests/crypto_aead.phpt b/tests/crypto_aead.phpt -index c2a5ff1..96029aa 100644 ---- a/tests/crypto_aead.phpt -+++ b/tests/crypto_aead.phpt -@@ -1,7 +1,10 @@ - --TEST-- - Check for libsodium AEAD - --SKIPIF-- -- -+ - --FILE-- - -Date: Tue, 27 Oct 2015 09:18:18 +0100 -Subject: [PATCH 2/2] add check for crypto_aead_aes256gcm_encrypt symbol - ---- - config.m4 | 8 +++++++- - libsodium.c | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/config.m4 b/config.m4 -index 2a7fe2e..eb11468 100644 ---- a/config.m4 -+++ b/config.m4 -@@ -38,7 +38,13 @@ if test "$PHP_LIBSODIUM" != "no"; then - ],[ - -L$LIBSODIUM_DIR/$PHP_LIBDIR - ]) -- -+ PHP_CHECK_LIBRARY($LIBNAME,crypto_aead_aes256gcm_encrypt, -+ [ -+ AC_DEFINE(HAVE_CRYPTO_AEAD_AES256GCM,1,[ ]) -+ ],[],[ -+ -L$LIBSODIUM_DIR/$PHP_LIBDIR -+ ]) -+ - PHP_SUBST(LIBSODIUM_SHARED_LIBADD) - - PHP_NEW_EXTENSION(libsodium, libsodium.c, $ext_shared) -diff --git a/libsodium.c b/libsodium.c -index f9f12f7..f73e62f 100644 ---- a/libsodium.c -+++ b/libsodium.c -@@ -148,7 +148,7 @@ ZEND_END_ARG_INFO() - # define PHP_FE_END { NULL, NULL, NULL } - #endif - --#if defined(crypto_aead_aes256gcm_KEYBYTES) && \ -+#if defined(HAVE_CRYPTO_AEAD_AES256GCM) && defined(crypto_aead_aes256gcm_KEYBYTES) && \ - (defined(__amd64) || defined(__amd64__) || defined(__x86_64__) || defined(__i386__) || \ - defined(_M_AMD64) || defined(_M_IX86)) - # define HAVE_AESGCM 1 diff --git a/php-pecl-libsodium.spec b/php-pecl-libsodium.spec index bda8ec9..43f2fd3 100644 --- a/php-pecl-libsodium.spec +++ b/php-pecl-libsodium.spec @@ -31,18 +31,13 @@ Summary: Wrapper for the Sodium cryptographic library Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 1.0.1 +Version: 1.0.2 Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# https://github.com/jedisct1/libsodium-php/pull/62 don't zero interned string -Patch0: %{pecl_name}-pr62.patch -# https://github.com/jedisct1/libsodium-php/pull/63 build with old libsodium -Patch1: %{pecl_name}-pr63.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if "%{?vendor}" == "Remi Collet" # Ensure libsodium-last is used @@ -105,8 +100,6 @@ mv %{pecl_name}-%{version} NTS sed -e '/role="test"/d' -i package.xml cd NTS -%patch0 -p1 -b .pr62 -%patch1 -p1 -b .pr63 # Sanity check, really often broken extver=$(sed -n '/#define PHP_LIBSODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h) @@ -239,6 +232,10 @@ rm -rf %{buildroot} %changelog +* Tue Oct 27 2015 Remi Collet - 1.0.2-1 +- Update to 1.0.2 +- drop all patches, merged upstream + * Tue Oct 27 2015 Remi Collet - 1.0.1-1 - Update to 1.0.1 - fix for old libsodium -- cgit