Update of /cvsroot/egroupware/phpgwapi/inc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27130
Modified Files:
class.crypto.inc.php
Log Message:
Add some more debug notes and turn debug off during login/logout/home
Index: class.crypto.inc.php
===================================================================
RCS file: /cvsroot/egroupware/phpgwapi/inc/class.crypto.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** class.crypto.inc.php 14 Dec 2003 17:06:11 -0000 1.23
--- class.crypto.inc.php 7 Feb 2004 03:38:35 -0000 1.24
***************
*** 38,41 ****
--- 38,48 ----
function crypto($vars='')
{
+ if($GLOBALS['phpgw_info']['flags']['currentapp'] ==
'login' ||
+ $GLOBALS['phpgw_info']['flags']['currentapp']
== 'logout' ||
+ $GLOBALS['phpgw_info']['flags']['currentapp']
== 'home'
+ )
+ {
+ $this->debug = False;
+ }
if(is_array($vars))
{
***************
*** 50,54 ****
$iv = $vars[1];
! if ($GLOBALS['phpgw_info']['server']['mcrypt_enabled']
&& extension_loaded('mcrypt'))
{
if($GLOBALS['phpgw_info']['server']['mcrypt_algo'])
--- 57,61 ----
$iv = $vars[1];
! if($GLOBALS['phpgw_info']['server']['mcrypt_enabled']
&& extension_loaded('mcrypt'))
{
if($GLOBALS['phpgw_info']['server']['mcrypt_algo'])
***************
*** 69,76 ****
$this->enabled = True;
$this->mcrypt_version =
$GLOBALS['phpgw_info']['server']['versions']['mcrypt'];
! if ($this->mcrypt_version == 'old')
{
$this->td = False;
! if (phpversion() > '4.0.2pl1')
{
$keysize =
mcrypt_get_key_size($this->algo);
--- 76,83 ----
$this->enabled = True;
$this->mcrypt_version =
$GLOBALS['phpgw_info']['server']['versions']['mcrypt'];
! if($this->mcrypt_version == 'old')
{
$this->td = False;
! if(phpversion() > '4.0.2pl1')
{
$keysize =
mcrypt_get_key_size($this->algo);
***************
*** 86,90 ****
{
/* Start up mcrypt */
! $this->td = mcrypt_module_open
($this->algo, '', $this->mode, '');
$ivsize =
mcrypt_enc_get_iv_size($this->td);
--- 93,97 ----
{
/* Start up mcrypt */
! $this->td =
mcrypt_module_open($this->algo, '', $this->mode, '');
$ivsize =
mcrypt_enc_get_iv_size($this->td);
***************
*** 94,98 ****
/* Hack IV to be the correct size */
$x = strlen($iv);
! for ($i = 0; $i < $ivsize; $i++)
{
$this->iv .= $iv[$i % $x];
--- 101,105 ----
/* Hack IV to be the correct size */
$x = strlen($iv);
! for($i = 0; $i < $ivsize; $i++)
{
$this->iv .= $iv[$i % $x];
***************
*** 102,118 ****
$x = strlen($key);
! for ($i = 0; $i < $keysize; $i++)
{
$this->key .= $key[$i % $x];
}
}
! /* If mcrypt isn't loaded, key and iv are not needed. */
}
function cleanup()
{
! if ($this->enabled)
{
! if ($this->mcrypt_version != 'old')
{
if(phpversion >= '4.1.1')
--- 109,132 ----
$x = strlen($key);
! for($i = 0; $i < $keysize; $i++)
{
$this->key .= $key[$i % $x];
}
}
! else
! {
! /* If mcrypt isn't loaded, key and iv are not
needed. */
! if($this->debug)
! {
! echo '<br>crypto: mycrypt unavailable
or disabled';
! }
! }
}
function cleanup()
{
! if($this->enabled)
{
! if($this->mcrypt_version != 'old')
{
if(phpversion >= '4.1.1')
***************
*** 159,163 ****
/* Disable all encryption if the admin didn't set it up
*/
! if ($this->enabled)
{
if($_obj)
--- 173,177 ----
/* Disable all encryption if the admin didn't set it up
*/
! if($this->enabled)
{
if($_obj)
***************
*** 175,179 ****
}
! switch ($this->mcrypt_version)
{
case 'old':
--- 189,193 ----
}
! switch($this->mcrypt_version)
{
case 'old':
***************
*** 183,187 ****
default:
/* Handle 2.4 and newer API */
! mcrypt_generic_init ($this->td,
$this->key, $this->iv);
$encrypteddata =
mcrypt_generic($this->td, $data);
break;
--- 197,201 ----
default:
/* Handle 2.4 and newer API */
! mcrypt_generic_init($this->td,
$this->key, $this->iv);
$encrypteddata =
mcrypt_generic($this->td, $data);
break;
***************
*** 212,219 ****
}
/* Disable all encryption if the admin didn't set it up
*/
! if ($this->enabled)
{
$data = $this->hex2bin($encrypteddata);
! switch ($this->mcrypt_version)
{
case 'old':
--- 226,233 ----
}
/* Disable all encryption if the admin didn't set it up
*/
! if($this->enabled)
{
$data = $this->hex2bin($encrypteddata);
! switch($this->mcrypt_version)
{
case 'old':
***************
*** 223,227 ****
default:
/* Handle 2.4 and newer API */
! mcrypt_generic_init ($this->td,
$this->key, $this->iv);
$data =
mdecrypt_generic($this->td, $data);
break;
--- 237,241 ----
default:
/* Handle 2.4 and newer API */
! mcrypt_generic_init($this->td,
$this->key, $this->iv);
$data =
mdecrypt_generic($this->td, $data);
break;
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
|