aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/agent/command.c b/agent/command.c
index 095f38ba3..88580a754 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1125,9 +1125,13 @@ cmd_readkey (assuan_context_t ctx, char *line)
goto leave;
}
- rc = agent_write_shadow_key (grip, serialno, keyid, pkbuf, 0);
- if (rc)
- goto leave;
+ if (agent_key_available (grip))
+ {
+ /* (Shadow)-key is not available in our key storage. */
+ rc = agent_write_shadow_key (grip, serialno, keyid, pkbuf, 0);
+ if (rc)
+ goto leave;
+ }
rc = assuan_send_data (ctx, pkbuf, pkbuflen);
}