Description of problem: Try to add an sshkey with a private key, unexpected messages are returned. Version-Release number of selected component (if applicable): rhc-0.99.1 How reproducible: Always Steps to Reproduce: 1. Generate a pair of sshkeys with ssh-keygen ssh-keygen -f newkey1 2. try to add an sshkey with a private key rhc sshkey add invalid newkey1 Actual results: [openshift@fc17 .ssh]$ rhc sshkey add invalid newkey1 /usr/local/share/gems/gems/net-ssh-2.5.2/lib/net/ssh/key_factory.rb:101:in `load_data_public_key': not a public key "" (OpenSSL::PKey::PKeyError) from /usr/local/share/gems/gems/rhc-0.99.1/lib/rhc/commands/sshkey.rb:59:in `add' from /usr/local/share/gems/gems/rhc-0.99.1/lib/rhc/commands.rb:103:in `block (3 levels) in to_commander' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:180:in `call' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command' from /usr/local/share/gems/gems/rhc-0.99.1/lib/rhc/command_runner.rb:30:in `run!' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!' from /usr/local/share/gems/gems/rhc-0.99.1/lib/rhc/cli.rb:40:in `start' from /usr/local/share/gems/gems/rhc-0.99.1/bin/rhc:62:in `<top (required)>' from /usr/local/bin/rhc:23:in `load' from /usr/local/bin/rhc:23:in `<main>' Expected results: Should return message showing this key type is invalid instead of massive backtrace Additional info: There is no such problem with previous rhc client version rhc-0.98.14
Previously, I do not believe we verified the data before uploading to the server. Now we do, and we did not all the exceptions that can be throwing while doing so. Will fix it shortly.
https://github.com/openshift/rhc/pull/163
Fix is merged in. Move it to ON_QA to verify this bug with latest client.
Verified with rhc-0.99.2 Steps: 1. Generate a pair of sshkeys with ssh-keygen ssh-keygen -f newkey1 2. try to add an sshkey with a private key rhc sshkey add invalid newkey1 Result: Reasonable message is displayed: hjw@my .ssh$ rhc sshkey add invalid newkey1 File 'newkey1' contains invalid data
https://github.com/J5/rhc/pull/17 Note that this is a contrived use case where we had not tested previously.
J5 and I came to the conclusion that we should not cater to this highly unlikely scenario.