aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-03-29 13:39:32 +0000
committerWerner Koch <[email protected]>2021-03-29 13:39:32 +0000
commit2d2391dfc25cfe160581b1bb4b4b8fc4764ac304 (patch)
tree05ba9818d4e04680c5f8202cd8147d4bf80112ed /agent/command-ssh.c
parentscd:p15: Support ECDSA and ECDH for CardOS. (diff)
downloadgnupg-2d2391dfc25cfe160581b1bb4b4b8fc4764ac304.tar.gz
gnupg-2d2391dfc25cfe160581b1bb4b4b8fc4764ac304.zip
agent: Skip unknown unknown ssh curves seen on cards.
* agent/command-ssh.c (ssh_handler_request_identities): Skip unknown curves. -- For example when using my standard ed25519 token and testing cards with only Brainpool support, the ssh-agent failed due to the unknown curves seen on the card. This patches fixes this by ignoring keys with unknown curves. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/command-ssh.c')
-rw-r--r--agent/command-ssh.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 538b4ddef..73f98e9cd 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -2513,18 +2513,28 @@ ssh_handler_request_identities (ctrl_t ctrl,
continue;
err = ssh_send_key_public (key_blobs, key_public, cardsn);
- if (err && opt.verbose)
- gcry_log_debugsxp ("pubkey", key_public);
gcry_sexp_release (key_public);
key_public = NULL;
xfree (cardsn);
if (err)
{
- agent_card_free_keyinfo (keyinfo_list);
- goto out;
+ if (err && opt.verbose)
+ gcry_log_debugsxp ("pubkey", key_public);
+ if (gpg_err_code (err) == GPG_ERR_UNKNOWN_CURVE
+ || gpg_err_code (err) == GPG_ERR_INV_CURVE)
+ {
+ /* For example a Brainpool curve or a curve we don't
+ * support at all but a smartcard lists that curve.
+ * We ignore them. */
+ }
+ else
+ {
+ agent_card_free_keyinfo (keyinfo_list);
+ goto out;
+ }
}
-
- key_counter++;
+ else
+ key_counter++;
}
agent_card_free_keyinfo (keyinfo_list);