Re: anyone using certificates with an empty principals section?

Ashutosh Ghosh via openssh-unix-dev <[email protected]>
Newsgroups gmane.network.openssh.devel
Message-ID <[email protected]>
Sorry, I should have been more precise:

If I set the principals to the empty array [], then a pre-10.3 client will trigger the special case in sshkey.c when nprincipals==0 and treat it as a wildcard:

	// Pre 10.3 client
	if (k->cert->nprincipals == 0) {
		if (require_principal) {
			*reason = "Certificate lacks principal list";
			return SSH_ERR_KEY_CERT_INVALID;
		}
	}

So I can't set any principals or that wildcard special case will not trigger.

> The better alternative would be to make your hostname stable somehow

For some situations yes, but hosts that I am concerned about are embedded devices with no DNS/name resolution capabilities who can only be accessed by IP address (and their IP address is whatever they get from DHCP)

________________________________________
From: Jörn Heissler <[email protected]>
Sent: Saturday, 8 August 2026 02:55
To: Ashutosh Ghosh <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: anyone using certificates with an empty principals section?
 
On Sat, Aug 08, 2026 at 07:52:01 +0000, Ashutosh Ghosh via openssh-unix-dev wrote:
> I'm very late to this party, sorry! I have been using host certificates with empty principals and today I got the first user with an OpenSSH 10.3 client report an issue (I think macOS 26.6 released a few days ago is bundling OpenSSH 10.3p1).
>
> I think the way this patch is implemented makes it impossible to have a backwards compatible host certificate. If I set the principals to "*", then a pre-10.3 client will not accept it; if I don't set it to "*" for a wildcard certificate then a post-10.3 client will not accept it.
>
> For my use case, the hostname and IP address are not stable so I don't have a way to express the set of valid hostnames in advance.
>
> Am I missing something? Is there a way to issue a certificate that is effectively a wildcard for both old and new clients?

Hi,

did you try creating a cert with two principals, "" and "*"?

The better alternative would be to make your hostname stable somehow.
Perhaps the HostKeyAlias client option can help you with that.

Jörn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.