From bdf252e76ada0056bec2ee7940255f32552328c5 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 3 May 2019 15:54:54 +0200 Subject: agent: Put Token lines into the key files. * agent/findkey.c (write_extended_private_key): Add args serialno and keyref. Write a Token line if that does not yet exist. (agent_write_private_key): Add args serialno and keyref and change all callers. (agent_write_shadow_key): Skip leading spaces. * agent/keyformat.txt: Improve extended key format docs. -- Noet that the extended key forma is the defaqult in 2.3. This patch is a first step to better handle tokens which carray the same key. Signed-off-by: Werner Koch --- agent/cvt-openpgp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'agent/cvt-openpgp.c') diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c index 06cd1c840..42052d48e 100644 --- a/agent/cvt-openpgp.c +++ b/agent/cvt-openpgp.c @@ -1067,7 +1067,8 @@ convert_from_openpgp_native (ctrl_t ctrl, if (!agent_protect (*r_key, passphrase, &protectedkey, &protectedkeylen, ctrl->s2k_count, -1)) - agent_write_private_key (grip, protectedkey, protectedkeylen, 1); + agent_write_private_key (grip, protectedkey, protectedkeylen, 1, + NULL, NULL); xfree (protectedkey); } else @@ -1076,7 +1077,7 @@ convert_from_openpgp_native (ctrl_t ctrl, agent_write_private_key (grip, *r_key, gcry_sexp_canon_len (*r_key, 0, NULL,NULL), - 1); + 1, NULL, NULL); } } -- cgit v1.2.3