cvs: php4 /pear/Crypt CBC.php
| From: | Colin Viebrock | Date: | Thu, 20 Dec 2001 17:12:32 +0000 |
| Subject: | cvs: php4 /pear/Crypt CBC.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1637@lists.php.net to get a copy of this message | ||
cmv Thu Dec 20 12:12:32 2001 EDT
Modified files:
/php4/pear/Crypt CBC.php
Log:
Fix
Index: php4/pear/Crypt/CBC.php
diff -u php4/pear/Crypt/CBC.php:1.11 php4/pear/Crypt/CBC.php:1.12
--- php4/pear/Crypt/CBC.php:1.11 Tue Dec 18 11:29:33 2001
+++ php4/pear/Crypt/CBC.php Thu Dec 20 12:12:32 2001
@@ -41,7 +41,7 @@
* the author of libcrypt decides to name things internally.
*
*
-* @version $Id: CBC.php,v 1.11 2001/12/18 16:29:33 cmv Exp $
+* @version $Id: CBC.php,v 1.12 2001/12/20 17:12:32 cmv Exp $
* @author Colin Viebrock <colin@easydns.com>
* @author Mike Glover <mpg4@duluoz.net>
* @access public
@@ -234,13 +234,14 @@
return $this->raiseError('mcrypt_generic_init failed' );
}
$cblock = mcrypt_generic($this->TD, $iv^$block );
- if (!mcrypt_generic_end($this->TD)) {
- return $this->raiseError('mcrypt_generic_end failed' );
- }
$iv = $cblock;
$crypt .= $cblock;
}
+ if (!mcrypt_generic_end($this->TD)) {
+ return $this->raiseError('mcrypt_generic_end failed' );
+ }
+
$this->last_crypt = $crypt;
return $crypt;
@@ -285,11 +286,12 @@
return $this->raiseError('mcrypt_generic_init failed' );
}
$block = $iv ^ mdecrypt_generic($this->TD, $cblock);
- if (!mcrypt_generic_end($this->TD)) {
- return $this->raiseError('mcrypt_generic_end failed' );
- }
$iv = $cblock;
$clear .= $block;
+ }
+
+ if (!mcrypt_generic_end($this->TD)) {
+ return $this->raiseError('mcrypt_generic_end failed' );
}
/* remove the padding from the end of the cleartext */