Permalink
Browse files

*** empty log message ***

git-svn-id: http://svn.php.net/repository/pear/packages/Crypt_CBC/trunk@81581 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 628c59b commit 84dafd92463a49eaa1254871b494aab83dea0473 Colin Viebrock committed May 9, 2002
Showing with 14 additions and 4 deletions.
  1. +6 −3 CBC.php
  2. +8 −1 package.xml
View
@@ -136,11 +136,12 @@ function Crypt_CBC ($key, $cipher='DES')
return $this->raiseError('mcrypt module is not compiled into PHP', null,
PEAR_ERROR_DIE, null, 'compile PHP using "--with-mcrypt"' );
}
- if (!function_exists('mcrypt_module_open')) {
- return $this->raiseError('libmcrypt is 2.2.x', null,
- PEAR_ERROR_DIE, null, 'this class only works with libmcrypt 2.4.x and later' );
+ if (!function_exists('mcrypt_module_open') || !function_exists('mcrypt_generic_deinit')) {
+ return $this->raiseError('libmcrypt/PHP version insufficient', null,
+ PEAR_ERROR_DIE, null, 'this class only works with libmcrypt >= 2.4.x and later, and PHP >= 4.1.1' );
}
+
/* seed randomizer */
srand ((double)microtime()*1000000);
@@ -237,6 +238,7 @@ function encrypt($clear)
$cblock = mcrypt_generic($this->TD, $iv^$block );
$iv = $cblock;
$crypt .= $cblock;
+ mcrypt_generic_deinit($this->TD);
}
$this->last_crypt = $crypt;
@@ -285,6 +287,7 @@ function decrypt($crypt) {
$block = $iv ^ mdecrypt_generic($this->TD, $cblock);
$iv = $cblock;
$clear .= $block;
+ mcrypt_generic_deinit($this->TD);
}
/* remove the padding from the end of the cleartext */
View
@@ -4,7 +4,12 @@
generated package.xml files -->
<package version="1.0">
<name>Crypt_CBC</name>
- <summary>The PEAR::Crypt_CBC class to emulate Perl's Crypt::CBC module</summary>
+ <summary>
+ A class to emulate Perl's Crypt::CBC module.
+ </summary>
+ <description>
+ A class to emulate Perl's Crypt::CBC module.
+ </description>
<maintainers>
<maintainer>
<user>cmv</user>
@@ -14,6 +19,8 @@
</maintainers>
<release>
<version>0.1</version>
+ <state>stable</state>
+ <license>PHP 2.02</license>
<date>2002-04-25</date>
<notes>
This is the initial independent release of the Crypt_CBC package.

0 comments on commit 84dafd9

Please sign in to comment.