aboutsummaryrefslogtreecommitdiffstats
path: root/sm/export.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-06-19 08:30:10 +0000
committerWerner Koch <[email protected]>2002-06-19 08:30:10 +0000
commit52146943d10e5a72ef8b4fef8e4c24a3dbb6c5a1 (patch)
treeb2a5e1e00be63bde7464d6063e69c3c2cac577e1 /sm/export.c
parent* keybox-init.c (keybox_set_ephemeral): New. (diff)
downloadgnupg-52146943d10e5a72ef8b4fef8e4c24a3dbb6c5a1.tar.gz
gnupg-52146943d10e5a72ef8b4fef8e4c24a3dbb6c5a1.zip
* 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.
Diffstat (limited to '')
-rw-r--r--sm/export.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sm/export.c b/sm/export.c
index ce2909fdf..fc82b7e6c 100644
--- a/sm/export.c
+++ b/sm/export.c
@@ -50,6 +50,7 @@ gpgsm_export (CTRL ctrl, STRLIST names, FILE *fp)
KsbaCert cert = NULL;
int rc=0;
int count = 0;
+ int i;
hd = keydb_new (0);
if (!hd)
@@ -91,7 +92,23 @@ gpgsm_export (CTRL ctrl, STRLIST names, FILE *fp)
}
}
+ /* If all specifications are done by fingerprint, we switch to
+ ephemeral mode so that _all_ currently available and matching
+ certificates are exported.
+ fixme: we should in this case keep a list of certificates to
+ avoid accidential export of duplicate certificates. */
+ if (names && ndesc)
+ {
+ for (i=0; (i < ndesc
+ && (desc[i].mode == KEYDB_SEARCH_MODE_FPR
+ || desc[i].mode == KEYDB_SEARCH_MODE_FPR20
+ || desc[i].mode == KEYDB_SEARCH_MODE_FPR16)); i++)
+ ;
+ if (i == ndesc)
+ keydb_set_ephemeral (hd, 1);
+ }
+
while (!(rc = keydb_search (hd, desc, ndesc)))
{
const unsigned char *image;