aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-02-22 02:00:27 +0000
committerNIIBE Yutaka <[email protected]>2013-02-22 02:00:27 +0000
commit7d376ffa321d4af6e62a2bc64ef2b8574b122b1a (patch)
treeab0701e87df50d8b5432113fe34610e641897dea
parentUpdate .gitignore for non-VPATH builds. (diff)
downloadgnupg-7d376ffa321d4af6e62a2bc64ef2b8574b122b1a.tar.gz
gnupg-7d376ffa321d4af6e62a2bc64ef2b8574b122b1a.zip
gpg: fix keytocard and support ECC card for key attribute.
* g10/call-agent.c (agent_keytocard): Supply PARM arg. * g10/card-util.c (card_status): Support ECC. (card_store_subkey): Don't assume RSA.
-rw-r--r--g10/call-agent.c8
-rw-r--r--g10/card-util.c6
2 files changed, 10 insertions, 4 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 85a3f2842..e3250fe46 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -606,6 +606,10 @@ agent_keytocard (const char *hexgrip, int keyno, int force,
{
int rc;
char line[ASSUAN_LINELENGTH];
+ struct default_inq_parm_s parm;
+
+ memset (&parm, 0, sizeof parm);
+ parm.ctx = agent_ctx;
snprintf (line, DIM(line)-1, "KEYTOCARD %s%s %s OPENPGP.%d %s",
force?"--force ": "", hexgrip, serialno, keyno, timestamp);
@@ -615,8 +619,8 @@ agent_keytocard (const char *hexgrip, int keyno, int force,
if (rc)
return rc;
- rc = assuan_transact (agent_ctx, line, NULL, NULL, default_inq_cb,
- NULL, NULL, NULL);
+ rc = assuan_transact (agent_ctx, line, NULL, NULL, default_inq_cb, &parm,
+ NULL, NULL);
if (rc)
return rc;
diff --git a/g10/card-util.c b/g10/card-util.c
index 75208cc86..add8eed09 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -550,7 +550,9 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
tty_fprintf (fp, " %u%c",
info.key_attr[i].nbits,
info.key_attr[i].algo == 1? 'R':
- info.key_attr[i].algo == 17? 'D': '?');
+ info.key_attr[i].algo == 17? 'D':
+ info.key_attr[i].algo == 18? 'e':
+ info.key_attr[i].algo == 19? 'E': '?');
tty_fprintf (fp, "\n");
}
tty_fprintf (fp, "Max. PIN lengths .: %d %d %d\n",
@@ -1560,7 +1562,7 @@ card_store_subkey (KBNODE node, int use)
nbits = nbits_from_pk (pk);
- if (!is_RSA (pk->pubkey_algo) || (!info.is_v2 && nbits != 1024) )
+ if (!info.is_v2 && nbits != 1024)
{
tty_printf ("You may only store a 1024 bit RSA key on the card\n");
tty_printf ("\n");