5 ms·
It hasn't been able to do it in a meaningful way. I've been patching support for this into ssh-agent for about a decade. I wrote a PKCS#11 module which talks
by rkeene2 5y ago
It hasn't been able to do it in a meaningful way.
I've been patching support for this into ssh-agent for about a decade. I wrote a PKCS#11 module which talks to the SSH agent socket to forward your smartcard [0]. Doing so requires three changes to the protocol:
1. The ability to sign arbitrary data and get back the signed result [1]; normally you get back a hashed result [2].
2. The ability to decrypt data, this is what you said. This is less important since many things only require signatures (and not all algorithms support encryption/decryption).
3. The ability to request your certificates [3] [4] this one is kinda obvious.
The benefits of this are that you can use your smartcard on the remote host to do fully authenticated password-less sudo with pam_pkcs11. You can also do anything else that requires you to use your private key to be used, which can include fetching files (TLS client certificate authentication).
Within the US Government, passwords have been being phased out since 2004, but the requirements for authenticated privilege elevation remain.
Another way to accomplish this is to use SSH forwarding of your PC/SC socket but that's less portable and more fragile (and even less secure).
[0] https://github.com/rkeene/ssh-agent-pkcs11 https://github.com/rkeene/ssh-agent-pkcs11
[1] https://cackey.rkeene.org/fossil/artifact/0d0e90bbfdee672c?ln=481-482%20561-563%20573-576 https://cackey.rkeene.org/fossil/artifact/0d0e90bbfdee672c?l...
[2] https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent-00#section-4.5.1 https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent...
[3] https://cackey.rkeene.org/fossil/artifact/0d0e90bbfdee672c?ln=296-312 https://cackey.rkeene.org/fossil/artifact/0d0e90bbfdee672c?l...
[4] https://datatracker.ietf.org/doc/html/rfc6187#section-2.1 https://datatracker.ietf.org/doc/html/rfc6187#section-2.1
- visualphoenix 5y agoIs there a benefit to using ssh-agent in this way instead of using gpg-agent as an ssh provider?
- rkeene2 5y agoYou get X.509 certificates from the smartcard which can be used much more widely than GPG
- fanf2 5y agoHave you published your ssh-agent patches?
- rkeene2 5y agoYes, though primarily forge.mil as a patched OpenSSH source. It was based on an original PKCS#11 support [0] [1]. An old version of the patch is pretty small and available here [2]. Additionally, I wrote an SSH Agent (in JavaScript, for ChromeOS, but works on any platform) that has these modifications [3]. I use this more frequently these days (via Tcl [4]). [0] https://marc.info/?l=openssh-bugs&m=119214228626872 https://marc.info/?l=openssh-bugs&m=119214228626872 [1] https://rkeene.org/viewer/archive/openssh/openssh-4.4p1pkcs11-0.17.patch.htm?listing=long https://rkeene.org/viewer/archive/openssh/openssh-4.4p1pkcs1... [2] https://rkeene.org/viewer/archive/openssh/openssh-4.5p1-pkcs11forward.diff.htm?listing=long https://rkeene.org/viewer/archive/openssh/openssh-4.5p1-pkcs... [3] https://cackey.rkeene.org/fossil/artifact/0d0e90bbfdee672c https://cackey.rkeene.org/fossil/artifact/0d0e90bbfdee672c [4] https://cackey.rkeene.org/fossil/artifact/183583332c474aa9 https://cackey.rkeene.org/fossil/artifact/183583332c474aa9
- fanf2 5y agoThanks!