diff options
author | Anders Carling <lowe@lowe.nu> | 2019-10-31 02:57:14 +0100 |
---|---|---|
committer | Anders Carling <lowe@lowe.nu> | 2019-10-31 02:57:14 +0100 |
commit | 13cc8ba6d8255ccc18e66da8ee801cd3b7f160f3 (patch) | |
tree | bc2e49ffea5f2bded9cc8de1b5574f95c973bffc | |
parent | 68e6ec391b7951e504037e515cf0b70942dc2f67 (diff) | |
download | net-ssh-13cc8ba6d8255ccc18e66da8ee801cd3b7f160f3.tar.gz |
Test signing using explicitly loaded keycert
-rw-r--r-- | test/authentication/test_key_manager.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/authentication/test_key_manager.rb b/test/authentication/test_key_manager.rb index 3f4c108..98fe675 100644 --- a/test/authentication/test_key_manager.rb +++ b/test/authentication/test_key_manager.rb @@ -214,6 +214,14 @@ module Authentication assert_equal "abcxyz123", manager.sign(rsa_pk, "hello, world") end + def test_sign_with_agent_originated_key_should_be_signable_through_explicitly_loaded_cert + stub_explicit_file_cert File.expand_path("/cert"), rsa_cert + manager.stubs(:agent).returns(agent) + manager.each_identity { |identity| } # preload the known_identities + agent.expects(:sign).with(rsa_pk, "hello, world").returns("abcxyz123") + assert_equal "abcxyz123", manager.sign(rsa_cert, "hello, world") + end + def test_sign_with_file_originated_key_should_load_private_key_and_sign_with_it manager.stubs(:agent).returns(nil) first = File.expand_path("/first") |