X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FQXProt.pm;h=b9cf952cb497a553d4fed6aa0069f09d7d20e2f5;hb=7d315a555a73d4a650405d0c2da48bacde2b1853;hp=fd945ce1a2320a13c7b826d47e849a1f44aaee4f;hpb=53c9ec8091449a91571225c59d2cdca41ca83507;p=spider.git diff --git a/perl/QXProt.pm b/perl/QXProt.pm index fd945ce1..b9cf952c 100644 --- a/perl/QXProt.pm +++ b/perl/QXProt.pm @@ -134,15 +134,6 @@ sub disconnect $self->DXProt::disconnect(@_); } -sub sendallnodes -{ -} - -sub sendallusers -{ - -} - my $msgid = 1; sub frame @@ -162,11 +153,16 @@ sub handleI { my $self = shift; - my @f = split /\^/, $_[2]; - my $inv = Verify->new($f[7]); - unless ($inv->verify($f[8], $main::me->user->passphrase, $main::mycall, $self->call)) { - $self->sendnow('D','Sorry...'); - $self->disconnect; + my @f = split /\^/, $_[3]; + if ($self->passphrase && $f[7] && $f[8]) { + my $inv = Verify->new($f[7]); + unless ($inv->verify($f[8], $main::me->user->passphrase, $main::mycall, $self->call)) { + $self->sendnow('D','Sorry...'); + $self->disconnect; + } + $self->{verified} = 1; + } else { + $self->{verified} = 0; } if ($self->{outbound}) { $self->send($self->genI); @@ -184,16 +180,20 @@ sub handleI sub genI { my $self = shift; - my $inp = Verify->new; - return frame('I', $self->call, 1, "DXSpider", ($main::version + 53) * 100, $main::build, $inp->challenge, $inp->response($self->user->passphrase, $self->call, $main::mycall)); + my @out = ('I', $self->call, "DXSpider", ($main::version + 53) * 100, $main::build); + if (my $pass = $self->user->passphrase) { + my $inp = Verify->new; + push @out, $inp->challenge, $inp->response($pass, $self->call, $main::mycall); + } + return frame(@out); } -sub handleB +sub handleR { } -sub genB +sub genR { }