4
use Test::Simple tests => 5;
9
pipe (FROM_CLIENT,TO_PARENT) or die "pipe failed.";
10
pipe (FROM_PARENT,TO_CLIENT) or die "pipe failed.";
15
my $host = "hyade11.ifh.de";
24
my $sasl = Authen::SASL->new (
27
canonuser => \&canonuser,
28
authorize => \&authorize,
29
getsecret => \&getsecret,
30
checkpass => \&checkpass,
35
my $conn = $sasl->server_new($service) or die "Authen::SASL::Cyrus failed." or
39
print $conn->listmech("","|",""),"\n";
41
sendreply( $conn->server_start( getreply(\*FROM_CLIENT) ),\*TO_CLIENT );
44
while ($conn->need_step) {
45
sendreply( $conn->server_step( &getreply(\*FROM_CLIENT) ) ,\*TO_CLIENT );
48
if ($conn->code == 0) {
50
print "Server: Test successful Negotiation succeeded.\n";
53
print "Server: Negotiation failed.\n",$conn->error(),"\n";
64
my $sasl = Authen::SASL->new (
67
user => \&getusername,
68
pass => \&getpassword,
69
auth => \&getauthname,
71
) or die "Authen::SASL failed.";
73
my $conn = $sasl->client_new($service, $host)
74
or die "Authen::SASL::Cyrus failed.";
76
sendreply($conn->client_start(),*TO_PARENT);
78
while ($conn->need_step) {
79
sendreply($conn->client_step( &getreply(*FROM_PARENT) ),*TO_PARENT );
82
if ($conn->code == 0) {
83
print "Client: Negotiation succeeded.\n";
85
print "Client: Negotiation failed.\n",$conn->error,"\n";