From: cajus Date: Wed, 5 Dec 2007 15:48:01 +0000 (+0000) Subject: Fixed substr order X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bbb89995f4a2bd6cb4fe82cccd8835e76af4cef5;p=gosa.git Fixed substr order git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8027 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/contrib/daemon/gosa-sc b/contrib/daemon/gosa-sc index 6167310bd..a626f2c36 100755 --- a/contrib/daemon/gosa-sc +++ b/contrib/daemon/gosa-sc @@ -540,10 +540,7 @@ sub decrypt_msg { #=============================================================================== sub create_ciphering { my ($passwd) = @_; - my $passwd_length = length($passwd); - my $multiplier = int($passwd_length / 32) + 1; - my $extension = 32*$multiplier - $passwd_length; - $passwd = substr(0,32, 32x$passwd); + $passwd = substr("$passwd"x32, 0, 32); my $my_cipher = Crypt::Rijndael->new($passwd , Crypt::Rijndael::MODE_CBC ); return $my_cipher; diff --git a/contrib/daemon/gosa-sd b/contrib/daemon/gosa-sd index 18583f109..b02c31417 100755 --- a/contrib/daemon/gosa-sd +++ b/contrib/daemon/gosa-sd @@ -911,10 +911,7 @@ sub decrypt_msg { #=============================================================================== sub create_ciphering { my ($passwd) = @_; - my $passwd_length = length($passwd); - my $multiplier = int($passwd_length / 32) + 1; - my $extension = 32*$multiplier - $passwd_length; - $passwd = substr(0,32, 32x$passwd); + $passwd = substr("$passwd"x32, 0, 32); my $my_cipher = Crypt::Rijndael->new($passwd , Crypt::Rijndael::MODE_CBC ); return $my_cipher; diff --git a/contrib/daemon/gosa-sd-bus b/contrib/daemon/gosa-sd-bus index dd9d3d448..5235c0e07 100755 --- a/contrib/daemon/gosa-sd-bus +++ b/contrib/daemon/gosa-sd-bus @@ -820,11 +820,7 @@ sub send_msg_hash2all { #=============================================================================== sub create_ciphering { my ($passwd) = @_; - # passwd has to be of multiple length of 32, depend on Crypt::Rijndael::MODE_CBC - my $passwd_length = length $passwd; - my $multiplier = int($passwd_length / 32) + 1; - my $extension = 32*$multiplier - $passwd_length; - $passwd = substr(0,32, 32x$passwd); + $passwd = substr("$passwd"x32, 0, 32); my $my_cipher = Crypt::Rijndael->new($passwd , Crypt::Rijndael::MODE_CBC ); return $my_cipher; }