summaryrefslogtreecommitdiffstats
path: root/system/libraries/Encryption.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-04 16:21:37 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-04 16:21:37 +0100
commit912831f589862c205d5b9837b710aa391460e08d (patch)
treefab70022088702477f56c74bba63a3b127beedda /system/libraries/Encryption.php
parent29cade43cc0a86c4a1a531c2649c4830d29ac2fc (diff)
CI_Encryption: Fix some errors and add unit tests for hkdf()
Diffstat (limited to 'system/libraries/Encryption.php')
-rw-r--r--system/libraries/Encryption.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php
index 6e71d6ee1..4258aee53 100644
--- a/system/libraries/Encryption.php
+++ b/system/libraries/Encryption.php
@@ -125,15 +125,6 @@ class CI_Encryption {
$this->initialize($params);
- if (empty($this->_driver))
- {
- $this->_driver = ($this->_drivers['mcrypt'] === TRUE)
- ? 'mcrypt'
- : 'openssl';
-
- log_message('debug', "Encryption: Auto-configured driver '".$params['driver']."'.");
- }
-
isset($this->_key) OR $this->_key = config_item('encryption_key');
if (empty($this->_key))
{
@@ -172,6 +163,15 @@ class CI_Encryption {
}
}
+ if (empty($this->_driver))
+ {
+ $this->_driver = ($this->_drivers['mcrypt'] === TRUE)
+ ? 'mcrypt'
+ : 'openssl';
+
+ log_message('debug', "Encryption: Auto-configured driver '".$this->_driver."'.");
+ }
+
empty($params['key']) OR $this->_key = $params['key'];
$this->{'_'.$this->_driver.'_initialize'}($params);
return $this;
@@ -807,7 +807,7 @@ class CI_Encryption {
*/
public function __get($key)
{
- return in_array($key, array('cipher', 'mode', 'driver', 'drivers'), TRUE)
+ return in_array($key, array('cipher', 'mode', 'driver', 'drivers', 'digests'), TRUE)
? $this->{'_'.$key}
: NULL;
}