aboutsummaryrefslogtreecommitdiffstats
path: root/g10/import.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-03-15 18:11:32 +0000
committerWerner Koch <[email protected]>2019-03-18 12:13:14 +0000
commitdb2d75f1ffede2ea77163b487a15e60249daffa0 (patch)
treed0acbe5fc1e6bd58622050c292104b0d2e504c93 /g10/import.c
parentgpg: Simplify an interactive import status line. (diff)
downloadgnupg-db2d75f1ffede2ea77163b487a15e60249daffa0.tar.gz
gnupg-db2d75f1ffede2ea77163b487a15e60249daffa0.zip
gpg: During secret key import print "sec" instead of "pub".
* g10/keyedit.c (show_basic_key_info): New arg 'print_sec'. Remove useless code for "sub" and "ssb". * g10/import.c (import_one): Pass FROM_SK to show_basic_key_info. Do not print the first keyinfo in FROM_SK mode. printing. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f64477db86568bdc28c313bfeb8b95d8edf05a3c)
Diffstat (limited to 'g10/import.c')
-rw-r--r--g10/import.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/g10/import.c b/g10/import.c
index 6079a8544..88aa86b70 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1644,7 +1644,8 @@ update_key_origin (kbnode_t keyblock, u32 curtime, int origin, const char *url)
* the internal errorcount, so that invalid input can be detected by
* programs which called gpg. If SILENT is no messages are printed -
* even most error messages are suppressed. ORIGIN is the origin of
- * the key (0 for unknown) and URL the corresponding URL.
+ * the key (0 for unknown) and URL the corresponding URL. FROM_SK
+ * indicates that the key has been made from a secret key.
*/
static gpg_error_t
import_one (ctrl_t ctrl,
@@ -1688,9 +1689,11 @@ import_one (ctrl_t ctrl,
keyid_from_pk( pk, keyid );
uidnode = find_next_kbnode( keyblock, PKT_USER_ID );
- if (opt.verbose && !opt.interactive && !silent)
+ if (opt.verbose && !opt.interactive && !silent && !from_sk)
{
- log_info( "pub %s/%s %s ",
+ /* Note that we do not print this info in FROM_SK mode
+ * because import_one already printed that. */
+ log_info ("pub %s/%s %s ",
pubkey_string (pk, pkstrbuf, sizeof pkstrbuf),
keystr_from_pk(pk), datestr_from_pk(pk) );
if (uidnode)
@@ -1721,7 +1724,7 @@ import_one (ctrl_t ctrl,
print_import_check (pk, uidnode->pkt->pkt.user_id);
merge_keys_and_selfsig (ctrl, keyblock);
tty_printf ("\n");
- show_basic_key_info (ctrl, keyblock);
+ show_basic_key_info (ctrl, keyblock, from_sk);
tty_printf ("\n");
if (!cpr_get_answer_is_yes ("import.okay",
"Do you want to import this key? (y/N) "))