Bug 641082 - Can't handle ECDSA keys
Can't handle ECDSA keys
Status: NEW
Product: gnome-keyring
Classification: Core
Component: ssh-agent
3.2.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
:
: 693059 (view as bug list)
Depends on: 672140 672144 672145 735873
Blocks:
  Show dependency tree
 
Reported: 2011-01-31 22:06 UTC by Ionut Biru
Modified: 2016-07-07 18:48 UTC (History)
44 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments

Description Ionut Biru 2011-01-31 22:06:09 UTC
openssh 5.7 has support for ECDSA keys.

http://www.openssh.com/txt/release-5.7

when using such key, gnome-keyring can't unlock the key and ask for the passphrase. 

it doesn't catch the event to ask the passphrase and if ssh-add is used from terminal it gaves:

ssh-add .ssh/alderaan_root
Enter passphrase for .ssh/alderaan_root: 
Error reading response length from authentication socket.
Could not add identity: .ssh/alderaan_root


once i kill the ssh-agent started by gnome-keyring, i can use the newly key.

Steps to reproduce:
1) ssh-keygen -t ecdsa
2) relogin and try to login to the remote server
3) notice that the passphrase is not asked via gnome-keyring
4) try to add using ssh-add
Comment 1 Gaute Hope 2012-03-01 11:18:03 UTC
Any progress on this one? I think severity+1 would be appropriate.

Regards, Gaute
Comment 2 Stef Walter 2012-03-01 13:02:15 UTC
Just make sure to actually find someone to do the work if you want increase the bug severity :P

I spent an afternoon on it a while back, and it's on my list of things to work on. But certainly not happening in 3.4 because of lack of time. Sorry bout that.
Comment 3 Chris Danis 2012-03-13 14:34:00 UTC
Stef,

Do you have a patch from your afternoon of time, even a broken one?

I spent a few hours on this yesterday, but I'm pretty unfamiliar with all the codebases involved here, so didn't figure too much out...

Thanks.
-Chris
Comment 4 Stef Walter 2012-03-13 20:50:02 UTC
My first focus was trying to spend time figuring out how libgcrypt 'does' ECDSA. Including the S-expressions for the public and private keys, the DER formats that they're found in and so on.

Also looked for examples of libgcrypt ECDSA usage, but couldn't find any. Anyway, getting this information together would be the first step.

If you're interested, and willing to put in time to work on it, I can take some time to compile the locations where ECDSA would need to be added in order to get the ssh-agent and ssh-store working with it. LMK.
Comment 5 Chris Danis 2012-03-14 00:58:45 UTC
I did find this post, which looks modestly useful:

http://lists.gnupg.org/pipermail/gcrypt-devel/2010-January/001564.html

Let me try to figure out how much time I'll actually have available to work on this, and get back to you.
Comment 6 Stef Walter 2012-03-15 14:50:38 UTC
I've broken this up into various tasks that need to be done before ECDSA support makes it into gnome-keyring. I've added tasks into the depnedencies of this bug, and there is an entire tree here:

https://bugzilla.gnome.org/showdependencytree.cgi?id=641082

Chris (or anyone else), if you have time to work on some of these steps, whether research or implementation, that would be really wonderful.

The first research steps are:

 * Bug #672148 : Research: figure out how to do ECDSA with libgcrypt
 * Bug #672137 : Research: ASN.1 definitions for ECDSA
 * Bug #672139 : Research: Identify PKCS#11 ECDSA operations relevant to openssh
Comment 7 Stef Walter 2012-03-31 20:37:14 UTC
So, after doing a bit of research I've come to get a bit of feel for the patent uncertainty around ECC.

My employer (Red Hat) does not ship ECC code due to the software patent claims on ECC. So for the time being I personally won't be investing time into adding ECC support to gnome-keyring's ssh-agent.

That shouldn't prevent others from working on it. I've mapped out what needs to be done above, and in the linked bugs.
Comment 8 Alexander E. Fischer 2012-11-08 18:20:08 UTC
I would also like to see ECDSA support soon in gnome-keyring.
Comment 9 Winston Weinert 2012-12-08 21:55:22 UTC
I would also enjoy ECDSA support in gnome-keyring as I always mistype my passphrases at login and if you do that enough with a host that's utilizing denyhosts you can get locked out! :D

