diff options
author | Werner Koch <wk@gnupg.org> | 2010-09-06 21:57:42 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-09-06 21:57:42 +0200 |
commit | 299ed4c9e26f16ce5365ed69dde5e109aa4e4f9e (patch) | |
tree | 76ec60edc1f48dff9ad7b1d968ebedab0692dc14 /g10/delkey.c | |
parent | Merge secret keys during import (diff) | |
download | gnupg2-299ed4c9e26f16ce5365ed69dde5e109aa4e4f9e.tar.xz gnupg2-299ed4c9e26f16ce5365ed69dde5e109aa4e4f9e.zip |
Removed more secret key related code.
It builds fine and passes some of the tests but there are quite some
features which don't work yet.
Diffstat (limited to 'g10/delkey.c')
-rw-r--r-- | g10/delkey.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/g10/delkey.c b/g10/delkey.c index 2361d8323..62c75632b 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -54,7 +54,6 @@ do_delete_key( const char *username, int secret, int force, int *r_sec_avail ) KBNODE node; KEYDB_HANDLE hd = keydb_new (); PKT_public_key *pk = NULL; - PKT_secret_key *sk = NULL; u32 keyid[2]; int okay=0; int yes; @@ -91,28 +90,19 @@ do_delete_key( const char *username, int secret, int force, int *r_sec_avail ) goto leave; } - if( secret ) + pk = node->pkt->pkt.public_key; + keyid_from_pk( pk, keyid ); + + if (!force) { - sk = node->pkt->pkt.secret_key; - keyid_from_sk( sk, keyid ); - } - else - { - /* public */ - pk = node->pkt->pkt.public_key; - keyid_from_pk( pk, keyid ); - - if(!force) - { - if (have_secret_key_with_kid (keyid)) - { - *r_sec_avail = 1; - rc = -1; - goto leave; - } - else - rc = 0; - } + if (have_secret_key_with_kid (keyid)) + { + *r_sec_avail = 1; + rc = -1; + goto leave; + } + else + rc = 0; } if( rc ) @@ -133,9 +123,9 @@ do_delete_key( const char *username, int secret, int force, int *r_sec_avail ) } else { if( secret ) - print_seckey_info( sk ); + print_seckey_info (pk); else - print_pubkey_info(NULL, pk ); + print_pubkey_info (NULL, pk ); tty_printf( "\n" ); yes = cpr_get_answer_is_yes( secret? "delete_key.secret.okay" |