mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* call-agent.c (learn_cb): Use log_info instead of log_error on
successful import. * keydb.c (keydb_set_ephemeral): New. (keydb_store_cert): New are ephemeral, changed all callers. * keylist.c (list_external_cb): Store cert as ephemeral. * export.c (gpgsm_export): Kludge to export epehmeral certificates. * gpgsm.c (main): New command --list-external-keys.
This commit is contained in:
parent
031a856a7e
commit
52146943d1
9 changed files with 78 additions and 8 deletions
29
sm/keydb.c
29
sm/keydb.c
|
@ -59,6 +59,7 @@ struct keydb_handle {
|
|||
int locked;
|
||||
int found;
|
||||
int current;
|
||||
int ephemeral;
|
||||
int used; /* items in active */
|
||||
struct resource_item active[MAX_KEYDB_RESOURCES];
|
||||
};
|
||||
|
@ -331,6 +332,29 @@ keydb_get_resource_name (KEYDB_HANDLE hd)
|
|||
return s? s: "";
|
||||
}
|
||||
|
||||
int
|
||||
keydb_set_ephemeral (KEYDB_HANDLE hd, int yes)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!hd)
|
||||
return GNUPG_Invalid_Value;
|
||||
|
||||
for (i=0; i < hd->used; i++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
|
@ -1147,7 +1171,7 @@ keydb_classify_name (const char *name, KEYDB_SEARCH_DESC *desc)
|
|||
/* Store the certificate in the key Db but make sure that it does not
|
||||
already exists. We do this simply by comparing the fingerprint */
|
||||
int
|
||||
keydb_store_cert (KsbaCert cert)
|
||||
keydb_store_cert (KsbaCert cert, int ephemeral)
|
||||
{
|
||||
KEYDB_HANDLE kh;
|
||||
int rc;
|
||||
|
@ -1166,6 +1190,9 @@ keydb_store_cert (KsbaCert cert)
|
|||
return GNUPG_Out_Of_Core;
|
||||
}
|
||||
|
||||
if (ephemeral)
|
||||
keydb_set_ephemeral (kh, 1);
|
||||
|
||||
rc = keydb_search_fpr (kh, fpr);
|
||||
if (rc != -1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue