Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"You tweachewous miscweant!" -- Elmer Fudd


devel / comp.security.ssh / Re: Question about certificate based authentication

SubjectAuthor
* Question about certificate based authenticationColin McAllister
`* Re: Question about certificate based authenticationColin McAllister
 `- Re: Question about certificate based authenticationSimon Tatham

1
Question about certificate based authentication

<997d4f44-8c7c-4c91-a816-9cf905e498ecn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=288&group=comp.security.ssh#288

  copy link   Newsgroups: comp.security.ssh
X-Received: by 2002:ac8:4e53:0:b0:3a5:a2:3461 with SMTP id e19-20020ac84e53000000b003a500a23461mr20162420qtw.490.1667399140099;
Wed, 02 Nov 2022 07:25:40 -0700 (PDT)
X-Received: by 2002:a81:b4b:0:b0:367:dde8:681 with SMTP id 72-20020a810b4b000000b00367dde80681mr23021299ywl.516.1667399139870;
Wed, 02 Nov 2022 07:25:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.security.ssh
Date: Wed, 2 Nov 2022 07:25:39 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=204.77.163.55; posting-account=PZi_igoAAABhNfHKd1aJHV9zvHJsD9K6
NNTP-Posting-Host: 204.77.163.55
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <997d4f44-8c7c-4c91-a816-9cf905e498ecn@googlegroups.com>
Subject: Question about certificate based authentication
From: colin.mc...@garmin.com (Colin McAllister)
Injection-Date: Wed, 02 Nov 2022 14:25:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2564
 by: Colin McAllister - Wed, 2 Nov 2022 14:25 UTC

Hello,

I've been trying to understand how to use the new certificate-based authentication mechanism released in PuTTY 0.78. I'm familiar with the traditional workflow for OpenSSH certificate-based authentication, but following that procedure does not appear to work with PuTTY.

In PuTTY, I have tried using a PPK file and an OpenSSH signed certificate associated with the private key (I originally generated a OpenSSH private key and imported it with PuTTYgen and created a PPK private key as well), but that does not appear to work. I get an error that PuTTY is 'Unable to use certificate file "..." (not a public key or a PuTTY SSH-2 private key)'.

I read the release docs and it seems like I need a PuTTY PPK key with a certificate attached, do I use PuTTYgen to create that?

I have tried using the "Add certificate to key" option in PuTTYgen, but I can't seem to pass a certificate file that the application accepts. I have tried both passing a OpenSSH certificate or passing a key file to sign the certificate.

I'm also a little curious how this new feature will integrate with existing certificate signing servers like Smallstep's and HashiCorp's Vault SSH security engine. I would assume if the OpenSSH-formatted certificate cannot be used, the certificate signing servers would require changes to support the PuTTY certificate workflow.

Any help detailing the workflow to use the new feature would be greatly appreciated!

Thanks,
Colin

Re: Question about certificate based authentication

<86dc2df9-749e-45d8-bf49-fc823efddf85n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=289&group=comp.security.ssh#289

  copy link   Newsgroups: comp.security.ssh
X-Received: by 2002:a05:6214:27c5:b0:4bb:e819:6a5a with SMTP id ge5-20020a05621427c500b004bbe8196a5amr16285215qvb.81.1667400961189;
Wed, 02 Nov 2022 07:56:01 -0700 (PDT)
X-Received: by 2002:a81:1997:0:b0:36e:d17e:9266 with SMTP id
145-20020a811997000000b0036ed17e9266mr23839665ywz.341.1667400961035; Wed, 02
Nov 2022 07:56:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.security.ssh
Date: Wed, 2 Nov 2022 07:56:00 -0700 (PDT)
In-Reply-To: <997d4f44-8c7c-4c91-a816-9cf905e498ecn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=204.77.163.55; posting-account=PZi_igoAAABhNfHKd1aJHV9zvHJsD9K6
NNTP-Posting-Host: 204.77.163.55
References: <997d4f44-8c7c-4c91-a816-9cf905e498ecn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86dc2df9-749e-45d8-bf49-fc823efddf85n@googlegroups.com>
Subject: Re: Question about certificate based authentication
From: colin.mc...@garmin.com (Colin McAllister)
Injection-Date: Wed, 02 Nov 2022 14:56:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3806
 by: Colin McAllister - Wed, 2 Nov 2022 14:56 UTC

