Bug 982524 - Show garbage strings when adding invalid public sshkey which with blank key type
Summary: Show garbage strings when adding invalid public sshkey which with blank key type
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-09 08:54 UTC by Meng Bo
Modified: 2015-05-15 02:24 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-09 18:32:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Meng Bo 2013-07-09 08:54:04 UTC
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):
rhc-1.11.2
devenv_3463

How reproducible:
always

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
3.

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
anyway.


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 18:32:29 UTC
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.