Update of /cvsroot/popfile/engine/UI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23155/UI
Modified Files:
HTML.pm HTTP.pm
Log Message:
Add two global configuration variables, crypt_strength and crypt_device, and use them in calls to Crypt::Random::makerandom_octet.
They default to 0 and '', respectively.
Advanced users can set crypt_strength to 1, but the average user should be happier with 0. The super-advanced user can even specify his own random device.
Index: HTML.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v
retrieving revision 1.378
retrieving revision 1.379
diff -C2 -d -r1.378 -r1.379
*** HTML.pm 2 Dec 2007 12:07:23 -0000 1.378
--- HTML.pm 2 Dec 2007 17:27:47 -0000 1.379
***************
*** 391,398 ****
# The IP address of the client that set the cookie
# MD5 checksum of the data (hex encoded)
!
! $cookie_string = encode_base64( makerandom_octet( Length => 16,
! Strength => 1 ),
! '' );
$cookie_string .= ' ';
$cookie_string .= time;
--- 391,402 ----
# The IP address of the client that set the cookie
# MD5 checksum of the data (hex encoded)
! $self->log_( 1, "Generating random octet" );
! $cookie_string = encode_base64(
! makerandom_octet(
! Length => 16,
! Strength => $self->global_config_( 'crypt_strength' ),
! Device => $self->global_config_( 'crypt_device' )
! ),
! '' );
$cookie_string .= ' ';
$cookie_string .= time;
Index: HTTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTTP.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** HTTP.pm 31 Jan 2007 10:45:09 -0000 1.36
--- HTTP.pm 2 Dec 2007 17:27:47 -0000 1.37
***************
*** 37,41 ****
use Crypt::CBC;
! use Crypt::Random;
use MIME::Base64;
--- 37,41 ----
use Crypt::CBC;
! use Crypt::Random qw/makerandom_octet/;
use MIME::Base64;
***************
*** 100,105 ****
# Think of an encryption key for encrypting cookies using Blowfish
!
! my $key = Crypt::Random::makerandom_octet( Length => 56, Strength => 1 );
$self->{crypto__} = new Crypt::CBC( { 'key' => $key,
'cipher' => 'Blowfish',
--- 100,109 ----
# Think of an encryption key for encrypting cookies using Blowfish
! $self->log_( 1, "Generating random octet" );
! my $key = makerandom_octet(
! Length => 56,
! Strength => $self->global_config_( 'crypt_strength' ),
! Device => $self->global_config_( 'crypt_device' )
! );
$self->{crypto__} = new Crypt::CBC( { 'key' => $key,
'cipher' => 'Blowfish',
|