|
|
Log in / Subscribe / Register

Using certificates for SSH authentication

Using certificates for SSH authentication

Posted Nov 8, 2022 21:13 UTC (Tue) by mjg59 (subscriber, #23239)
In reply to: Using certificates for SSH authentication by jonesmz
Parent article: Using certificates for SSH authentication

OpenSSH upstream has been pretty clear about not wanting to support that for understandable reasons (asn.1 parsing is extremely hard to get right). Thankfully it's possible to do this without having to patch OpenSSH - https://github.com/mjg59/ssh_pki (I do not recommend doing this)


to post comments

Using certificates for SSH authentication

Posted Nov 8, 2022 23:47 UTC (Tue) by mss (subscriber, #138799) [Link] (2 responses)

asn.1 parsing is extremely hard to get right
I guess you mean BER here, since that's how X.509 certificates are usually encoded.

One is supposed to use a well-established library for doing such parsing (no new hand-crafted parsers in C please), so the main issue here is whether the project could take an additional external dependency.

Using certificates for SSH authentication

Posted Nov 9, 2022 5:43 UTC (Wed) by buck (subscriber, #55985) [Link]

> I guess you mean BER here, since that's how X.509 certificates are usually encoded.

Wouldn't it be DER, so there's no choice of whether to use indefinite-length encoding and other such things that lead to a multitude of possibilities for finding hash collisions? Or maybe it's just whatever the PKCS or IETF specs say, more to the point.

At any rate, trusting the X.509 public CA ecosystem, while convenient, has its downsides. This recent article (paywalled, after free monthly article limit exceeded, i believe) offers a particularly compelling case study:

Mysterious company with government ties plays key internet role

https://www.washingtonpost.com/technology/2022/11/08/trus...

Using certificates for SSH authentication

Posted Nov 9, 2022 8:33 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

DER is just the serialisation of the asn.1 data, and even well-established parsers have had bugs. That's why my approach (which, again, I do not recommend people use) has that done out of process in a language that's rather less vulnerable to the standard parsing fuckups.

Using certificates for SSH authentication

Posted Nov 9, 2022 20:25 UTC (Wed) by edeloget (subscriber, #88392) [Link]

For those interested, there is a whole ssh clone out there which already allows the use of X.509 certificates. It's based upon openssh and has been maintained for years (and, hopefully, will continue to be maintained).

https://roumenpetrov.info/secsh/


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds