Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with default cipher and openssh 7.1p1 #2

Closed
asy972 opened this issue Feb 22, 2016 · 8 comments
Closed

problem with default cipher and openssh 7.1p1 #2

asy972 opened this issue Feb 22, 2016 · 8 comments

Comments

@asy972
Copy link

asy972 commented Feb 22, 2016

Hello.

I attempt to use Net-SSH-Perl with openssh server 7.1p1 and have a problem.
The test script:

use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new("localhost");
$ssh->login("test", "qqq");
print "--------\n";

The output:

$perl -w sshtest.pl
Use of uninitialized value $authlen in addition (+) at /usr/share/perl5/Net/SSH/Perl/Packet.pm line 198.
Use of uninitialized value $authlen in addition (+) at /usr/share/perl5/Net/SSH/Perl/Packet.pm line 198.
Argument "M-NM-i3[M-oMM-"lqM-^I\n[M+M-2LeEa<Y^^M-^Ux(^S!M-^SM-`M-^N..." isn't numeric in numeric eq (==) at /usr/share/perl5/Net/SSH/Perl/Key/Ed25519.pm line 260, <$fh> line 1.
Argument "M-NM-i3[M-oMM-"lqM-^I\n[M+M-2LeEa<Y^^M-^Ux(^S!M-^SM-`M-^N..." isn't numeric in numeric eq (==) at /usr/share/perl5/Net/SSH/Perl/Key/Ed25519.pm line 260, <$fh> line 1.
Use of uninitialized value $authlen in addition (+) at /usr/share/perl5/Net/SSH/Perl/Packet.pm line 198.
Use of uninitialized value in subroutine entry at /usr/share/perl5/Net/SSH/Perl/Cipher/ChachaPoly.pm line 51.
Use of uninitialized value in subroutine entry at /usr/share/perl5/Net/SSH/Perl/Cipher/ChachaPoly.pm line 58.
Connection closed by remote host. at /usr/share/perl5/Net/SSH/Perl/AuthMgr.pm line 45.

The log of ssh server:

Feb 22 22:51:13 sshd[7284]: Bad packet length 1802109513. [preauth]
Feb 22 22:51:13 sshd[7284]: padding error: need 1802109513 block 8 mod 1 [preauth]
Feb 22 22:51:13 sshd[7284]: fatal: ssh_dispatch_run_fatal: Connection to 127.0.0.1: message authentication code in

It works when I use (for example):
my $ssh = Net::SSH::Perl->new("localhost", cipher => 'aes256-ctr');

btw: warning remains in Ed25519.pm

@lkinley
Copy link
Owner

lkinley commented Feb 22, 2016

Can you please add the debug flag:
my $ssh = Net::SSH::Perl->new("localhost", debug => 1);

And send me the entire output. Thanks!

@asy972
Copy link
Author

asy972 commented Feb 22, 2016

localhost: Reading configuration data /home/test/.ssh/config
localhost: Reading configuration data /etc/ssh_config
localhost: Allocated local port 1023.
localhost: Connecting to localhost, port 22.
localhost: Remote version string: SSH-2.0-OpenSSH_7.1
localhost: Remote protocol version 2.0, remote software version OpenSSH_7.1
localhost: Net::SSH::Perl Version 2.01, protocol version 2.0.
localhost: No compat match: OpenSSH_7.1.
localhost: Connection established.
localhost: Sent key-exchange init (KEXINIT), wait response.
localhost: Using curve25519-sha256@libssh.org for key exchange
localhost: Host key algorithm: ssh-ed25519
localhost: Algorithms, c->s: chacha20-poly1305@openssh.com <implicit> none
localhost: Algorithms, s->c: chacha20-poly1305@openssh.com <implicit> none
localhost: Generating ephemeral key pair.
localhost: Entering Curve 25519 Key Exchange.
localhost: Sent client public key, waiting for reply.
localhost: Received host key, type 'ssh-ed25519'.
localhost: Host 'localhost' is known and matches the host key.
localhost: Verifying server signature.
localhost: Send NEWKEYS.
localhost: Waiting for NEWKEYS message.
localhost: Enabling encryption/MAC/compression.
localhost: Sending request for user-authentication service.
Connection closed by remote host. at /usr/share/perl5/Net/SSH/Perl/AuthMgr.pm line 45.

@lkinley
Copy link
Owner

lkinley commented Feb 22, 2016

I fixed the warnings and a bug in Ed25519, but was not able to duplicate your problem against a 7.1 server even before the fix. Try the latest commit and report back.

@asy972
Copy link
Author

asy972 commented Feb 23, 2016

I fixed the warnings

one warning remains (in case with empty known_hosts):

localhost: Permanently added 'localhost' to the list of known hosts.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Net/SSH/Perl/Key/Ed25519.pm line 229.

Try the latest commit and report back.

I tried another architecture. It is i586-only bug again. All works when Net::SSH::Perl is running on x86_64.

@lkinley
Copy link
Owner

lkinley commented Feb 23, 2016

What 32-bit OS and which version is this failing on?

@asy972
Copy link
Author

asy972 commented Feb 23, 2016

ALT Linux Sisyphus in both cases (x86_64 ok, i586 fail).

@lkinley
Copy link
Owner

lkinley commented Feb 23, 2016

Ok, I think I've got it fixed. Pull latest and try again.

@asy972
Copy link
Author

asy972 commented Feb 23, 2016

Thanks, it works now.

@asy972 asy972 closed this as completed Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants