From bbb89995f4a2bd6cb4fe82cccd8835e76af4cef5 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 5 Dec 2007 15:48:01 +0000 Subject: [PATCH] Fixed substr order git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8027 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/daemon/gosa-sc | 5 +---- contrib/daemon/gosa-sd | 5 +---- contrib/daemon/gosa-sd-bus | 6 +----- 3 files changed, 3 insertions(+), 13 deletions(-) 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; } -- 2.30.2