Bug 982524 - Show garbage strings when adding invalid public sshkey which with blank key type
Show garbage strings when adding invalid public sshkey which with blank key type
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-07-09 04:54 EDT by Meng Bo
Modified: 2015-05-14 22:24 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-09 14:32:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2013-07-09 04:54:04 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):

How reproducible:

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

Actual results:
$ 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

Expected results:
Should not show the garbage strings.

Additional info:
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.
Comment 1 Clayton Coleman 2013-07-09 14:32:29 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.