From 37ce7ba32e9f18cf20596d0c0c841eeda3657b64 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 5 Dec 2007 15:39:17 +0000 Subject: [PATCH] Updated password handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8026 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/daemon/gosa-sc | 5 ++--- contrib/daemon/gosa-sd | 4 +--- contrib/daemon/gosa-sd-bus | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/contrib/daemon/gosa-sc b/contrib/daemon/gosa-sc index 4f917dff9..6167310bd 100755 --- a/contrib/daemon/gosa-sc +++ b/contrib/daemon/gosa-sc @@ -526,8 +526,7 @@ sub encrypt_msg { sub decrypt_msg { my ($crypted_msg, $my_cipher) =@_; my $msg = $my_cipher->decrypt($crypted_msg); - #my $msg = $crypted_msg; - #$msg =~ s/^a*//gi; + $msg =~ s/\0*$//gi; $msg =~ s/\0$//gi; return $msg; } @@ -544,7 +543,7 @@ sub create_ciphering { my $passwd_length = length($passwd); my $multiplier = int($passwd_length / 32) + 1; my $extension = 32*$multiplier - $passwd_length; - $passwd = "a"x$extension.$passwd; + $passwd = substr(0,32, 32x$passwd); 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 b291b0425..18583f109 100755 --- a/contrib/daemon/gosa-sd +++ b/contrib/daemon/gosa-sd @@ -898,8 +898,6 @@ sub encrypt_msg { sub decrypt_msg { my ($crypted_msg, $my_cipher) = @_ ; my $msg = $my_cipher->decrypt($crypted_msg); - #my $msg = $crypted_msg; - #$msg =~ s/^a*//gi; $msg =~ s/\0*$//gi; return $msg; } @@ -916,7 +914,7 @@ sub create_ciphering { my $passwd_length = length($passwd); my $multiplier = int($passwd_length / 32) + 1; my $extension = 32*$multiplier - $passwd_length; - $passwd = "a"x$extension.$passwd; + $passwd = substr(0,32, 32x$passwd); 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 d92800238..dd9d3d448 100755 --- a/contrib/daemon/gosa-sd-bus +++ b/contrib/daemon/gosa-sd-bus @@ -586,8 +586,7 @@ sub decrypt_msg { my ($crypted_msg, $my_cipher) =@_; my $len = length $crypted_msg; my $msg = $my_cipher->decrypt($crypted_msg); - #my $msg = $crypted_msg; - #$msg =~ s/^a*//gi; + $msg =~ s/\0*$//gi; $msg =~ s/\0$//gi; return $msg; } @@ -825,7 +824,7 @@ sub create_ciphering { my $passwd_length = length $passwd; my $multiplier = int($passwd_length / 32) + 1; my $extension = 32*$multiplier - $passwd_length; - $passwd = "a"x$extension.$passwd; + $passwd = substr(0,32, 32x$passwd); my $my_cipher = Crypt::Rijndael->new($passwd , Crypt::Rijndael::MODE_CBC ); return $my_cipher; } -- 2.30.2