Skip to content

Commit

Permalink
removing a debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Cornutt committed Aug 4, 2012
1 parent cf9e22e commit 26a24ab
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Shield/Session.php
Expand Up @@ -70,10 +70,7 @@ public function write($id, $data)
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$keySize = mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);

$key = substr(sha1($this->_key), 0, $keySize);

error_log('WHITE iv/k: '.$iv_size.' -> '.$keySize.' --- '.strlen($key));
$key = substr(sha1($this->_key), 0, $keySize);

// add in our IV and base64 encode the data
$data = base64_encode($iv.mcrypt_encrypt(
Expand Down Expand Up @@ -108,10 +105,9 @@ public function read($id)
$data = null;

if (is_file($path)) {
$data = file_get_contents($path);

// get the data and extract the IV
$data = base64_decode($data, true);
$data = file_get_contents($path);
$data = base64_decode($data, true);

$ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
$keySize = mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
Expand Down

0 comments on commit 26a24ab

Please sign in to comment.