logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

phpgwapi/inc class.crypto.inc.php,1.23,1.24: msg#00094

Subject: phpgwapi/inc class.crypto.inc.php,1.23,1.24
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


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe