Browse Source

Update docblocks

ADmad 6 years ago
parent
commit
dc938f1966
2 changed files with 8 additions and 9 deletions
  1. 0 3
      src/Utility/Crypto/OpenSsl.php
  2. 8 6
      src/Utility/Security.php

+ 0 - 3
src/Utility/Crypto/OpenSsl.php

@@ -19,9 +19,6 @@ namespace Cake\Utility\Crypto;
 /**
  * OpenSSL implementation of crypto features for Cake\Utility\Security
  *
- * OpenSSL should be favored over mcrypt as it is actively maintained and
- * more widely available.
- *
  * This class is not intended to be used directly and should only
  * be used in the context of Cake\Utility\Security.
  *

+ 8 - 6
src/Utility/Security.php

@@ -54,8 +54,8 @@ class Security
      * @param string|null $algorithm Hashing algo to use (i.e. sha1, sha256 etc.).
      *   Can be any valid algo included in list returned by hash_algos().
      *   If no value is passed the type specified by `Security::$hashType` is used.
-     * @param mixed $salt If true, automatically prepends the application's salt
-     *   value to $string (Security.salt).
+     * @param mixed $salt If true, automatically prepends the value returned by
+     *   Security::getSalt() to $string.
      * @return string Hash
      * @link https://book.cakephp.org/3.0/en/core-libraries/security.html#hashing-data
      */
@@ -152,7 +152,7 @@ class Security
     /**
      * Get the crypto implementation based on the loaded extensions.
      *
-     * You can use this method to forcibly decide between mcrypt/openssl/custom implementations.
+     * You can use this method to forcibly decide between openssl/custom implementations.
      *
      * @param \Cake\Utility\Crypto\OpenSsl|null $instance The crypto instance to use.
      * @return \Cake\Utility\Crypto\OpenSsl Crypto instance.
@@ -173,7 +173,7 @@ class Security
         }
         throw new InvalidArgumentException(
             'No compatible crypto engine available. ' .
-            'Load either the openssl or mcrypt extensions'
+            'Load the openssl extension.'
         );
     }
 
@@ -186,7 +186,8 @@ class Security
      *
      * @param string $plain The value to encrypt.
      * @param string $key The 256 bit/32 byte key to use as a cipher key.
-     * @param string|null $hmacSalt The salt to use for the HMAC process. Leave null to use Security.salt.
+     * @param string|null $hmacSalt The salt to use for the HMAC process.
+     *   Leave null to use value of Security::getSalt().
      * @return string Encrypted data.
      * @throws \InvalidArgumentException On invalid data or key.
      */
@@ -229,7 +230,8 @@ class Security
      *
      * @param string $cipher The ciphertext to decrypt.
      * @param string $key The 256 bit/32 byte key to use as a cipher key.
-     * @param string|null $hmacSalt The salt to use for the HMAC process. Leave null to use Security.salt.
+     * @param string|null $hmacSalt The salt to use for the HMAC process.
+     *   Leave null to use value of Security::getSalt().
      * @return string|null Decrypted data. Any trailing null bytes will be removed.
      * @throws \InvalidArgumentException On invalid data or key.
      */