git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gpg.ssh.defaultKeyCommand docs bug?

From
Jeff King <peff@peff.net>
Date
Oct 11, 2023, 23:41 UTC
Message-ID
<20231011234131.GO518221@coredump.intra.peff.net>
In-Reply-To
<CAHKF-AsjY_P6mbAs7KWcgL39KbLbu9OE9XiLabghhTn-f0ybzQ@mail.gmail.com>
On Wed, Oct 11, 2023 at 02:16:27PM -0400, matthew sporleder wrote:
> It gave very confusing errors!
> 
> key::ssh-rsa ABC123 me@localhost (no new line)
> error: Load key "....: invalid format?

It's hard to say without seeing the whole output, but I suspect this is actually coming from ssh, not Git. We just dump the output into a tempfile and feed it to "ssh-keygen -f".

Though I'd think we would see the same issue with user.signingKey in that case.

So I'm not sure what's going on here (I haven't set up ssh signing to play with yet).

> key::ABC123 (yes new line)
> error: Couldn't load public key ...: No such file or directory?

That one makes sense to me. The "ssh-rsa" part is important, because without it, ssh-keygen has no idea what format it is in.

> key::ssh-rsa ABC123 me@localhost (yes new line)
> works, I think
This is the recommended format.
> ssh-rsa ABC123 me@localhost (yes new line)
> works (the script I provided)
And this is the historical one.

So I don't think the documentation is _wrong_ here, but I agree that it is a bit on the confusing side (especially understanding that "key::" came later, and that raw "ssh-rsa" is deprecated, which is only mentioned in user.signingKey, not gpg.ssh.defaultKeyCommand.

And I'm still not sure what's going on with your no-new-line example, which I'd have expected to work.

-Peff
Previous: matthew sporleder
Message 4 of 4 in “gpg.ssh.defaultKeyCommand docs bug?”
  1. matthew sporlederOct 6, 2023
  2. Jeff KingOct 9, 2023
  3. matthew sporlederOct 11, 2023
  4. Jeff KingOct 11, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.