PlRPC
view release on metacpan or search on metacpan
handling of $\. Brian McCauley
<b.a.mccauley@bham.ac.uk>
2001-03-26 Jochen Wiedmann <jochen.wiedmann at freenet.de> (0.2014)
* lib/RPC/PlClient.pm: Documentation fixes
Joel Meulenberg <joelmeulenberg@yahoo.com>
2001-01-23 Jochen Wiedmann <jochen.wiedmann at freenet.de> (0.2014)
* lib/RPC/PlServer.pm: Changed DES->new to Crypt::DES->new.
(Thanks heaven, DES is now a standard module!) Paul
Schinder <schinder@pobox.com>
2001-01-22 Jochen Wiedmann <jochen.wiedmann at freenet.de> (0.2013)
* lib/RPC/PlClient.pm (DESTROY): $@ was possibly destroyed.
Tushar <tushar_pokle@pacific.net.au>
1999-06-26 Jochen Wiedmann <jochen.wiedmann at freenet.de> (0.2012)
package.) Simple, eh? :-)
The RPC::PlServer and RPC::PlClient are abstract servers and clients:
You have to derive your own classes from it.
Additional options
The RPC::PlServer inherits all of Net::Daemon's options and attributes
and adds the following:
*cipher*
The attribute value is an instance of Crypt::DES, Crypt::IDEA or
any other class with the same API for block encryption. If you
supply such an attribute, the traffic between client and server
will be encrypted using this option.
*maxmessage* (--maxmessage=size)
The size of messages exchanged between client and server is
restricted, in order to omit denial of service attacks. By
default the limit is 65536 bytes.
users This is an attribute of the client object used for Permit/Deny
lib/RPC/PlClient.pm view on Meta::CPAN
=item compression
Set this to off (default, no compression) or gzip (requires the
Compress::Zlib module).
=item cipher
This attribute can be used to add encryption quite easily. PlRPC is not
bound to a certain encryption method, but to a block encryption API. The
attribute is an object supporting the methods I<blocksize>, I<encrypt>
and I<decrypt>. For example, the modules Crypt::DES and Crypt::IDEA
support such an interface.
Note that you can set or remove encryption on the fly (putting C<undef>
as attribute value will stop encryption), but you have to be sure,
that both sides change the encryption mode.
Example:
use Crypt::DES;
$cipher = Crypt::DES->new(pack("H*", "0123456789abcdef"));
$client = RPC::PlClient->new('cipher' => $cipher,
...);
=item maxmessage
The size of messages exchanged between client and server is restricted,
in order to omit denial of service attacks. By default the limit is
65536 bytes.
=item debug
lib/RPC/PlServer.pm view on Meta::CPAN
=head2 Additional options
The RPC::PlServer inherits all of Net::Daemon's options and attributes
and adds the following:
=over 8
=item I<cipher>
The attribute value is an instance of Crypt::DES, Crypt::IDEA or any
other class with the same API for block encryption. If you supply
such an attribute, the traffic between client and server will be
encrypted using this option.
=item I<maxmessage> (B<--maxmessage=size>)
The size of messages exchanged between client and server is restricted,
in order to omit denial of service attacks. By default the limit is
65536 bytes.
# -*- perl -*-
#
require 5.004;
use strict;
eval { require Crypt::DES };
if ($@ || $Crypt::DES::VERSION < 2.03) {
print "1..0\n";
exit 0;
}
require "t/lib.pl";
my $numTests = 18;
my $numTest = 0;
my $hostkey = 'b3a6d83ef3187ac4';
my $userkey = '9823adc3287efa98';
# Create a configfile with host encryption.
my $cfg = <<"EOF";
require Crypt::DES;
{
clients => [ {
'mask' => '^127\.0\.0\.1\$',
'accept' => 1,
'cipher' => Crypt::DES->new(pack("H*", "$hostkey")),
'users' => [ {
'name' => 'bob'
},
{
'name' => 'jim',
'cipher' => Crypt::DES->new(pack("H*", "$userkey"))
} ] }
]
}
EOF
if (!open(FILE, ">t/crypt.cfg") || !(print FILE ($cfg)) || !close(FILE)) {
die "Error while creating config file t/crypt.cfg: $!";
}
my($handle, $port);
($handle, $port) = Net::Daemon::Test->Child($numTests,
$^X, '-Iblib/lib',
'-Iblib/arch',
't/server', '--mode=single',
'--debug', '--timeout', 60,
'--configfile', 't/crypt.cfg');
require Crypt::DES;
my $hostcipher = Crypt::DES->new(pack("H*", $hostkey));
my $usercipher = Crypt::DES->new(pack("H*", $userkey));
my @opts = ('peeraddr' => '127.0.0.1', 'peerport' => $port, 'debug' => 1,
'application' => 'CalcServer', 'version' => 0.01,
'timeout' => 20, 'usercipher' => $hostcipher);
RunTests('user' => 'bob', @opts);
RunTests('usercipher' => $usercipher, 'user' => 'jim', @opts);
$handle->Terminate() if $handle;
( run in 0.542 second using v1.01-cache-2.11-cpan-6a3a7a3954e )