All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andy Lindeman via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Fabian Stelzer <fs@gigacodes.de>,
	Andy Lindeman <andy@lindeman.io>,
	Andy Lindeman <andy@lindeman.io>
Subject: [PATCH] ssh signing: Support ECDSA as literal SSH keys
Date: Mon, 30 May 2022 17:45:04 +0000	[thread overview]
Message-ID: <pull.1272.git.git.1653932705097.gitgitgadget@gmail.com> (raw)

From: Andy Lindeman <andy@lindeman.io>

Keys generated using `ssh-keygen -t ecdsa` or similar are being rejected
as literal SSH keys because the prefix is `ecdsa-sha2-nistp256`,
`ecdsa-sha2-nistp384` or `ecdsa-sha2-nistp521`.

This was acknowledged as an issue [1] in the past, but hasn't yet been
fixed.

[1]: https://github.com/git/git/pull/1041#issuecomment-971425601

Signed-off-by: Andy Lindeman <andy@lindeman.io>
---
    ssh signing: Support ECDSA as literal SSH keys
    
    Keys generated using ssh-keygen -t ecdsa or similar will currently be
    rejected as literal SSH keys because the prefix is ecdsa-sha2-nistp256,
    ecdsa-sha2-nistp384 or ecdsa-sha2-nistp521.
    
    This was acknowledged as an issue in the past, but hasn't yet been
    fixed.
    
    https://github.com/git/git/pull/1041#issuecomment-971425601

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1272%2Falindeman%2Fecdsa-sha2-keys-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1272/alindeman/ecdsa-sha2-keys-v1
Pull-Request: https://github.com/git/git/pull/1272

 gpg-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gpg-interface.c b/gpg-interface.c
index 280f1fa1a58..086bd03b51d 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -779,7 +779,7 @@ static int is_literal_ssh_key(const char *string, const char **key)
 {
 	if (skip_prefix(string, "key::", key))
 		return 1;
-	if (starts_with(string, "ssh-")) {
+	if (starts_with(string, "ssh-") || starts_with(string, "ecdsa-sha2-")) {
 		*key = string;
 		return 1;
 	}

base-commit: 8ddf593a250e07d388059f7e3f471078e1d2ed5c
-- 
gitgitgadget

             reply	other threads:[~2022-05-30 17:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30 17:45 Andy Lindeman via GitGitGadget [this message]
2022-05-31  7:34 ` [PATCH] ssh signing: Support ECDSA as literal SSH keys Fabian Stelzer
2022-05-31 13:28   ` Andy Lindeman
2022-05-31 14:47     ` Fabian Stelzer
2022-06-01  7:05       ` Junio C Hamano
2022-06-07  8:52         ` Fabian Stelzer
2022-06-07 17:20           ` Junio C Hamano
2022-06-08 15:24         ` [PATCH] gpg docs: explain better use of ssh.defaultKeyCommand Fabian Stelzer
2022-06-13  1:13           ` Andy Lindeman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1272.git.git.1653932705097.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=andy@lindeman.io \
    --cc=fs@gigacodes.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.