gnupg/g10 (ChangeLog export.c keyedit.c options.h trustdb.c
trustdb.h)
cvs user dshaw
cvs at cvs.gnupg.org
Fri Jun 10 04:39:02 CEST 2005
Date: Friday, June 10, 2005 @ 05:00:57
Author: dshaw
Path: /cvs/gnupg/gnupg/g10
Modified: ChangeLog export.c keyedit.c options.h trustdb.c trustdb.h
* options.h, export.c (do_export_stream), keyedit.c (keyedit_menu,
menu_clean_subkeys_from_key), trustdb.h, trustdb.c
(clean_subkeys_from_key): Remove subkey cleaning function. It is of
very limited usefulness since it cannot be used on any subkey that can
sign, and can only affect multiple selfsigs on encryption-only
subkeys.
-----------+
ChangeLog | 7 +++++++
export.c | 11 ++---------
keyedit.c | 38 +-------------------------------------
options.h | 1 -
trustdb.c | 60 ------------------------------------------------------------
trustdb.h | 1 -
6 files changed, 10 insertions(+), 108 deletions(-)
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.753 gnupg/g10/ChangeLog:1.754
--- gnupg/g10/ChangeLog:1.753 Fri Jun 10 04:52:41 2005
+++ gnupg/g10/ChangeLog Fri Jun 10 05:00:57 2005
@@ -1,5 +1,12 @@
2005-06-09 David Shaw <dshaw at jabberwocky.com>
+ * options.h, export.c (do_export_stream), keyedit.c (keyedit_menu,
+ menu_clean_subkeys_from_key), trustdb.h, trustdb.c
+ (clean_subkeys_from_key): Remove subkey cleaning function. It is
+ of very limited usefulness since it cannot be used on any subkey
+ that can sign, and can only affect multiple selfsigs on
+ encryption-only subkeys.
+
* keydb.h, kbnode.c (undelete_kbnode): New function to undelete a
kbnode.
Index: gnupg/g10/export.c
diff -u gnupg/g10/export.c:1.48 gnupg/g10/export.c:1.49
--- gnupg/g10/export.c:1.48 Wed Jun 8 05:31:48 2005
+++ gnupg/g10/export.c Fri Jun 10 05:00:57 2005
@@ -50,14 +50,10 @@
{"export-local-sigs",EXPORT_LOCAL_SIGS,NULL},
{"export-attributes",EXPORT_ATTRIBUTES,NULL},
{"export-sensitive-revkeys",EXPORT_SENSITIVE_REVKEYS,NULL},
- {"export-minimal",
- EXPORT_MINIMAL|EXPORT_CLEAN_SIGS|EXPORT_CLEAN_UIDS|EXPORT_CLEAN_SUBKEYS,
- NULL},
- {"export-clean",
- EXPORT_CLEAN_SIGS|EXPORT_CLEAN_UIDS|EXPORT_CLEAN_SUBKEYS,NULL},
+ {"export-minimal",EXPORT_MINIMAL|EXPORT_CLEAN_SIGS|EXPORT_CLEAN_UIDS,NULL},
+ {"export-clean",EXPORT_CLEAN_SIGS|EXPORT_CLEAN_UIDS,NULL},
{"export-clean-sigs",EXPORT_CLEAN_SIGS,NULL},
{"export-clean-uids",EXPORT_CLEAN_UIDS,NULL},
- {"export-clean-subkeys",EXPORT_CLEAN_SUBKEYS,NULL},
/* Aliases for backward compatibility */
{"include-local-sigs",EXPORT_LOCAL_SIGS,NULL},
{"include-attributes",EXPORT_ATTRIBUTES,NULL},
@@ -241,9 +237,6 @@
if(options&EXPORT_CLEAN_UIDS)
clean_uids_from_key(keyblock,opt.verbose);
-
- if(options&EXPORT_CLEAN_SUBKEYS)
- clean_subkeys_from_key(keyblock,opt.verbose);
}
/* and write it */
Index: gnupg/g10/keyedit.c
diff -u gnupg/g10/keyedit.c:1.185 gnupg/g10/keyedit.c:1.186
--- gnupg/g10/keyedit.c:1.185 Thu Jun 9 04:53:18 2005
+++ gnupg/g10/keyedit.c Fri Jun 10 05:00:57 2005
@@ -53,10 +53,9 @@
static void show_key_and_fingerprint( KBNODE keyblock );
static int menu_adduid( KBNODE keyblock, KBNODE sec_keyblock, int photo );
static void menu_deluid( KBNODE pub_keyblock, KBNODE sec_keyblock );
-static int menu_delsig( KBNODE pub_keyblock );
+static int menu_delsig( KBNODE pub_keyblock );
static int menu_clean_sigs_from_uids(KBNODE keyblock);
static int menu_clean_uids_from_key(KBNODE keyblock);
-static int menu_clean_subkeys_from_key(KBNODE keyblock);
static void menu_delkey( KBNODE pub_keyblock, KBNODE sec_keyblock );
static int menu_addrevoker( KBNODE pub_keyblock,
KBNODE sec_keyblock, int sensitive );
@@ -2149,8 +2148,6 @@
modified=menu_clean_sigs_from_uids(keyblock);
else if(ascii_strcasecmp(arg_string,"uids")==0)
redisplay=modified=menu_clean_uids_from_key(keyblock);
- else if(ascii_strcasecmp(arg_string,"subkeys")==0)
- redisplay=modified=menu_clean_subkeys_from_key(keyblock);
else
tty_printf("Unable to clean `%s'\n",arg_string);
}
@@ -2158,7 +2155,6 @@
{
modified=menu_clean_sigs_from_uids(keyblock);
modified+=menu_clean_uids_from_key(keyblock);
- modified+=menu_clean_subkeys_from_key(keyblock);
redisplay=modified;
}
}
@@ -3223,38 +3219,6 @@
return modified;
}
-static int
-menu_clean_subkeys_from_key(KBNODE keyblock)
-{
- KBNODE node;
- int modified=clean_subkeys_from_key(keyblock,0);
-
- if(modified)
- {
- for(node=keyblock->next;node;node=node->next)
- {
- if(node->pkt->pkttype==PKT_PUBLIC_SUBKEY && is_deleted_kbnode(node))
- {
- const char *reason;
-
- if(node->pkt->pkt.public_key->is_revoked)
- reason=_("revoked");
- else if(node->pkt->pkt.public_key->has_expired)
- reason=_("expired");
- else
- reason=_("invalid");
-
- tty_printf("Subkey %s removed: %s\n",
- keystr(node->pkt->pkt.public_key->keyid),reason);
- }
- }
- }
- else
- tty_printf("No subkeys are removable.\n");
-
- return modified;
-}
-
/****************
* Remove some of the secondary keys
*/
Index: gnupg/g10/options.h
diff -u gnupg/g10/options.h:1.140 gnupg/g10/options.h:1.141
--- gnupg/g10/options.h:1.140 Wed Jun 8 05:31:48 2005
+++ gnupg/g10/options.h Fri Jun 10 05:00:57 2005
@@ -259,7 +259,6 @@
#define EXPORT_MINIMAL (1<<3)
#define EXPORT_CLEAN_SIGS (1<<4)
#define EXPORT_CLEAN_UIDS (1<<5)
-#define EXPORT_CLEAN_SUBKEYS (1<<6)
#define LIST_SHOW_PHOTOS (1<<0)
#define LIST_SHOW_POLICY_URLS (1<<1)
Index: gnupg/g10/trustdb.c
diff -u gnupg/g10/trustdb.c:1.144 gnupg/g10/trustdb.c:1.145
--- gnupg/g10/trustdb.c:1.144 Fri Jun 10 04:52:41 2005
+++ gnupg/g10/trustdb.c Fri Jun 10 05:00:57 2005
@@ -1730,66 +1730,6 @@
return deleted;
}
-/* Another cleaning function. This only cleans encrypt-only subkeys
- since an expired/revoked encryption key is basically useless, but
- an expired/revoked key that can sign is still needed to verify old
- signatures. */
-int
-clean_subkeys_from_key(KBNODE keyblock,int noisy)
-{
- int delete_until_next=0,deleted=0;
- KBNODE node;
- char *main_key=NULL;
-
- assert(keyblock->pkt->pkttype==PKT_PUBLIC_KEY);
-
- merge_keys_and_selfsig(keyblock);
-
- if(noisy)
- main_key=m_strdup(keystr(keyblock->pkt->pkt.public_key->keyid));
-
- for(node=keyblock->next;node;node=node->next)
- {
- if(node->pkt->pkttype==PKT_PUBLIC_SUBKEY)
- {
- PKT_public_key *pk=node->pkt->pkt.public_key;
-
- /* If it is valid, not expired, and not revoked, leave it
- alone. If a key can make signatures, leave it alone. */
- if(pk->pubkey_usage!=PUBKEY_USAGE_ENC
- || (pk->is_valid && !pk->has_expired && !pk->is_revoked))
- delete_until_next=0;
- else
- {
- delete_until_next=1;
- deleted++;
-
- if(noisy)
- {
- const char *reason;
-
- if(pk->is_revoked)
- reason=_("revoked");
- else if(pk->has_expired)
- reason=_("expired");
- else
- reason=_("invalid");
-
- log_info("removing subkey %s from key %s: %s\n",
- keystr_from_pk(pk),main_key,reason);
- }
- }
- }
-
- if(delete_until_next)
- delete_kbnode(node);
- }
-
- m_free(main_key);
-
- return deleted;
-}
-
/* Used by validate_one_keyblock to confirm a regexp within a trust
signature. Returns 1 for match, and 0 for no match or regex
error. */
Index: gnupg/g10/trustdb.h
diff -u gnupg/g10/trustdb.h:1.55 gnupg/g10/trustdb.h:1.56
--- gnupg/g10/trustdb.h:1.55 Tue May 31 10:39:15 2005
+++ gnupg/g10/trustdb.h Fri Jun 10 05:00:57 2005
@@ -84,7 +84,6 @@
int clean_sigs_from_uid(KBNODE keyblock,KBNODE uidnode,int noisy);
int clean_uids_from_key(KBNODE keyblock,int noisy);
-int clean_subkeys_from_key(KBNODE keyblock,int noisy);
/*-- tdbdump.c --*/
void list_trustdb(const char *username);
More information about the Gnupg-commits
mailing list