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

Error: EVP_PKEY_sign: passed a null parameter #899

Open
a-m-a-r-t-i-n opened this issue Feb 15, 2023 · 0 comments
Open

Error: EVP_PKEY_sign: passed a null parameter #899

a-m-a-r-t-i-n opened this issue Feb 15, 2023 · 0 comments

Comments

@a-m-a-r-t-i-n
Copy link

Expected behavior

To be able to connect to a server via a ECDSA ssh key

Actual behavior

When using an ecdsa key Ive generated I can ssh to my test server without problem, but the snippet of code below fails using the same key & user. When I use an rsa key and connect to the same server the code works.

System configuration

  • net-ssh version 7.0.1
  • Ruby version 3.1.0

Example App

require 'net/ssh'

Net::SSH.start(
  'myserver', 
  'user',
  :keys => [ "~/.ssh/id_ecdsa" ],
 ) do |session|
   session.exec "uptime"
end

Error:

/opt/ruby/3.1.0/openssl/pkey.rb:254:in `rescue in dsa_sign_asn1': EVP_PKEY_sign: passed a null parameter (OpenSSL::PKey::ECError)
        from /opt/ruby/3.1.0/openssl/pkey.rb:251:in `dsa_sign_asn1'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/transport/openssl.rb:246:in `ssh_do_sign'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/key_manager.rb:174:in `sign'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/methods/publickey.rb:60:in `authenticate_with_alg'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/methods/publickey.rb:126:in `authenticate_with'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/methods/publickey.rb:19:in `block in authenticate'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/key_manager.rb:131:in `block in each_identity'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/key_manager.rb:128:in `each'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/key_manager.rb:128:in `each_identity'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/methods/publickey.rb:18:in `authenticate'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/session.rb:87:in `block in authenticate'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/session.rb:71:in `each'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh/authentication/session.rb:71:in `authenticate'
        from /opt/ruby/gems/3.1.0/gems/net-ssh-7.0.1/lib/net/ssh.rb:254:in `start'
        from ./try-ecdsa-connect.rb:9:in `<main>'
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

1 participant