Red Hat Bugzilla – Bug 982524
Show garbage strings when adding invalid public sshkey which with blank key type
Last modified: 2015-05-14 22:24:05 EDT
Description of problem:
Modify the public ssh key with removing the key type in the beginning of the id_rsa.pub. Then try to add the invalid key to my account. Some garbage strings will show in the warning message.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Remove the key type in a public ssh key
2.Add the above public key via rhc client
rhc sshkey add key ~/.ssh/invalid_id_rsa.pub
$ rhc sshkey add key1 invalid_id_rsa.pub -d
DEBUG: Using config file /home/bmeng/.openshift/express.conf
DEBUG: #<NotImplementedError: unsupported key type `ZjXh��hq�]�f�'>
File 'invalid_id_rsa.pub' does not appear to be a recognizable key file (unsupported key type `ZjXh��hq�]�f�'). You may specify the '--confirm' flag to add the key
Should not show the garbage strings.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=953473
This bug reported the related issue and marked as Won't fix. But the output is more ugly for now.
Because of the way that OpenSSL is designed, we have no way of handling this beyond what we do today. There are many types of keys, and we don't know whether a key will always have a visible type. So we can't filter out the garbage characters.