From dd35269722ce589df786d055b1dac8fb3f26d9b9 Mon Sep 17 00:00:00 2001 From: Bruno Ribeiro Date: Mon, 15 May 2017 22:55:07 -0300 Subject: [PATCH] set default param to hash_hmac() --- application/core/Encryption.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/core/Encryption.php b/application/core/Encryption.php index 9d59eab7d..0270fd0d7 100644 --- a/application/core/Encryption.php +++ b/application/core/Encryption.php @@ -62,7 +62,7 @@ public static function encrypt($plain) $ciphertext = $iv . $encrypted_string; // apply the HMAC - $hmac = hash_hmac('sha256', $ciphertext, $key); + $hmac = hash_hmac(self::HASH_FUNCTION, $ciphertext, $key); return $hmac . $ciphertext; } @@ -97,7 +97,7 @@ public static function decrypt($ciphertext) $iv_cipher = mb_substr($ciphertext, $macSize, null, '8bit'); // generate original hmac & compare it with the one in $ciphertext - $originalHmac = hash_hmac('sha256', $iv_cipher, $key); + $originalHmac = hash_hmac(self::HASH_FUNCTION, $iv_cipher, $key); if (!self::hashEquals($hmac, $originalHmac)) { return false; }