Diffusion GnuPG 2e86cca7f418

agent: Avoid multiple calls to scd for KEYINFO.

Authored by werner on Jan 13 2020, 4:27 PM.

Description

agent: Avoid multiple calls to scd for KEYINFO.

* agent/command.c (struct server_local_s): Add last_card_keyinfo.
(eventcounter): Add maybe_key_change.
(cmd_genkey, cmd_scd, cmd_import_key, cmd_delete_key): Bump new
counter.
(cmd_keyinfo): Cache the keyinfo from the card.
(start_command_handler): Release the cache.

This cache speeds up processing of commands like "gpg -K" because
scdaemon does not need to be asked for each key as long as nothing
changed with the card.

We should have a better notification service from scdaemon to make
sure that we get only the relevant events. What we do right now is a
bit course but sufficient.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Committed
wernerJan 13 2020, 4:27 PM
Parents
rGaaef0fc3a743: agent: Replace free by xfree in recently added code.
Branches
Unknown
Tags
Unknown