aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2005-06-10 03:00:57 +0000
committerDavid Shaw <[email protected]>2005-06-10 03:00:57 +0000
commit045433e35ccfb77c16c2abff889bc338decfdbee (patch)
tree0a88c147624a51d21176634d9fac74820e55af2d /g10/trustdb.c
parent* keydb.h, kbnode.c (undelete_kbnode): New function to undelete a (diff)
downloadgnupg-045433e35ccfb77c16c2abff889bc338decfdbee.tar.gz
gnupg-045433e35ccfb77c16c2abff889bc338decfdbee.zip
* 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.
Diffstat (limited to '')
-rw-r--r--g10/trustdb.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 9f71f6377..6d11cdc27 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1730,66 +1730,6 @@ clean_uids_from_key(KBNODE keyblock,int noisy)
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. */