+++ /dev/null
-From ca45bd4a55541d58136c21b38b9b90e750fedfbc Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Mon, 30 Nov 2015 18:31:42 +0100
-Subject: [PATCH] fix test
-
----
- tests/crypto_auth.phpt | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/tests/crypto_auth.phpt b/tests/crypto_auth.phpt
-index c72451e..76f30eb 100644
---- a/tests/crypto_auth.phpt
-+++ b/tests/crypto_auth.phpt
-@@ -18,13 +18,9 @@ var_dump(\Sodium\crypto_auth_verify($mac, $badmsg, $key));
-
- // Let's flip a bit pseudo-randomly
- $badmsg = $msg;
--$badmsg[mt_rand(0, 999)] = \chr(
-- \ord($msg[0]) ^ (
-- // Mask out higher bits (thus 256 => 0)
-- 0xFF & (
-- // 1, 2, 4, 8, 16, 32, 64, 128, 256
-- 1 << mt_rand(0, 8)
-- )
-+$badmsg[$i=mt_rand(0, 999)] = \chr(
-+ \ord($msg[$i]) ^ (
-+ 1 << mt_rand(0, 7)
- )
- );
-
-@@ -32,7 +28,7 @@ var_dump(\Sodium\crypto_auth_verify($mac, $badmsg, $key));
-
- // Now let's change a bit in the MAC
- $badmac = $mac;
--$badmac[0] = \chr(\ord($badmsg[0]) ^ 0x80);
-+$badmac[0] = \chr(\ord($badmac[0]) ^ 0x80);
- var_dump(\Sodium\crypto_auth_verify($badmac, $msg, $key));
- ?>
- --EXPECT--
-%define buildver %(pkg-config --silence-errors --modversion libsodium 2>/dev/null || echo 65536)
-
#
# Conditional build:
%bcond_without tests # build without tests
+%define buildver %(pkg-config --silence-errors --modversion libsodium 2>/dev/null || echo 65536)
+
%define php_name php%{?php_suffix}
%define modname libsodium
Summary: Wrapper for the Sodium cryptographic library
-Name: php-pecl-%{modname}
-Version: 1.0.2
+Name: %{php_name}-pecl-%{modname}
+Version: 1.0.6
Release: 1
License: BSD
Group: Development/Languages
Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
-# Source0-md5: b4083271f4fe0a94b8ae69320878a5e8
+# Source0-md5: ad76fd81a44a7122dae9683ca18f3be6
URL: http://pecl.php.net/package/libsodium
-# See https://github.com/jedisct1/libsodium-php/pull/70
-Patch0: %{modname}-pr70.patch
-Patch1: tests-php53.patch
BuildRequires: %{php_name}-devel >= 4:5.3
BuildRequires: libsodium-devel >= 0.6.0
BuildRequires: pkgconfig
%setup -qc
mv %{modname}-%{version}/* .
-%patch0 -p1
-%patch1 -p1
-
+%build
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_LIBSODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h)
if test "x${extver}" != "x%{version}"; then
exit 1
fi
-%build
phpize
%configure
%{__make}
+++ /dev/null
-
-upstream:
-https://github.com/jedisct1/libsodium-php/pull/81
-https://github.com/jedisct1/libsodium-php/issues/82
-
---- php-pecl-libsodium-1.0.2/tests/utils.phpt 2016-01-28 21:43:00.641808352 +0200
-+++ php-pecl-libsodium-1.0.2/tests/utils.phpt 2016-01-28 21:45:37.116534064 +0200
-@@ -11,15 +11,15 @@
- $c = 'string';
- var_dump(!\Sodium\memcmp($b, $c));
- var_dump(!\Sodium\memcmp($b, 'String'));
--$v = hex2bin('FFFF800102030405060708');
-+$v = ""."\xFF\xFF\x80\x01\x02\x03\x04\x05\x06\x07\x08";
- \Sodium\increment($v);
- var_dump(bin2hex($v));
-
- if (\Sodium\library_version_major() > 7 ||
- (\Sodium\library_version_major() == 7 &&
- \Sodium\library_version_minor() >= 6)) {
-- $v_1 = hex2bin('0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F');
-- $v_2 = hex2bin('0202030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F');
-+ $v_1 = ""."\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
-+ $v_2 = ""."\x02\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
- var_dump(\Sodium\compare($v_1, $v_2));
- \Sodium\increment($v_1);
- var_dump(\Sodium\compare($v_1, $v_2));
-@@ -32,5 +32,5 @@
- $str = 'stdClass';
- \Sodium\memzero($str);
--$obj = json_decode(json_encode(['foo' => 'bar']));
-+$obj = json_decode(json_encode(array('foo' => 'bar')));
- var_dump($obj);
- ?>