diff options
author | Remi Collet <remi@remirepo.net> | 2017-10-11 14:51:20 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-10-11 14:51:20 +0200 |
commit | cb78af870fbfc17b8324d81735b6ec3fcc811aa3 (patch) | |
tree | 8a18e616a4bbc66df074c35d5508e5da5072772c | |
parent | 6916635a9d99d13a132a5fb25a692dd27c326c98 (diff) |
-rw-r--r-- | REFLECTION | 32 | ||||
-rw-r--r-- | libsodium-upstream.patch | 58 | ||||
-rw-r--r-- | php-pecl-libsodium.spec | 15 |
3 files changed, 28 insertions, 77 deletions
@@ -1,6 +1,6 @@ -Extension [ <persistent> extension #121 libsodium version 1.0.6 ] { +Extension [ <persistent> extension #102 libsodium version 1.0.7 ] { - - Constants [58] { + - Constants [61] { Constant [ integer Sodium\CRYPTO_AEAD_AES256GCM_KEYBYTES ] { 32 } Constant [ integer Sodium\CRYPTO_AEAD_AES256GCM_NSECBYTES ] { 0 } Constant [ integer Sodium\CRYPTO_AEAD_AES256GCM_NPUBBYTES ] { 12 } @@ -31,14 +31,17 @@ Extension [ <persistent> extension #121 libsodium version 1.0.6 ] { Constant [ integer Sodium\CRYPTO_GENERICHASH_KEYBYTES ] { 32 } Constant [ integer Sodium\CRYPTO_GENERICHASH_KEYBYTES_MIN ] { 16 } Constant [ integer Sodium\CRYPTO_GENERICHASH_KEYBYTES_MAX ] { 64 } + Constant [ integer Sodium\CRYPTO_PWHASH_ALG_ARGON2I13 ] { 1 } + Constant [ integer Sodium\CRYPTO_PWHASH_ALG_ARGON2ID13 ] { 2 } + Constant [ integer Sodium\CRYPTO_PWHASH_ALG_DEFAULT ] { 2 } Constant [ integer Sodium\CRYPTO_PWHASH_SALTBYTES ] { 16 } - Constant [ string Sodium\CRYPTO_PWHASH_STRPREFIX ] { $argon2i$ } - Constant [ integer Sodium\CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE ] { 4 } - Constant [ integer Sodium\CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE ] { 33554432 } - Constant [ integer Sodium\CRYPTO_PWHASH_OPSLIMIT_MODERATE ] { 6 } - Constant [ integer Sodium\CRYPTO_PWHASH_MEMLIMIT_MODERATE ] { 134217728 } - Constant [ integer Sodium\CRYPTO_PWHASH_OPSLIMIT_SENSITIVE ] { 8 } - Constant [ integer Sodium\CRYPTO_PWHASH_MEMLIMIT_SENSITIVE ] { 536870912 } + Constant [ string Sodium\CRYPTO_PWHASH_STRPREFIX ] { $argon2id$ } + Constant [ integer Sodium\CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE ] { 2 } + Constant [ integer Sodium\CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE ] { 67108864 } + Constant [ integer Sodium\CRYPTO_PWHASH_OPSLIMIT_MODERATE ] { 3 } + Constant [ integer Sodium\CRYPTO_PWHASH_MEMLIMIT_MODERATE ] { 268435456 } + Constant [ integer Sodium\CRYPTO_PWHASH_OPSLIMIT_SENSITIVE ] { 4 } + Constant [ integer Sodium\CRYPTO_PWHASH_MEMLIMIT_SENSITIVE ] { 1073741824 } Constant [ integer Sodium\CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES ] { 32 } Constant [ string Sodium\CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX ] { $7$ } Constant [ integer Sodium\CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE ] { 524288 } @@ -242,12 +245,13 @@ Extension [ <persistent> extension #121 libsodium version 1.0.6 ] { } Function [ <internal:libsodium> function Sodium\crypto_pwhash ] { - - Parameters [5] { + - Parameters [6] { Parameter #0 [ <required> $length ] Parameter #1 [ <required> $password ] Parameter #2 [ <required> $salt ] Parameter #3 [ <required> $opslimit ] Parameter #4 [ <required> $memlimit ] + Parameter #5 [ <optional> $alg ] } } Function [ <internal:libsodium> function Sodium\crypto_pwhash_str ] { @@ -267,12 +271,13 @@ Extension [ <persistent> extension #121 libsodium version 1.0.6 ] { } Function [ <internal:libsodium> function Sodium\crypto_pwhash_scryptsalsa208sha256 ] { - - Parameters [5] { + - Parameters [6] { Parameter #0 [ <required> $length ] Parameter #1 [ <required> $password ] Parameter #2 [ <required> $salt ] Parameter #3 [ <required> $opslimit ] Parameter #4 [ <required> $memlimit ] + Parameter #5 [ <optional> $alg ] } } Function [ <internal:libsodium> function Sodium\crypto_pwhash_scryptsalsa208sha256_str ] { @@ -438,8 +443,9 @@ Extension [ <persistent> extension #121 libsodium version 1.0.6 ] { } Function [ <internal:libsodium> function Sodium\compare ] { - - Parameters [1] { - Parameter #0 [ <required> $string ] + - Parameters [2] { + Parameter #0 [ <required> $string_1 ] + Parameter #1 [ <required> $string_2 ] } } Function [ <internal:libsodium> function Sodium\hex2bin ] { diff --git a/libsodium-upstream.patch b/libsodium-upstream.patch deleted file mode 100644 index c1ae079..0000000 --- a/libsodium-upstream.patch +++ /dev/null @@ -1,58 +0,0 @@ -Adapted for 1.0.6 from upstream: - - - -From ecbf0f15206d6898b26fc4c12a5c03a2e1609995 Mon Sep 17 00:00:00 2001 -From: Frank Denis <github@pureftpd.org> -Date: Fri, 18 Aug 2017 19:21:08 +0200 -Subject: [PATCH] If sodium_init() returns 1, this is fine. - -We actually want to do this so that multiple extensions using libsodium -can be loaded simultaneously. ---- - libsodium.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsodium.c b/libsodium.c -index 6eb2234..9089a31 100644 ---- a/libsodium.c -+++ b/libsodium.c -@@ -257,7 +257,7 @@ ZEND_GET_MODULE(libsodium) - - PHP_MINIT_FUNCTION(libsodium) - { -- if (sodium_init() != 0) { -+ if (sodium_init() < 0) { - zend_error(E_ERROR, "sodium_init()"); - } - -From e529d49b4ab0a875333eff867722207de97bcb76 Mon Sep 17 00:00:00 2001 -From: Frank Denis <github@pureftpd.org> -Date: Sun, 1 Oct 2017 15:59:13 +0200 -Subject: [PATCH] Fix pwhash_argon2i test - ---- - tests/pwhash_argon2i.phpt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tests/pwhash_argon2i.phpt b/tests/pwhash_argon2i.phpt -index e84dbf0..aee90bd 100644 ---- a/tests/pwhash_argon2i.phpt -+++ b/tests/pwhash_argon2i.phpt -@@ -10,14 +10,14 @@ $passwd = 'password'; - $hash = \Sodium\crypto_pwhash_str - ($passwd, \Sodium\CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, - \Sodium\CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE); --var_dump(substr($hash, 0, 9) === -+var_dump(substr($hash, 0, strlen(\Sodium\CRYPTO_PWHASH_STRPREFIX)) === - \Sodium\CRYPTO_PWHASH_STRPREFIX); - - $testHash = '$argon2i$v=19$m=4096,t=3,p=1$MzE4ODFiZWFlMjAzOWUAAA$FWUV6tsyJ32qThiLi1cCsLIbf3dIOG/RwXcTzt536KY'; - $c = \Sodium\crypto_pwhash_str_verify($testHash, $passwd); - var_dump($c); - --$testHash = '$argon2i$v=19$m=4096,t=2,p=1$c29tZXNhbHQAAAAAAAAAAA$JTBozgKQiCn5yKAm3Hz0vUSX/XgfqhZloNCxDWmeDr0'; -+$testHash = '$argon2i$v=19$m=4096,t=0,p=1$c29tZXNhbHQAAAAAAAAAAA$JTBozgKQiCn5yKAm3Hz0vUSX/XgfqhZloNCxDWmeDr0'; - $c = \Sodium\crypto_pwhash_str_verify($testHash, $passwd); - var_dump($c); - diff --git a/php-pecl-libsodium.spec b/php-pecl-libsodium.spec index 5340c8f..19ad722 100644 --- a/php-pecl-libsodium.spec +++ b/php-pecl-libsodium.spec @@ -23,16 +23,13 @@ Summary: Wrapper for the Sodium cryptographic library Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 1.0.6 -Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 1.0.7 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# needed if libsodium.so loaded after sodium.so (only affects php 7.2) -Patch0: %{pecl_name}-upstream.patch - # Ensure libsodium-last is used (upstream 0.6.0) BuildRequires: pkgconfig(libsodium) >= 1.0.15 BuildRequires: %{?scl_prefix}php-devel > 5.4 @@ -105,7 +102,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_LIBSODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h) @@ -128,6 +124,8 @@ EOF %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure \ @@ -144,6 +142,8 @@ make %{?_smp_mflags} %install +%{?dtsenable} + make -C NTS install INSTALL_ROOT=%{buildroot} # install config file @@ -233,6 +233,9 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Wed Oct 11 2017 Remi Collet <remi@remirepo.net> - 1.0.7-1 +- Update to 1.0.7 + * Sun Oct 1 2017 Remi Collet <remi@remirepo.net> - 1.0.7-1 - rebuild for libsodium 1.0.15 |