(In reply to comment #6)
> https://bugzilla.gnome.org/showdependencytree.cgi?id=641082
I've a novice to gnome-keyring and cryptography; I'll see how I can help.
Comment 10 Stef Walter 2013-02-04 21:22:52 UTC
*** Bug 693059 has been marked as a duplicate of this bug. ***
Comment 11 t.ask 2013-12-31 17:13:55 UTC
I can successfully SSH login with an ecdsa key by manually enter the password ... 

Yet, I want to add it to Gnome Keyring via 'ssh-add /path/to/privid' and I always get the following error message 'Error reading response length from authentication socket.'

Is there any progress with this bug?
Comment 12 t.ask 2013-12-31 17:26:58 UTC
I got it running by doing the following steps. Which doesn't solve the issue, but helps as a workaround:

$ echo $SSH_AUTH_SOCK
/run/user/1000/keyring-goxqaf/ssh

$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-CkimhXH5DSM/agent.5447; export SSH_AUTH_SOCK;
SSH_AGENT_PID=5448; export SSH_AGENT_PID;
echo Agent pid 5448;

Now copy the "SSH_AUTH_SOCK=/tmp/ssh-CkimhXH5DSM/agent.5447" part and enter:

$ SSH_AUTH_SOCK=/tmp/ssh-CkimhXH5DSM/agent.5447

Then you are able to add the ECDSA key (not to Gnome Keyring) to the SSH agent. Those IDs might change. Therefore, it's not recommended for daily use.
Comment 13 Mantas Mikulėnas 2013-12-31 17:46:08 UTC
(In reply to comment #12)
> I got it running by doing the following steps. Which doesn't solve the issue,
> but helps as a workaround:
> 
> …etc…
> 
> Then you are able to add the ECDSA key (not to Gnome Keyring) to the SSH agent.
> Those IDs might change. Therefore, it's not recommended for daily use.

The usual method for doing this is one of:

    eval $(ssh-agent)

    exec ssh-agent bash

    …or disabling "gnome-keyring-ssh.desktop" in XDG Autostart.

But, of course, it doesn't help people who specifically want to use GNOME Keyring, which is what this bug report is all about.
Comment 14 Elad Alfassa 2014-06-05 22:28:30 UTC
(In reply to comment #7)
> So, after doing a bit of research I've come to get a bit of feel for the patent
> uncertainty around ECC.
> 
> My employer (Red Hat) does not ship ECC code due to the software patent claims
> on ECC. So for the time being I personally won't be investing time into adding
> ECC support to gnome-keyring's ssh-agent.

Is this still the case? Fedora does ship with ECDSA support. If it had patent issues I'd imagine redhat would remove it from Fedora, no?
Comment 15 Stef Walter 2014-06-06 05:30:31 UTC
You're right. The situation has indeed changed. I simply haven't had time to work on this. Work on gnome-keyring is done in my (very little) free time.

Personally, I would like to find a way to call into the openssh ssh-agent rather than reimplement the all the new algorithms. But open to contributions either way.
Comment 16 Mantas Mikulėnas 2014-06-06 05:35:55 UTC
Maybe just import the necessary files from OpenSSH, as pam_ssh is doing?

ECDSA is one thing, but now there's also a whole new key storage format which it uses for Ed25519 (and optionally other types), which is even more work.
Comment 17 Stef Walter 2014-06-06 05:38:35 UTC
Yes, exactly Ed25519 is what removed the doubt any doubt in my mind that I don't want to be maintaining a whole reimplemented ssh agent.

I don't think copying over files from OpenSSH would be easy, but I wouldn't be against someone stepping up to do that and maintaining it.
Comment 18 David Strauss 2014-07-10 19:00:59 UTC
Stef, if you'd looking for funding to complete this work, I would be happy to provide it.
Comment 19 Stef Walter 2014-08-29 13:36:52 UTC
Some work on this in the ssh-wip git branch.
Comment 20 Jean-Christophe Berthon 2015-09-05 18:37:20 UTC
Great news about the wip!

I will have a look at it.

On Seahorse side, I've opened a bug as the support is missing as well. (https://bugzilla.gnome.org/show_bug.cgi?id=754028) And a patch has been proposed.
Comment 21 Chris Murphy 2016-02-12 07:53:24 UTC
The main issue I'm having is the lack of available documentation to get gnome-keyring to step aside and just depend on ssh-agent for this. Comment 13 is partly helpful, but after a reboot ssh-agent isn't running so it's not a persistent fix. I opened bug 761896 to hopefully get the wiki updated since it contains stale information on how to do this.
Comment 22 John Morton 2016-06-09 02:46:03 UTC
(In reply to Chris Murphy from comment #21)
> The main issue I'm having is the lack of available documentation to get
> gnome-keyring to step aside and just depend on ssh-agent for this. 

This is the most durable why I've found:

mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/gnome-keyring-ssh.desktop ~/.config/autostart/
echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/gnome-keyring-ssh.desktop

Upstart session jobs honour the X-GNOME-Autostart-enabled=false flag, as does the xdg/autostart stuff, but you do seem to need all the fields filled to ensure that the local autostart desktop file takes precedence over the system wide one.
Comment 23 John Morton 2016-06-09 03:08:46 UTC
(In reply to Stef Walter from comment #17)
> Yes, exactly Ed25519 is what removed the doubt any doubt in my mind that I
> don't want to be maintaining a whole reimplemented ssh agent.
> 
> I don't think copying over files from OpenSSH would be easy, but I wouldn't
> be against someone stepping up to do that and maintaining it.

Any reason not to just proxy directly to the OpenSSH ssh-agent binary?

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