aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-02-22 03:55:11 +0000
committerNIIBE Yutaka <[email protected]>2013-02-22 03:55:11 +0000
commit3c3648e720b8014828573bd708c88ba4775014e3 (patch)
treea80beffc08b31684e94fa626dba70f5a157b6bca /agent/command.c
parentgpg: fix keytocard and support ECC card for key attribute. (diff)
downloadgnupg-3c3648e720b8014828573bd708c88ba4775014e3.tar.gz
gnupg-3c3648e720b8014828573bd708c88ba4775014e3.zip
agent: fix two bugs.
* agent/command.c (cmd_keytocard): Decrement KEYDATALEN. * agent/findkey.c (agent_public_key_from_file): Increment for ELEMS. -- For ECDSA and ECDH, there are 6 elements.
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index 2844398f6..823b233bf 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2197,6 +2197,7 @@ cmd_keytocard (assuan_context_t ctx, char *line)
gcry_sexp_sprint (s_skey, GCRYSEXP_FMT_CANON, keydata, keydatalen);
gcry_sexp_release (s_skey);
+ keydatalen--; /* Decrement for last '\0'. */
/* Add timestamp "created-at" in the private key */
timestamp = isotime2epoch (timestamp_str);
snprintf (keydata+keydatalen-1, 30, "(10:created-at10:%010lu))", timestamp);