diff options
author | David Shaw <[email protected]> | 2004-09-24 14:34:45 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-09-24 14:34:45 +0000 |
commit | 680be9be101aa2edb2bd058046b6f757c5c93ad2 (patch) | |
tree | fedcf4dd3fd3602219049d5f3d31f4f3c050b001 /g10/keyedit.c | |
parent | Note: I have not fully tested the new key creation due to a pc/sc (diff) | |
download | gnupg-680be9be101aa2edb2bd058046b6f757c5c93ad2.tar.gz gnupg-680be9be101aa2edb2bd058046b6f757c5c93ad2.zip |
* keyedit.c (keyedit_menu), gpgv.c (agent_scd_getattr (stub)), keygen.c
(copy_mpi, generate_raw_key): Fix a compile problem and a few warnings
when building without card support.
Diffstat (limited to '')
-rw-r--r-- | g10/keyedit.c | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c index 4070d2fac..b3067bf51 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -95,6 +95,7 @@ struct sign_attrib { }; +#ifdef ENABLE_CARD_SUPPORT /* Given a node SEC_NODE with a secret key or subkey, locate the corresponding public key from pub_keyblock. */ static PKT_public_key * @@ -120,7 +121,7 @@ find_pk_from_sknode (KBNODE pub_keyblock, KBNODE sec_node) return NULL; } - +#endif /* ENABLE_CARD_SUPPORT */ /* TODO: Fix duplicated code between here and the check-sigs/list-sigs @@ -1285,7 +1286,6 @@ keyedit_menu( const char *username, STRLIST locusr, KBNODE sec_keyblock = NULL; KEYDB_HANDLE sec_kdbhd = NULL; KBNODE cur_keyblock; - KBNODE node; char *answer = NULL; int redisplay = 1; int modified = 0; @@ -1576,35 +1576,37 @@ keyedit_menu( const char *username, STRLIST locusr, break; case cmdKEYTOCARD: - node = NULL; - switch ( count_selected_keys (sec_keyblock) ) - { - case 0: - if (cpr_get_answer_is_yes("keyedit.keytocard.use_primary", - _("Really move the primary key? "))) - node = sec_keyblock; - break; - case 1: - for (node = sec_keyblock; node; node = node->next ) - { - if (node->pkt->pkttype == PKT_SECRET_SUBKEY - && node->flag & NODFLG_SELKEY) - break; - } - break; - default: - tty_printf(_("You must select exactly one key.\n")); - break; - } - if (node) - { - PKT_public_key *xxpk = find_pk_from_sknode (keyblock, node); - if (card_store_subkey (node, xxpk?xxpk->pubkey_usage:0)) - { - redisplay = 1; - sec_modified = 1; - } - } + { + KBNODE node=NULL; + switch ( count_selected_keys (sec_keyblock) ) + { + case 0: + if (cpr_get_answer_is_yes("keyedit.keytocard.use_primary", + _("Really move the primary key? "))) + node = sec_keyblock; + break; + case 1: + for (node = sec_keyblock; node; node = node->next ) + { + if (node->pkt->pkttype == PKT_SECRET_SUBKEY + && node->flag & NODFLG_SELKEY) + break; + } + break; + default: + tty_printf(_("You must select exactly one key.\n")); + break; + } + if (node) + { + PKT_public_key *xxpk = find_pk_from_sknode (keyblock, node); + if (card_store_subkey (node, xxpk?xxpk->pubkey_usage:0)) + { + redisplay = 1; + sec_modified = 1; + } + } + } break; #endif /* ENABLE_CARD_SUPPORT */ |