From f715ec8ea5d31dbb51fd830d0fec6145f3b3dc90 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 2 Apr 2015 17:55:25 +0200 Subject: php-pecl-libsodium: 0.1.2 --- REFLECTION | 246 +++++++++++++++++++++++++++++++----------------- libsodium-build.patch | 28 ++++++ php-pecl-libsodium.spec | 55 +++++++---- 3 files changed, 224 insertions(+), 105 deletions(-) create mode 100644 libsodium-build.patch diff --git a/REFLECTION b/REFLECTION index a26f4d3..c2f97d7 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,99 +1,153 @@ -Extension [ extension #105 libsodium version 0.1.1 ] { +Extension [ extension #114 libsodium version 0.1.2 ] { - Classes [1] { Class [ class Sodium ] { - - Constants [25] { - Constant [ integer CRYPTO_SHORTHASH_BYTES ] { 8 } - Constant [ integer CRYPTO_SHORTHASH_KEYBYTES ] { 16 } - Constant [ integer CRYPTO_SECRETBOX_KEYBYTES ] { 32 } - Constant [ integer CRYPTO_SECRETBOX_NONCEBYTES ] { 24 } + - Constants [31] { + Constant [ integer CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES ] { 32 } + Constant [ integer CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES ] { 0 } + Constant [ integer CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES ] { 8 } + Constant [ integer CRYPTO_AEAD_CHACHA20POLY1305_ABYTES ] { 16 } + Constant [ integer CRYPTO_BOX_SECRETKEYBYTES ] { 32 } + Constant [ integer CRYPTO_BOX_PUBLICKEYBYTES ] { 32 } + Constant [ integer CRYPTO_BOX_KEYPAIRBYTES ] { 64 } + Constant [ integer CRYPTO_BOX_NONCEBYTES ] { 24 } Constant [ integer CRYPTO_GENERICHASH_BYTES ] { 32 } Constant [ integer CRYPTO_GENERICHASH_BYTES_MIN ] { 16 } Constant [ integer CRYPTO_GENERICHASH_BYTES_MAX ] { 64 } Constant [ integer CRYPTO_GENERICHASH_KEYBYTES ] { 32 } Constant [ integer CRYPTO_GENERICHASH_KEYBYTES_MIN ] { 16 } Constant [ integer CRYPTO_GENERICHASH_KEYBYTES_MAX ] { 64 } - Constant [ integer CRYPTO_BOX_SECRETKEYBYTES ] { 32 } - Constant [ integer CRYPTO_BOX_PUBLICKEYBYTES ] { 32 } - Constant [ integer CRYPTO_BOX_KEYPAIRBYTES ] { 64 } - Constant [ integer CRYPTO_BOX_NONCEBYTES ] { 24 } - Constant [ integer CRYPTO_SIGN_BYTES ] { 64 } - Constant [ integer CRYPTO_SIGN_SEEDBYTES ] { 32 } - Constant [ integer CRYPTO_SIGN_PUBLICKEYBYTES ] { 32 } - Constant [ integer CRYPTO_SIGN_SECRETKEYBYTES ] { 64 } - Constant [ integer CRYPTO_SIGN_KEYPAIRBYTES ] { 96 } Constant [ integer CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES ] { 32 } Constant [ string CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX ] { $7$ } Constant [ integer CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE ] { 524288 } Constant [ integer CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE ] { 16777216 } Constant [ integer CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE ] { 33554432 } Constant [ integer CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE ] { 1073741824 } + Constant [ integer CRYPTO_SHORTHASH_BYTES ] { 8 } + Constant [ integer CRYPTO_SHORTHASH_KEYBYTES ] { 16 } + Constant [ integer CRYPTO_SECRETBOX_KEYBYTES ] { 32 } + Constant [ integer CRYPTO_SECRETBOX_NONCEBYTES ] { 24 } + Constant [ integer CRYPTO_SIGN_BYTES ] { 64 } + Constant [ integer CRYPTO_SIGN_SEEDBYTES ] { 32 } + Constant [ integer CRYPTO_SIGN_PUBLICKEYBYTES ] { 32 } + Constant [ integer CRYPTO_SIGN_SECRETKEYBYTES ] { 64 } + Constant [ integer CRYPTO_SIGN_KEYPAIRBYTES ] { 96 } + Constant [ integer CRYPTO_STREAM_NONCEBYTES ] { 24 } + Constant [ integer CRYPTO_STREAM_KEYBYTES ] { 32 } } - Static properties [0] { } - - Static methods [29] { - Method [ static public method sodium_version_string ] { + - Static methods [37] { + Method [ static public method crypto_aead_chacha20poly1305_decrypt ] { - - Parameters [0] { + - Parameters [4] { + Parameter #0 [ $string ] + Parameter #1 [ $ad ] + Parameter #2 [ $nonce ] + Parameter #3 [ $key ] } } - Method [ static public method sodium_library_version_major ] { + Method [ static public method crypto_aead_chacha20poly1305_encrypt ] { - - Parameters [0] { + - Parameters [4] { + Parameter #0 [ $string ] + Parameter #1 [ $ad ] + Parameter #2 [ $nonce ] + Parameter #3 [ $key ] } } - Method [ static public method sodium_library_version_minor ] { + Method [ static public method crypto_box ] { + + - Parameters [3] { + Parameter #0 [ $string ] + Parameter #1 [ $nonce ] + Parameter #2 [ $key ] + } + } + + Method [ static public method crypto_box_keypair ] { - Parameters [0] { } } - Method [ static public method sodium_memzero ] { + Method [ static public method crypto_box_keypair_from_secretkey_and_publickey ] { - Parameters [2] { - Parameter #0 [ &$reference ] - Parameter #1 [ $length ] + Parameter #0 [ $secret_key ] + Parameter #1 [ $public_key ] } } - Method [ static public method sodium_memcmp ] { + Method [ static public method crypto_box_open ] { - - Parameters [2] { - Parameter #0 [ $string_1 ] - Parameter #1 [ $string_2 ] + - Parameters [3] { + Parameter #0 [ $string ] + Parameter #1 [ $nonce ] + Parameter #2 [ $key ] } } - Method [ static public method randombytes_buf ] { + Method [ static public method crypto_box_publickey ] { - Parameters [1] { - Parameter #0 [ $length ] + Parameter #0 [ $key ] } } - Method [ static public method randombytes_random16 ] { + Method [ static public method crypto_box_publickey_from_secretkey ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $key ] } } - Method [ static public method randombytes_uniform ] { + Method [ static public method crypto_box_secretkey ] { - Parameters [1] { - Parameter #0 [ $integer ] + Parameter #0 [ $key ] } } - Method [ static public method crypto_shorthash ] { + Method [ static public method crypto_generichash ] { - - Parameters [2] { + - Parameters [3] { Parameter #0 [ $string ] - Parameter #1 [ $key ] + Parameter #1 [ $key ] + Parameter #2 [ $length ] + } + } + + Method [ static public method crypto_pwhash_scryptsalsa208sha256 ] { + + - Parameters [5] { + Parameter #0 [ $length ] + Parameter #1 [ $password ] + Parameter #2 [ $salt ] + Parameter #3 [ $opslimit ] + Parameter #4 [ $memlimit ] + } + } + + Method [ static public method crypto_pwhash_scryptsalsa208sha256_str ] { + + - Parameters [3] { + Parameter #0 [ $password ] + Parameter #1 [ $opslimit ] + Parameter #2 [ $memlimit ] + } + } + + Method [ static public method crypto_pwhash_scryptsalsa208sha256_str_verify ] { + + - Parameters [2] { + Parameter #0 [ $hash ] + Parameter #1 [ $password ] } } @@ -115,22 +169,37 @@ Extension [ extension #105 libsodium version 0.1.1 ] { } } - Method [ static public method crypto_generichash ] { + Method [ static public method crypto_shorthash ] { - - Parameters [3] { + - Parameters [2] { Parameter #0 [ $string ] - Parameter #1 [ $key ] - Parameter #2 [ $length ] + Parameter #1 [ $key ] } } - Method [ static public method crypto_box_keypair ] { + Method [ static public method crypto_sign ] { + + - Parameters [2] { + Parameter #0 [ $string ] + Parameter #1 [ $key ] + } + } + + Method [ static public method crypto_sign_detached ] { + + - Parameters [2] { + Parameter #0 [ $string ] + Parameter #1 [ $key ] + } + } + + Method [ static public method crypto_sign_keypair ] { - Parameters [0] { } } - Method [ static public method crypto_box_keypair_from_secretkey_and_publickey ] { + Method [ static public method crypto_sign_keypair_from_secretkey_and_publickey ] { - Parameters [2] { Parameter #0 [ $secret_key ] @@ -138,121 +207,128 @@ Extension [ extension #105 libsodium version 0.1.1 ] { } } - Method [ static public method crypto_box_secretkey ] { + Method [ static public method crypto_sign_open ] { + + - Parameters [2] { + Parameter #0 [ $string ] + Parameter #1 [ $key ] + } + } + + Method [ static public method crypto_sign_publickey ] { - Parameters [1] { Parameter #0 [ $key ] } } - Method [ static public method crypto_box_publickey ] { + Method [ static public method crypto_sign_secretkey ] { - Parameters [1] { Parameter #0 [ $key ] } } - Method [ static public method crypto_box_publickey_from_secretkey ] { + Method [ static public method crypto_sign_seed_keypair ] { - Parameters [1] { Parameter #0 [ $key ] } } - Method [ static public method crypto_box ] { + Method [ static public method crypto_sign_verify_detached ] { - Parameters [3] { - Parameter #0 [ $string ] - Parameter #1 [ $nonce ] + Parameter #0 [ $signature ] + Parameter #1 [ $string ] Parameter #2 [ $key ] } } - Method [ static public method crypto_box_open ] { + Method [ static public method crypto_stream ] { - Parameters [3] { - Parameter #0 [ $string ] + Parameter #0 [ $length ] Parameter #1 [ $nonce ] Parameter #2 [ $key ] } } - Method [ static public method crypto_sign_keypair ] { + Method [ static public method crypto_stream_xor ] { - - Parameters [0] { + - Parameters [3] { + Parameter #0 [ $string ] + Parameter #1 [ $nonce ] + Parameter #2 [ $key ] } } - Method [ static public method crypto_sign_seed_keypair ] { + Method [ static public method randombytes_buf ] { - Parameters [1] { - Parameter #0 [ $key ] + Parameter #0 [ $length ] } } - Method [ static public method crypto_sign_keypair_from_secretkey_and_publickey ] { + Method [ static public method randombytes_random16 ] { - - Parameters [2] { - Parameter #0 [ $secret_key ] - Parameter #1 [ $public_key ] + - Parameters [0] { } } - Method [ static public method crypto_sign_secretkey ] { + Method [ static public method randombytes_uniform ] { - Parameters [1] { - Parameter #0 [ $key ] + Parameter #0 [ $integer ] } } - Method [ static public method crypto_sign_publickey ] { + Method [ static public method sodium_bin2hex ] { - Parameters [1] { - Parameter #0 [ $key ] + Parameter #0 [ $string ] } } - Method [ static public method crypto_sign ] { + Method [ static public method sodium_hex2bin ] { - Parameters [2] { - Parameter #0 [ $string ] - Parameter #1 [ $key ] + Parameter #0 [ $string_1 ] + Parameter #1 [ $string_2 ] } } - Method [ static public method crypto_sign_open ] { + Method [ static public method sodium_library_version_major ] { - - Parameters [2] { - Parameter #0 [ $string ] - Parameter #1 [ $key ] + - Parameters [0] { } } - Method [ static public method crypto_pwhash_scryptsalsa208sha256 ] { + Method [ static public method sodium_library_version_minor ] { - - Parameters [5] { - Parameter #0 [ $length ] - Parameter #1 [ $password ] - Parameter #2 [ $salt ] - Parameter #3 [ $opslimit ] - Parameter #4 [ $memlimit ] + - Parameters [0] { } } - Method [ static public method crypto_pwhash_scryptsalsa208sha256_str ] { + Method [ static public method sodium_memcmp ] { - - Parameters [3] { - Parameter #0 [ $password ] - Parameter #1 [ $opslimit ] - Parameter #2 [ $memlimit ] + - Parameters [2] { + Parameter #0 [ $string_1 ] + Parameter #1 [ $string_2 ] } } - Method [ static public method crypto_pwhash_scryptsalsa208sha256_str_verify ] { + Method [ static public method sodium_memzero ] { - Parameters [2] { - Parameter #0 [ $hash ] - Parameter #1 [ $password ] + Parameter #0 [ &$reference ] + Parameter #1 [ $length ] + } + } + + Method [ static public method sodium_version_string ] { + + - Parameters [0] { } } } diff --git a/libsodium-build.patch b/libsodium-build.patch new file mode 100644 index 0000000..a7ea30b --- /dev/null +++ b/libsodium-build.patch @@ -0,0 +1,28 @@ +From 1959c39f0ee575794f9c6b06b89e18b0081f7564 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 2 Apr 2015 17:42:49 +0200 +Subject: [PATCH] fix typo in rev ea710a2fbba928c2f8af7c9d1b7027e64fa9d4aa + +--- + config.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/config.m4 b/config.m4 +index 96ab23c..2a7fe2e 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -31,12 +31,12 @@ if test "$PHP_LIBSODIUM" != "no"; then + + PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, + [ +- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $LIBSODIUM_DIR/$PHP_LIB, LIBSODIUM_SHARED_LIBADD) ++ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $LIBSODIUM_DIR/$PHP_LIBDIR, LIBSODIUM_SHARED_LIBADD) + AC_DEFINE(HAVE_LIBSODIUMLIB,1,[ ]) + ],[ + AC_MSG_ERROR([wrong libsodium lib version or lib not found]) + ],[ +- -L$LIBSODIUM_DIR/$PHP_LIB ++ -L$LIBSODIUM_DIR/$PHP_LIBDIR + ]) + + PHP_SUBST(LIBSODIUM_SHARED_LIBADD) diff --git a/php-pecl-libsodium.spec b/php-pecl-libsodium.spec index ca1c664..9485218 100644 --- a/php-pecl-libsodium.spec +++ b/php-pecl-libsodium.spec @@ -2,7 +2,7 @@ # # Copyright (c) 2014-2015 Remi Collet # License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/3.0/ +# http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # @@ -22,13 +22,15 @@ Summary: Wrapper for the Sodium cryptographic library Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 0.1.1 -Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1 +Version: 0.1.2 +Release: 1%{?dist}%{!?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 +Patch0: %{pecl_name}-build.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if "%{?vendor}" == "Remi Collet" # Ensure libsodium-last is used @@ -40,8 +42,6 @@ BuildRequires: libsodium-devel >= 0.6.0 BuildRequires: %{?scl_prefix}php-devel > 5.2 BuildRequires: %{?scl_prefix}php-pear -Requires(post): %{__pecl} -Requires(postun): %{__pecl} Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} @@ -53,17 +53,17 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} -Obsoletes: php53u-pecl-%{pecl_name} -Obsoletes: php54-pecl-%{pecl_name} -Obsoletes: php54w-pecl-%{pecl_name} +Obsoletes: php53-pecl-%{pecl_name} <= %{version} +Obsoletes: php53u-pecl-%{pecl_name} <= %{version} +Obsoletes: php54-pecl-%{pecl_name} <= %{version} +Obsoletes: php54w-pecl-%{pecl_name} <= %{version} %if "%{php_version}" > "5.5" -Obsoletes: php55u-pecl-%{pecl_name} -Obsoletes: php55w-pecl-%{pecl_name} +Obsoletes: php55u-pecl-%{pecl_name} <= %{version} +Obsoletes: php55w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "5.6" -Obsoletes: php56u-pecl-%{pecl_name} -Obsoletes: php56w-pecl-%{pecl_name} +Obsoletes: php56u-pecl-%{pecl_name} <= %{version} +Obsoletes: php56w-pecl-%{pecl_name} <= %{version} %endif %endif @@ -85,9 +85,11 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO mv %{pecl_name}-%{version} NTS # Don't install tests -sed -e '/role="test"/d' -i package2.xml +sed -e '/role="test"/d' -i package.xml cd NTS +%patch0 -p1 -b .fix + # 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 @@ -133,7 +135,7 @@ make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description -install -D -m 644 package2.xml %{buildroot}%{pecl_xmldir}/%{name}.xml +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} make -C ZTS install INSTALL_ROOT=%{buildroot} @@ -142,17 +144,25 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif # Documentation -for i in $(grep 'role="doc"' package2.xml | sed -e 's/^.*name="//;s/".*$//') +for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%post -%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +# when pear installed alone, after us +%triggerin -- %{?scl_prefix}php-pear +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi +# posttrans as pear can be installed after us +%posttrans +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi %postun -if [ $1 -eq 0 ] ; then +if [ $1 -eq 0 -a -x %{__pecl} ] ; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi @@ -199,8 +209,8 @@ rm -rf %{buildroot} %defattr(-,root,root,-) %doc %{pecl_docdir}/%{pecl_name} %{?_licensedir:%license NTS/LICENSE} - %{pecl_xmldir}/%{name}.xml + %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -211,6 +221,11 @@ rm -rf %{buildroot} %changelog +* Thu Apr 02 2015 Remi Collet - 0.1.2-1 +- Update to 0.1.2 +- drop runtime dependency on pear, new scriptlets +- open https://github.com/jedisct1/libsodium-php/pull/22 + * Wed Dec 24 2014 Remi Collet - 0.1.1-1.1 - Fedora 21 SCL mass rebuild -- cgit