From 4eca20fdc880a0aa22ccb62417bfcec846e3cc1d Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Mon, 26 Aug 2013 17:06:29 +0200 Subject: [PATCH 1/7] Fixed typos in phpdoc --- src/BlockCipher.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/BlockCipher.php b/src/BlockCipher.php index 987e598..eeae14f 100644 --- a/src/BlockCipher.php +++ b/src/BlockCipher.php @@ -79,7 +79,7 @@ class BlockCipher /** * Constructor * - * @param SymmetricInterface $cipher + * @param SymmetricInterface $cipher */ public function __construct(SymmetricInterface $cipher) { @@ -167,7 +167,7 @@ public function getCipher() /** * Set the number of iterations for Pbkdf2 * - * @param int $num + * @param int $num * @return BlockCipher */ public function setKeyIteration($num) @@ -190,7 +190,7 @@ public function getKeyIteration() /** * Set the salt (IV) * - * @param string $salt + * @param string $salt * @return BlockCipher * @throws Exception\InvalidArgumentException */ @@ -229,7 +229,7 @@ public function getOriginalSalt() /** * Enable/disable the binary output * - * @param bool $value + * @param bool $value * @return BlockCipher */ public function setBinaryOutput($value) @@ -279,7 +279,7 @@ public function getKey() /** * Set algorithm of the symmetric cipher * - * @param string $algo + * @param string $algo * @return BlockCipher * @throws Exception\InvalidArgumentException */ @@ -357,7 +357,7 @@ public function getHashAlgorithm() /** * Set the hash algorithm for the Pbkdf2 * - * @params string $hash + * @param string $hash * @return BlockCipher * @throws Exception\InvalidArgumentException */ @@ -386,7 +386,7 @@ public function getPbkdf2HashAlgorithm() /** * Encrypt then authenticate using HMAC * - * @param string $data + * @param string $data * @return string * @throws Exception\InvalidArgumentException */ From c52f49b37310de8b978c861d7167ba958d9cee5a Mon Sep 17 00:00:00 2001 From: Kathryn Reeve Date: Tue, 31 Dec 2013 16:11:41 +0000 Subject: [PATCH 2/7] copyright update for 2014 - Zend Library --- src/BlockCipher.php | 2 +- src/Exception/ExceptionInterface.php | 2 +- src/Exception/InvalidArgumentException.php | 2 +- src/Exception/RuntimeException.php | 2 +- src/Hash.php | 2 +- src/Hmac.php | 2 +- src/Key/Derivation/Exception/ExceptionInterface.php | 2 +- src/Key/Derivation/Exception/InvalidArgumentException.php | 2 +- src/Key/Derivation/Exception/RuntimeException.php | 2 +- src/Key/Derivation/Pbkdf2.php | 2 +- src/Key/Derivation/SaltedS2k.php | 2 +- src/Key/Derivation/Scrypt.php | 2 +- src/Password/Apache.php | 2 +- src/Password/Bcrypt.php | 2 +- src/Password/Exception/ExceptionInterface.php | 2 +- src/Password/Exception/InvalidArgumentException.php | 2 +- src/Password/Exception/RuntimeException.php | 2 +- src/Password/PasswordInterface.php | 2 +- src/PublicKey/DiffieHellman.php | 2 +- src/PublicKey/Rsa.php | 2 +- src/PublicKey/Rsa/AbstractKey.php | 2 +- src/PublicKey/Rsa/Exception/ExceptionInterface.php | 2 +- src/PublicKey/Rsa/Exception/InvalidArgumentException.php | 2 +- src/PublicKey/Rsa/Exception/RuntimeException.php | 2 +- src/PublicKey/Rsa/PrivateKey.php | 2 +- src/PublicKey/Rsa/PublicKey.php | 2 +- src/PublicKey/RsaOptions.php | 2 +- src/Symmetric/Exception/ExceptionInterface.php | 2 +- src/Symmetric/Exception/InvalidArgumentException.php | 2 +- src/Symmetric/Exception/RuntimeException.php | 2 +- src/Symmetric/Mcrypt.php | 2 +- src/Symmetric/Padding/PaddingInterface.php | 2 +- src/Symmetric/Padding/Pkcs7.php | 2 +- src/Symmetric/PaddingPluginManager.php | 2 +- src/Symmetric/SymmetricInterface.php | 2 +- src/SymmetricPluginManager.php | 2 +- src/Utils.php | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/BlockCipher.php b/src/BlockCipher.php index eeae14f..380724d 100644 --- a/src/BlockCipher.php +++ b/src/BlockCipher.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index eeecc5e..ef93743 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 37446d6..bb7f4e1 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index c316b90..db07a4e 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Hash.php b/src/Hash.php index a06f2c9..ccbd15d 100644 --- a/src/Hash.php +++ b/src/Hash.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Hmac.php b/src/Hmac.php index b0aed19..54cce7b 100644 --- a/src/Hmac.php +++ b/src/Hmac.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Key/Derivation/Exception/ExceptionInterface.php b/src/Key/Derivation/Exception/ExceptionInterface.php index 92c9b92..31bdfff 100644 --- a/src/Key/Derivation/Exception/ExceptionInterface.php +++ b/src/Key/Derivation/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Key/Derivation/Exception/InvalidArgumentException.php b/src/Key/Derivation/Exception/InvalidArgumentException.php index 25a9315..e4c2512 100644 --- a/src/Key/Derivation/Exception/InvalidArgumentException.php +++ b/src/Key/Derivation/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Key/Derivation/Exception/RuntimeException.php b/src/Key/Derivation/Exception/RuntimeException.php index 1899045..9421317 100644 --- a/src/Key/Derivation/Exception/RuntimeException.php +++ b/src/Key/Derivation/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Key/Derivation/Pbkdf2.php b/src/Key/Derivation/Pbkdf2.php index 74748f9..8d216d6 100644 --- a/src/Key/Derivation/Pbkdf2.php +++ b/src/Key/Derivation/Pbkdf2.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Key/Derivation/SaltedS2k.php b/src/Key/Derivation/SaltedS2k.php index d7da1bb..9e3229b 100644 --- a/src/Key/Derivation/SaltedS2k.php +++ b/src/Key/Derivation/SaltedS2k.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Key/Derivation/Scrypt.php b/src/Key/Derivation/Scrypt.php index e5ff55b..e222149 100644 --- a/src/Key/Derivation/Scrypt.php +++ b/src/Key/Derivation/Scrypt.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Password/Apache.php b/src/Password/Apache.php index 70d172f..47be2b1 100644 --- a/src/Password/Apache.php +++ b/src/Password/Apache.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Password/Bcrypt.php b/src/Password/Bcrypt.php index 0affcf1..e07a64f 100644 --- a/src/Password/Bcrypt.php +++ b/src/Password/Bcrypt.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Password/Exception/ExceptionInterface.php b/src/Password/Exception/ExceptionInterface.php index a8ae021..1ac342b 100644 --- a/src/Password/Exception/ExceptionInterface.php +++ b/src/Password/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Password/Exception/InvalidArgumentException.php b/src/Password/Exception/InvalidArgumentException.php index 92c3b0c..b71b5ef 100644 --- a/src/Password/Exception/InvalidArgumentException.php +++ b/src/Password/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Password/Exception/RuntimeException.php b/src/Password/Exception/RuntimeException.php index f18b4e9..d854046 100644 --- a/src/Password/Exception/RuntimeException.php +++ b/src/Password/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Password/PasswordInterface.php b/src/Password/PasswordInterface.php index 3929879..1f7683e 100644 --- a/src/Password/PasswordInterface.php +++ b/src/Password/PasswordInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/DiffieHellman.php b/src/PublicKey/DiffieHellman.php index f88308a..3332886 100644 --- a/src/PublicKey/DiffieHellman.php +++ b/src/PublicKey/DiffieHellman.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa.php b/src/PublicKey/Rsa.php index 03b1f17..0102cae 100644 --- a/src/PublicKey/Rsa.php +++ b/src/PublicKey/Rsa.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa/AbstractKey.php b/src/PublicKey/Rsa/AbstractKey.php index 9777f54..5051c77 100644 --- a/src/PublicKey/Rsa/AbstractKey.php +++ b/src/PublicKey/Rsa/AbstractKey.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa/Exception/ExceptionInterface.php b/src/PublicKey/Rsa/Exception/ExceptionInterface.php index bfca848..3ad4156 100644 --- a/src/PublicKey/Rsa/Exception/ExceptionInterface.php +++ b/src/PublicKey/Rsa/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa/Exception/InvalidArgumentException.php b/src/PublicKey/Rsa/Exception/InvalidArgumentException.php index 73e9420..03561e8 100644 --- a/src/PublicKey/Rsa/Exception/InvalidArgumentException.php +++ b/src/PublicKey/Rsa/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa/Exception/RuntimeException.php b/src/PublicKey/Rsa/Exception/RuntimeException.php index caea88f..3ac77fd 100644 --- a/src/PublicKey/Rsa/Exception/RuntimeException.php +++ b/src/PublicKey/Rsa/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa/PrivateKey.php b/src/PublicKey/Rsa/PrivateKey.php index 37b3e9f..54ebd5f 100644 --- a/src/PublicKey/Rsa/PrivateKey.php +++ b/src/PublicKey/Rsa/PrivateKey.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/Rsa/PublicKey.php b/src/PublicKey/Rsa/PublicKey.php index 1fce4b1..82e8404 100644 --- a/src/PublicKey/Rsa/PublicKey.php +++ b/src/PublicKey/Rsa/PublicKey.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/PublicKey/RsaOptions.php b/src/PublicKey/RsaOptions.php index 6e883f1..b268cfd 100644 --- a/src/PublicKey/RsaOptions.php +++ b/src/PublicKey/RsaOptions.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/Exception/ExceptionInterface.php b/src/Symmetric/Exception/ExceptionInterface.php index 8d604f3..c7ddf38 100644 --- a/src/Symmetric/Exception/ExceptionInterface.php +++ b/src/Symmetric/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/Exception/InvalidArgumentException.php b/src/Symmetric/Exception/InvalidArgumentException.php index 4f8e44a..d157cff 100644 --- a/src/Symmetric/Exception/InvalidArgumentException.php +++ b/src/Symmetric/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/Exception/RuntimeException.php b/src/Symmetric/Exception/RuntimeException.php index 90c1488..152634c 100644 --- a/src/Symmetric/Exception/RuntimeException.php +++ b/src/Symmetric/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/Mcrypt.php b/src/Symmetric/Mcrypt.php index 265be5d..7410a8d 100755 --- a/src/Symmetric/Mcrypt.php +++ b/src/Symmetric/Mcrypt.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/Padding/PaddingInterface.php b/src/Symmetric/Padding/PaddingInterface.php index 24924a7..24050c3 100644 --- a/src/Symmetric/Padding/PaddingInterface.php +++ b/src/Symmetric/Padding/PaddingInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/Padding/Pkcs7.php b/src/Symmetric/Padding/Pkcs7.php index 9589aa5..1c8066b 100644 --- a/src/Symmetric/Padding/Pkcs7.php +++ b/src/Symmetric/Padding/Pkcs7.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/PaddingPluginManager.php b/src/Symmetric/PaddingPluginManager.php index 736447a..48ae069 100644 --- a/src/Symmetric/PaddingPluginManager.php +++ b/src/Symmetric/PaddingPluginManager.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Symmetric/SymmetricInterface.php b/src/Symmetric/SymmetricInterface.php index 2410dd9..7e0ce06 100644 --- a/src/Symmetric/SymmetricInterface.php +++ b/src/Symmetric/SymmetricInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/SymmetricPluginManager.php b/src/SymmetricPluginManager.php index 6a8e73a..5f49ccc 100644 --- a/src/SymmetricPluginManager.php +++ b/src/SymmetricPluginManager.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Utils.php b/src/Utils.php index b966336..ff013dc 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ From 5399a57a10cc427b927756efeca0ecac65c5ea6e Mon Sep 17 00:00:00 2001 From: auterium Date: Mon, 3 Mar 2014 11:48:06 -0700 Subject: [PATCH 3/7] Added testcase Tested against 0 (integer), 0.0 (float), and '0' (string). All 3 values should be accepted --- test/BlockCipherTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/BlockCipherTest.php b/test/BlockCipherTest.php index 1940ab3..41c3c3d 100644 --- a/test/BlockCipherTest.php +++ b/test/BlockCipherTest.php @@ -149,6 +149,23 @@ public function testEncryptDecryptUsingBinary() } } + public function testEncryptDecryptUsingZero() + { + $possibleValues = array(0, 0.0, '0'); + $this->blockCipher->setKey('test'); + $this->blockCipher->setKeyIteration(1000); + foreach ($this->blockCipher->getCipherSupportedAlgorithms() as $algo) { + $this->blockCipher->setCipherAlgorithm($algo); + + foreach($passibleValues as $plaintext) { + $encrypted = $this->blockCipher->encrypt($plaintext); + $this->assertTrue(!empty($encrypted)); + $decrypted = $this->blockCipher->decrypt($encrypted); + $this->assertEquals($decrypted, $plaintext); + } + } + } + public function testDecryptAuthFail() { $this->blockCipher->setKey('test'); From 4273182b20a4c5cb4c523a05290a4abd6c237c30 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 11 Dec 2013 15:11:08 +0700 Subject: [PATCH 4/7] remove 5.3.11 check --- test/Password/BcryptTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Password/BcryptTest.php b/test/Password/BcryptTest.php index e44455d..a98ca1a 100644 --- a/test/Password/BcryptTest.php +++ b/test/Password/BcryptTest.php @@ -33,7 +33,7 @@ public function setUp() $this->salt = '1234567890123456'; $this->password = 'test'; $this->prefix = '$2y$'; - + $this->bcryptPassword = $this->prefix . '10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y'; } From 7a092004c0c0d1d6cf9764fce07fdeab38a34e0d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 15 Feb 2014 21:55:16 +0700 Subject: [PATCH 5/7] remove if on BcryptTest::testVerifyFailureVersion() --- test/Password/BcryptTest.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/Password/BcryptTest.php b/test/Password/BcryptTest.php index a98ca1a..9844500 100644 --- a/test/Password/BcryptTest.php +++ b/test/Password/BcryptTest.php @@ -117,16 +117,13 @@ public function testVerify() public function testVerifyFailureVersion() { - $test = (substr(crypt('test', '$2y$04$012345678901234567890123456789'), 0, 3) === '$2y'); - if (!$test) { - // We don't support new style hashes, test verify failure - $hash = '$y2$14$MTIzNDU2Nzg5MDEyMzQ1NeWUUefVlefsTbFhsbqKFv/vPSZBrSFVm'; - $this->setExpectedException('Zend\Crypt\Password\Exception\RuntimeException', - 'The supplied password hash could not be verified. Please check ' . - 'backwards compatibility settings.' - ); - $this->bcrypt->verify('test', $hash); - } + // We don't support new style hashes, test verify failure + $hash = '$y2$14$MTIzNDU2Nzg5MDEyMzQ1NeWUUefVlefsTbFhsbqKFv/vPSZBrSFVm'; + $this->setExpectedException('Zend\Crypt\Password\Exception\RuntimeException', + 'The supplied password hash could not be verified. Please check ' . + 'backwards compatibility settings.' + ); + $this->bcrypt->verify('test', $hash); } public function testPasswordWith8bitCharacter() From b1af4a3d6ed3f5387b97b9f6494c087156fb1ad9 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 4 Mar 2014 08:48:53 +0700 Subject: [PATCH 6/7] remove BcryptTest::testVerifyFailureVersion() because already >5.3.7 --- test/Password/BcryptTest.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/Password/BcryptTest.php b/test/Password/BcryptTest.php index 9844500..d7833cc 100644 --- a/test/Password/BcryptTest.php +++ b/test/Password/BcryptTest.php @@ -115,17 +115,6 @@ public function testVerify() $this->assertFalse($this->bcrypt->verify(substr($this->password, -1), $this->bcryptPassword)); } - public function testVerifyFailureVersion() - { - // We don't support new style hashes, test verify failure - $hash = '$y2$14$MTIzNDU2Nzg5MDEyMzQ1NeWUUefVlefsTbFhsbqKFv/vPSZBrSFVm'; - $this->setExpectedException('Zend\Crypt\Password\Exception\RuntimeException', - 'The supplied password hash could not be verified. Please check ' . - 'backwards compatibility settings.' - ); - $this->bcrypt->verify('test', $hash); - } - public function testPasswordWith8bitCharacter() { $password = 'test' . chr(128); From d0b71b7246f6b23971ee83ffb1e4bd07a91bf98b Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 10 Mar 2014 13:00:35 -0500 Subject: [PATCH 7/7] [zendframework/zf2#5902] Implement fix for issue demonstrated in test - Changed test to use a data provider - Implemented a fix for the behavior demonstrated by the test --- src/BlockCipher.php | 12 +++++++++++- src/Symmetric/Mcrypt.php | 3 ++- test/BlockCipherTest.php | 25 +++++++++++++++++-------- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/BlockCipher.php b/src/BlockCipher.php index 0b9b0e8..d2c7517 100644 --- a/src/BlockCipher.php +++ b/src/BlockCipher.php @@ -391,9 +391,19 @@ public function getPbkdf2HashAlgorithm() public function encrypt($data) { // 0 (as integer), 0.0 (as float) & '0' (as string) will return false, though these should be allowed - if (!is_string($data) || $data === '') { + // Must be a string, integer, or float in order to encrypt + if ((is_string($data) && $data === '') + || is_array($data) + || is_object($data) + ) { throw new Exception\InvalidArgumentException('The data to encrypt cannot be empty'); } + + // Cast to string prior to encrypting + if (!is_string($data)) { + $data = (string) $data; + } + if (empty($this->cipher)) { throw new Exception\InvalidArgumentException('No symmetric cipher specified'); } diff --git a/src/Symmetric/Mcrypt.php b/src/Symmetric/Mcrypt.php index 7410a8d..2c6c90d 100755 --- a/src/Symmetric/Mcrypt.php +++ b/src/Symmetric/Mcrypt.php @@ -326,7 +326,8 @@ public function getPadding() */ public function encrypt($data) { - if (empty($data)) { + // Cannot encrypt empty string + if (!is_string($data) || $data === '') { throw new Exception\InvalidArgumentException('The data to encrypt cannot be empty'); } if (null === $this->getKey()) { diff --git a/test/BlockCipherTest.php b/test/BlockCipherTest.php index 142242d..14826ff 100644 --- a/test/BlockCipherTest.php +++ b/test/BlockCipherTest.php @@ -156,20 +156,29 @@ public function testEncryptDecryptUsingBinary() } } - public function testEncryptDecryptUsingZero() + public function zeroValuesProvider() + { + return array( + '"0"' => array(0), + '"0.0"' => array(0.0), + '"0"' => array('0'), + ); + } + + /** + * @dataProvider zeroValuesProvider + */ + public function testEncryptDecryptUsingZero($value) { - $possibleValues = array(0, 0.0, '0'); $this->blockCipher->setKey('test'); $this->blockCipher->setKeyIteration(1000); foreach ($this->blockCipher->getCipherSupportedAlgorithms() as $algo) { $this->blockCipher->setCipherAlgorithm($algo); - foreach($passibleValues as $plaintext) { - $encrypted = $this->blockCipher->encrypt($plaintext); - $this->assertTrue(!empty($encrypted)); - $decrypted = $this->blockCipher->decrypt($encrypted); - $this->assertEquals($decrypted, $plaintext); - } + $encrypted = $this->blockCipher->encrypt($value); + $this->assertTrue(!empty($encrypted)); + $decrypted = $this->blockCipher->decrypt($encrypted); + $this->assertEquals($value, $decrypted); } }