diff options
author | Werner Koch <[email protected]> | 2021-04-21 19:00:28 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-05-04 06:42:51 +0000 |
commit | aa612d752ebb1851f23184df084aed5314b72e3a (patch) | |
tree | 29aab9fde48b04332d012f1c9b1f07a68b933608 | |
parent | gpg: Allow fingerprint based lookup with --locate-external-key. (diff) | |
download | gnupg-aa612d752ebb1851f23184df084aed5314b72e3a.tar.gz gnupg-aa612d752ebb1851f23184df084aed5314b72e3a.zip |
agent: Silence error messages for READKEY --card
* agent/command.c (cmd_readkey): Test for shadow key before creating
it.
(cherry picked from commit 8f2c9cb73538baab7da8107f2cceb2f6fc49642a)
-rw-r--r-- | agent/command.c | 10 | ||||
-rw-r--r-- | agent/keyformat.txt | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/agent/command.c b/agent/command.c index 8642498d6..145c9595a 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1030,9 +1030,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); } diff --git a/agent/keyformat.txt b/agent/keyformat.txt index 24d742048..259166aba 100644 --- a/agent/keyformat.txt +++ b/agent/keyformat.txt @@ -44,9 +44,8 @@ convention. Example (here indented with two spaces): (#D2760001240102000005000011730000# OPENPGP.1) ))) -GnuPG 2.2 is able to read and update keys using the new format, but -will not create new files using the new format. Furthermore, it only -makes use of the value stored under the name 'Key:'. +GnuPG 2.2 is also able to read and write keys using the new format +However, it only makes use of the value stored under the name 'Key:'. Keys in the extended format can be recognized by looking at the first byte of the file. If it starts with a '(' it is a naked S-expression, |