[svn] GnuPG - r4964 - trunk/sm
svn author wk
cvs at cvs.gnupg.org
Mon Mar 23 17:17:49 CET 2009
Author: wk
Date: 2009-03-23 17:17:49 +0100 (Mon, 23 Mar 2009)
New Revision: 4964
Modified:
trunk/sm/ChangeLog
trunk/sm/delete.c
Log:
Allow deletion of ephemeral keys.
Modified: trunk/sm/ChangeLog
===================================================================
--- trunk/sm/ChangeLog 2009-03-20 20:55:47 UTC (rev 4963)
+++ trunk/sm/ChangeLog 2009-03-23 16:17:49 UTC (rev 4964)
@@ -1,3 +1,8 @@
+2009-03-23 Werner Koch <wk at g10code.com>
+
+ * delete.c (delete_one): Also delete ephemeral certificates if
+ specified uniquely.
+
2009-03-20 Werner Koch <wk at g10code.com>
* keylist.c (list_internal_keys): Set released cert to NULL.
Modified: trunk/sm/delete.c
===================================================================
--- trunk/sm/delete.c 2009-03-20 20:55:47 UTC (rev 4963)
+++ trunk/sm/delete.c 2009-03-23 16:17:49 UTC (rev 4964)
@@ -1,5 +1,5 @@
-/* delete.c
- * Copyright (C) 2002 Free Software Foundation, Inc.
+/* delete.c - Delete certificates from the keybox.
+ * Copyright (C) 2002, 2009 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -43,6 +43,7 @@
KEYDB_HANDLE kh = NULL;
ksba_cert_t cert = NULL;
int duplicates = 0;
+ int is_ephem = 0;
rc = keydb_classify_name (username, &desc);
if (rc)
@@ -60,11 +61,21 @@
goto leave;
}
-
+ /* If the key is specified in a unique way, include ephemeral keys
+ in the search. */
+ if ( desc.mode == KEYDB_SEARCH_MODE_FPR
+ || desc.mode == KEYDB_SEARCH_MODE_FPR20
+ || desc.mode == KEYDB_SEARCH_MODE_FPR16
+ || desc.mode == KEYDB_SEARCH_MODE_KEYGRIP )
+ {
+ is_ephem = 1;
+ keydb_set_ephemeral (kh, 1);
+ }
+
rc = keydb_search (kh, &desc, 1);
if (!rc)
rc = keydb_get_cert (kh, &cert);
- if (!rc)
+ if (!rc && !is_ephem)
{
unsigned char fpr[20];
More information about the Gnupg-commits
mailing list