On Wednesday, November 2, 2022 at 9:25:40 AM UTC-5, Colin McAllister wrote:
> Hello,
>
> I've been trying to understand how to use the new certificate-based authentication mechanism released in PuTTY 0.78. I'm familiar with the traditional workflow for OpenSSH certificate-based authentication, but following that procedure does not appear to work with PuTTY.

To follow up, this does work. I figured out what the issue is.

Also, I found good documentation here if anyone else finds this and also needs help.

https://the.earth.li/~sgtatham/putty/0.78/htmldoc/Chapter4.html#config-ssh-cert

> In PuTTY, I have tried using a PPK file and an OpenSSH signed certificate associated with the private key (I originally generated a OpenSSH private key and imported it with PuTTYgen and created a PPK private key as well), but that does not appear to work. I get an error that PuTTY is 'Unable to use certificate file "..." (not a public key or a PuTTY SSH-2 private key)'.

The certificate is not valid because there are custom fields in the critical options of the certificate.

> I read the release docs and it seems like I need a PuTTY PPK key with a certificate attached, do I use PuTTYgen to create that?
>
> I have tried using the "Add certificate to key" option in PuTTYgen, but I can't seem to pass a certificate file that the application accepts. I have tried both passing a OpenSSH certificate or passing a key file to sign the certificate.

Yes, this works if I use a certificate without the custom fields in the critical options.

> I'm also a little curious how this new feature will integrate with existing certificate signing servers like Smallstep's and HashiCorp's Vault SSH security engine. I would assume if the OpenSSH-formatted certificate cannot be used, the certificate signing servers would require changes to support the PuTTY certificate workflow.

This should work fine with the current authentication flow, however I know HashiCorp Vault works with custom
>
> Any help detailing the workflow to use the new feature would be greatly appreciated!

I think I have my original questions answered, however, I'm curious about if and when custom fields in the certificate's critical options will be supported. This will be a breaking issue for anyone that chooses to do such.

I can create a separate thread to detail this issue if desired, or this thread can be also be used.

I appreciate any help in advance

Colin

>
> Thanks,
> Colin

Re: Question about certificate based authentication

<EOr*k+k2y@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=290&group=comp.security.ssh#290

  copy link   Newsgroups: comp.security.ssh
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: ana...@pobox.com (Simon Tatham)
Newsgroups: comp.security.ssh
Subject: Re: Question about certificate based authentication
Date: 02 Nov 2022 18:59:54 +0000 (GMT)
Message-ID: <EOr*k+k2y@news.chiark.greenend.org.uk>
References: <997d4f44-8c7c-4c91-a816-9cf905e498ecn@googlegroups.com> <86dc2df9-749e-45d8-bf49-fc823efddf85n@googlegroups.com>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="18056"; mail-complaints-to="abuse@chiark.greenend.org.uk"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: simon@tunnel.thyestes.tartarus.org ([172.31.80.4])
 by: Simon Tatham - Wed, 2 Nov 2022 18:59 UTC

Colin McAllister <colin.mcallister@garmin.com> wrote:
>> I have tried using the "Add certificate to key" option in PuTTYgen,
>> but I can't seem to pass a certificate file that the application
>> accepts. I have tried both passing a OpenSSH certificate or passing a
>> key file to sign the certificate.
>
> Yes, this works if I use a certificate without the custom fields in the
> critical options.

Hmmm. That _shouldn't_ happen. As far as I can see, PuTTY's
certificate code only examines the critical options if it's about to
validate the certificate during host key checking. And that's as it
should be, of course, because a critical option understood by both
your CA and your SSH server should be passed through unmodified by
PuTTY whether it understands the option or not.

And in my test just now, this worked as I expect. If I use ssh-keygen
to sign a public key with a custom critical option:

ssh-keygen -I foo -s test-ca-key -O critical:stoat=weasel -U test-user-key.pub

and then use PuTTYgen to try to incorporate the resulting certificate
file into the PPK private key, everything works as I expect, and I get
a combined PPK file saved out.

Can you share an example of a key and certificate that you're having
trouble combining? (If you can do that without the combination
actually being a security risk to expose, of course!)

--
import hashlib; print((lambda p,q,g,y,r,s,m: (lambda w:(pow(g,int(hashlib.sha1(
m.encode('ascii')).hexdigest(),16)*w%q,p)*pow(y,r*w%q,p)%p)%q)(pow(s,q-2,q))==r
and s%q!=0 and m)(12342649995480866419, 2278082317364501, 1670428356600652640,
5398151833726432125, 645223105888478, 1916678356240619, "<anakin@pobox.com>"))

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor