After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 556670 - Cannot import a SSH key from a file
Cannot import a SSH key from a file
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: general
git master
Other All
: Normal major
: 2.28.0
Assigned To: Seahorse Maintainer
Seahorse Maintainer
Depends on:
Blocks:
 
 
Reported: 2008-10-17 06:46 UTC by Jeff Cai
Modified: 2009-12-07 07:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make importing SSH keys work on Solaris. (1.43 KB, patch)
2008-11-04 13:25 UTC, Jeff Cai
rejected Details | Review
Use g_file_info_get_content_type (845 bytes, patch)
2009-10-21 01:53 UTC, Jeff Cai
accepted-commit_after_freeze Details | Review

Description Jeff Cai 2008-10-17 06:46:59 UTC
Seahorse cann't import ssh key from a ssh key file. This is because Seahorse looks the file as a PGP key file.

1. I exported a SSH key to a file with the extension .asc, for example, aa.asc
2. xdg-mime query filetype aa.asc
the result is application/pgp-encrypted, in fact, it should be "application/x-ssh-key". 

so seahorse_util_detect_data_type returns an incorrect data type.
Comment 1 Jeff Cai 2008-11-04 13:25:11 UTC
Created attachment 121956 [details] [review]
Make importing SSH keys work on Solaris. 

By default, the mime type of the imported file is SEAHORSE_SSH. Since PGP is not supported on Solaris, just return it directly. Do you have better fix for this?
Comment 2 Adam Schreiber 2008-11-04 15:06:39 UTC
The way this works in GNOME is that we've installed a mime type for application/x-ssh-key.  I'm not sure how mime types work in Solaris, but you may want to patch that with some of the xml from seahorse-plugins/plugins/nautilus/seahorse.xml.
Comment 3 Sebastien Bacher 2009-01-29 12:32:05 UTC
there is a bug similar on https://bugs.edge.launchpad.net/bugs/321997

"Binary package hint: seahorse

Public SSH keys can't be imported into Seahorse, either copying or from the File dialog.

When copying any public key from Launchpad directly in the "Trusted keys" tab, the key is somehow changed or interpreted as an OpenPGP key.

When tyring to import it via the File > Import dialog in Hardy there is an "Invalid file format" error. The file I try to import is named "pubkey.asc", saved using the "Save this page" feature in Firefox when displaying public keys in Launchpad.

When tyring to import it via the File > Import dialog in Intrepid it silently fails.

This may be related to Bug #150654 , Bug #230537 or both.

I am filing a new bug as I am only interested in public keys importing, as a part of setting up public key authentication for SSH access/tunneling."
Comment 4 Stef Walter 2009-03-03 04:13:46 UTC
Import needs a complete overhaul and we hope to have that completed for 2.28.
Comment 5 Jeff Cai 2009-10-20 07:13:33 UTC
Nautilus can recognize the file as 'ssh-key-file' while xdg-mime cannot. Seahorse should use the same method as Nautilus to get the file type.
Comment 6 Jeff Cai 2009-10-21 01:31:20 UTC
Nautilus uses g_file_info_get_content_type while seahorse uses g_content_type_guess.
Comment 7 Jeff Cai 2009-10-21 01:53:10 UTC
Created attachment 145912 [details] [review]
Use g_file_info_get_content_type 

This patch can fix the error that happens when a user imports a SSH key file. But it doesn't fix the issue when importing from the clipboard.
Comment 8 Stef Walter 2009-10-21 02:03:25 UTC
Review of attachment 145912 [details] [review]:

Looks good. We should commit this after gnome-2-28 branch.
Comment 9 Jeff Cai 2009-11-06 04:15:20 UTC
Committed to HEAD.
Comment 10 Pablo Castellano (IRC: pablog) 2009-11-06 11:41:43 UTC
(In reply to comment #9)
> Committed to HEAD.

Hello Jeff. I have tried but it still doesn't work for me. The status bar says "Imported keys" but they are not shown.
Does it work for you?
Comment 11 Jeff Cai 2009-12-07 07:57:12 UTC
The key is imported to the other category.