diff options
author | Andrey Andreev <narf@devilix.net> | 2014-07-07 13:43:51 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-07-07 13:43:51 +0200 |
commit | 9fa275e6aba369fab6557284a84e2c0dda77da35 (patch) | |
tree | d242ce00ff7a80d3e37d1ec07d6107cfabb6c049 /system | |
parent | 2da3550055ea20eba309ef68347a806a3986375d (diff) |
Continuing from previous commit ... use CI_Encryption::substr()
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Encryption.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php index d47d65e8a..0b759eb5d 100644 --- a/system/libraries/Encryption.php +++ b/system/libraries/Encryption.php @@ -494,8 +494,8 @@ class CI_Encryption { return FALSE; } - $hmac_input = substr($data, 0, $digest_size); - $data = substr($data, $digest_size); + $hmac_input = self::substr($data, 0, $digest_size); + $data = self::substr($data, $digest_size); isset($params['hmac_key']) OR $params['hmac_key'] = $this->hkdf($this->_key, 'sha512', NULL, NULL, 'authentication'); $hmac_check = hash_hmac($params['hmac_digest'], $data, $params['hmac_key'], ! $params['base64']); @@ -545,8 +545,8 @@ class CI_Encryption { { if (mcrypt_enc_get_modes_name($params['handle']) !== 'ECB') { - $iv = substr($data, 0, $iv_size); - $data = substr($data, $iv_size); + $iv = self::substr($data, 0, $iv_size); + $data = self::substr($data, $iv_size); } else { @@ -573,7 +573,7 @@ class CI_Encryption { // Remove PKCS#7 padding, if necessary if (in_array(strtolower(mcrypt_enc_get_modes_name($params['handle'])), array('cbc', 'ecb'), TRUE)) { - $data = substr($data, 0, -ord($data[self::strlen($data)-1])); + $data = self::substr($data, 0, -ord($data[self::strlen($data)-1])); } mcrypt_generic_deinit($params['handle']); @@ -598,8 +598,8 @@ class CI_Encryption { { if ($iv_size = openssl_cipher_iv_length($params['handle'])) { - $iv = substr($data, 0, $iv_size); - $data = substr($data, $iv_size); + $iv = self::substr($data, 0, $iv_size); + $data = self::substr($data, $iv_size); } else { @@ -846,7 +846,7 @@ class CI_Encryption { $key .= $key_block; } - return substr($key, 0, $length); + return self::substr($key, 0, $length); } // -------------------------------------------------------------------- |