summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carling <lowe@lowe.nu>2019-10-31 01:14:50 +0100
committerAnders Carling <lowe@lowe.nu>2019-10-31 01:14:50 +0100
commitcda6272c358061ec744c6cdcd7b86d704baec426 (patch)
tree67affdf943ccc3a3f721df11db0a33c4d17edd02
parent5d74905694504ef49a5101ca546c313dda83aa6a (diff)
downloadnet-ssh-cda6272c358061ec744c6cdcd7b86d704baec426.tar.gz
Add integration test using cert and key from ssh-agent
-rw-r--r--test/integration/test_cert_user_auth.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/integration/test_cert_user_auth.rb b/test/integration/test_cert_user_auth.rb
index 963665f..e8109f4 100644
--- a/test/integration/test_cert_user_auth.rb
+++ b/test/integration/test_cert_user_auth.rb
@@ -25,6 +25,23 @@ unless ENV['NET_SSH_NO_ED25519']
assert_equal "hello from:net_ssh_1\n", ret
end
end
+
+ def test_ed25519_with_cert_in_agent
+ Dir.mktmpdir do |dir|
+ with_agent do
+ sh "rm -rf #{dir}/id_rsa_ed25519 #{dir}/id_rsa_ed25519.pub"
+ sh "ssh-keygen -q -f #{dir}/id_rsa_ed25519 -t ed25519 -N 'pwd'"
+ sign_user_key('net_ssh_1',"#{dir}/id_rsa_ed25519.pub")
+ ssh_add("#{dir}/id_rsa_ed25519", "pwd")
+ sh "rm -rf #{dir}/id_rsa_ed25519 #{dir}/id_rsa_ed25519.pub #{dir}/id_rsa_ed25519-cert.pub"
+
+ ret = Net::SSH.start("localhost", "net_ssh_1") do |ssh|
+ ssh.exec! 'echo "hello from:$USER"'
+ end
+ assert_equal "hello from:net_ssh_1\n", ret
+ end
+ end
+ end
end
end