aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--agent/command-ssh.c1
-rw-r--r--agent/divert-scd.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 6b872f1fa..9de88dc44 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -2769,6 +2769,7 @@ ssh_send_available_keys (ctrl_t ctrl, estream_t key_blobs, u32 *r_key_counter)
* support at all but a smartcard lists that curve.
* We ignore them. */
skipped++;
+ err = 0;
}
else
goto leave;
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index 1e5de4671..15d1abd8d 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -517,6 +517,12 @@ agent_card_ecc_kem (ctrl_t ctrl, const unsigned char *ecc_ct,
if (len == ecc_point_len)
memcpy (ecc_ecdh, ecdh, len);
+ else if (len && (len - 1) * 2 == ecc_point_len - 1 && ecdh[0] == 0x02)
+ {
+ /* It's x-coordinate-only (compressed) point representation. */
+ memcpy (ecc_ecdh, ecdh, len);
+ memset (ecc_ecdh + len, 0, ecc_point_len - len);
+ }
else if (len == ecc_point_len + 1 && ecdh[0] == 0x40) /* The prefix */
memcpy (ecc_ecdh, ecdh + 1, len - 1);
else