Subject: | RSA1.pm : Argument "ssh-rsa" isn't numeric in numeric eq (==) |
When trying to connect to an SSH v1 server, I obtain Argument "ssh-rsa"
isn't numeric in numeric eq (==) at
/usr/lib/perl5/vendor_perl/5.8.5/Net/SSH/Perl/Key/RSA1.pm line 97
Here's the test script I used:
#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use Data::Dumper;
my $host = '192.168.0.45';
my $user = 'myUser';
my $pass = 'ssshhh';
my $cmd = 'show mac-address-table';
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print $stdout;
exit 1;
When modifying the equal sub in Key/RSA1.pm to contain the following
sub equal {
my($keyA, $keyB) = @_;
use Data::Dumper;
print Dumper($keyA);
print Dumper($keyB);
$keyA->{rsa} && $keyB->{rsa} &&
$keyA->{rsa}{bits} == $keyB->{rsa}{bits} &&
$keyA->{rsa}{n} == $keyB->{rsa}{n} &&
$keyA->{rsa}{e} == $keyB->{rsa}{e};
}
I obtain the output:
$VAR1 = bless( {
'rsa' => {
'e' => bless( do{\(my $o = 140896376)},
'Math::GMP' ),
'n' => bless( do{\(my $o = 140817992)},
'Math::GMP' ),
'bits' => 768
}
}, 'Net::SSH::Perl::Key::RSA1' );
$VAR1 = bless( {
'rsa' => {
'e' =>
'AAAAB3NzaC1yc2EAAAADAQABAAAAYQC4dacqHbcKP2BGUakcmYOESGtBnChwD0t631jtRxWReFAzlXaRtxe8+H02ZPftnsa4l2uqujbG1xdZCSqPIf08JgfJnmtK52RqtYqoxRr5f6PjzuBpDTOr6I0sZzlueL0=',
'n' => undef,
'bits' => 'ssh-rsa'
}
}, 'Net::SSH::Perl::Key::RSA1' );