From 5a7c0a1c07205ada619c4f39015055853d4ed261 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 5 Dec 2007 16:34:07 +0000 Subject: [PATCH] Fixed communication git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8029 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/daemon/gosa-sc | 5 ++--- contrib/daemon/gosa-sd | 4 ++-- contrib/daemon/gosa-sd-bus | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/contrib/daemon/gosa-sc b/contrib/daemon/gosa-sc index a626f2c36..c8cd0f04a 100755 --- a/contrib/daemon/gosa-sc +++ b/contrib/daemon/gosa-sc @@ -510,7 +510,7 @@ sub encrypt_msg { my $msg_length = length($msg); my $multiplier = int($msg_length / 16) + 1; my $extension = 16*$multiplier - $msg_length; - $msg = $msg."\0"x$extension; + $msg = "0"x$extension.$msg; my $crypted_msg = $my_cipher->encrypt($msg); #my $crypted_msg = $msg; return $crypted_msg; @@ -526,8 +526,7 @@ sub encrypt_msg { sub decrypt_msg { my ($crypted_msg, $my_cipher) =@_; my $msg = $my_cipher->decrypt($crypted_msg); - $msg =~ s/\0*$//gi; - $msg =~ s/\0$//gi; + $msg =~ s/^0*$//g; return $msg; } diff --git a/contrib/daemon/gosa-sd b/contrib/daemon/gosa-sd index 613987bad..ed72ccc5e 100755 --- a/contrib/daemon/gosa-sd +++ b/contrib/daemon/gosa-sd @@ -908,7 +908,7 @@ sub encrypt_msg { my $msg_length = length($msg); my $multiplier = int($msg_length / 16) + 1; my $extension = 16*$multiplier - $msg_length; - $msg = $msg."\0"x$extension; + $msg = "0"x$extension.$msg; my $crypted_msg = $my_cipher->encrypt($msg); #my $crypted_msg = $msg; return $crypted_msg; @@ -925,7 +925,7 @@ sub encrypt_msg { sub decrypt_msg { my ($crypted_msg, $my_cipher) = @_ ; my $msg = $my_cipher->decrypt($crypted_msg); - $msg =~ s/\0*$//gi; + $msg =~ s/^0*//g; return $msg; } diff --git a/contrib/daemon/gosa-sd-bus b/contrib/daemon/gosa-sd-bus index 5235c0e07..f4282e39d 100755 --- a/contrib/daemon/gosa-sd-bus +++ b/contrib/daemon/gosa-sd-bus @@ -568,7 +568,7 @@ sub encrypt_msg { my $msg_length = length($msg); my $multiplier = int($msg_length / 16) + 1; my $extension = 16*$multiplier - $msg_length; - $msg = $msg."\0"x$extension; + $msg = "0"x$extension.$msg; my $crypted_msg = $my_cipher->encrypt($msg); #my $crypted_msg = $msg; return $crypted_msg; @@ -586,8 +586,7 @@ sub decrypt_msg { my ($crypted_msg, $my_cipher) =@_; my $len = length $crypted_msg; my $msg = $my_cipher->decrypt($crypted_msg); - $msg =~ s/\0*$//gi; - $msg =~ s/\0$//gi; + $msg =~ s/^0*//g; return $msg; } -- 2.30.2