diff options
author | Werner Koch <[email protected]> | 2002-06-29 14:01:53 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2002-06-29 14:01:53 +0000 |
commit | df58e024e71b100a1557b1023d35b2a0092a8748 (patch) | |
tree | 18c586e4583637186779686afef445c71427307f /sm/keydb.c | |
parent | * query.c (start_pinentry): Use GNUPG_DERAULT_PINENTRY. (diff) | |
download | gnupg-df58e024e71b100a1557b1023d35b2a0092a8748.tar.gz gnupg-df58e024e71b100a1557b1023d35b2a0092a8748.zip |
* gpgsm.c: New option --auto-issuer-key-retrieve.
* certpath.c (find_up): Try to retrieve an issuer key from an
external source and from the ephemeral key DB.
(find_up_store_certs_cb): New.
* keydb.c (keydb_set_ephemeral): Does now return the old
state. Call the backend only when required.
* call-dirmngr.c (start_dirmngr): Use GNUPG_DEFAULT_DIRMNGR.
(lookup_status_cb): Issue status only when CTRL is not NULL.
(gpgsm_dirmngr_lookup): Document that CTRL is optional.
* call-agent.c (start_agent): Use GNUPG_DEFAULT_AGENT.
Diffstat (limited to 'sm/keydb.c')
-rw-r--r-- | sm/keydb.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/sm/keydb.c b/sm/keydb.c index bc4721418..52f40f1ad 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -59,7 +59,7 @@ struct keydb_handle { int locked; int found; int current; - int ephemeral; + int is_ephemeral; int used; /* items in active */ struct resource_item active[MAX_KEYDB_RESOURCES]; }; @@ -332,27 +332,34 @@ keydb_get_resource_name (KEYDB_HANDLE hd) return s? s: ""; } +/* Switch the handle into ephemeral mode and return the orginal value. */ int keydb_set_ephemeral (KEYDB_HANDLE hd, int yes) { int i; if (!hd) - return GNUPG_Invalid_Value; + return 0; - for (i=0; i < hd->used; i++) + yes = !!yes; + if (hd->is_ephemeral != yes) { - switch (hd->active[i].type) + for (i=0; i < hd->used; i++) { - case KEYDB_RESOURCE_TYPE_NONE: - break; - case KEYDB_RESOURCE_TYPE_KEYBOX: - keybox_set_ephemeral (hd->active[i].u.kr, yes); - break; + switch (hd->active[i].type) + { + case KEYDB_RESOURCE_TYPE_NONE: + break; + case KEYDB_RESOURCE_TYPE_KEYBOX: + keybox_set_ephemeral (hd->active[i].u.kr, yes); + break; + } } } - - return 0; + + i = hd->is_ephemeral; + hd->is_ephemeral = yes; + return i; } |