mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Print a new EXPORTED status line.
* common/status.h (STATUS_EXPORTED): New. * g10/export.c (print_status_exported): New. (do_export_stream): Call that function. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
e3c48335f9
commit
2038adf16d
@ -62,6 +62,7 @@ enum
|
|||||||
STATUS_IMPORT_RES,
|
STATUS_IMPORT_RES,
|
||||||
STATUS_IMPORT_CHECK,
|
STATUS_IMPORT_CHECK,
|
||||||
|
|
||||||
|
STATUS_EXPORTED,
|
||||||
STATUS_EXPORT_RES,
|
STATUS_EXPORT_RES,
|
||||||
|
|
||||||
STATUS_FILE_START,
|
STATUS_FILE_START,
|
||||||
|
@ -768,6 +768,11 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB:
|
|||||||
- <not_imported>
|
- <not_imported>
|
||||||
- <skipped_v3_keys>
|
- <skipped_v3_keys>
|
||||||
|
|
||||||
|
*** EXPORTED <fingerprint>
|
||||||
|
The key with <fingerprint> has been exported. The fingerprint is
|
||||||
|
the fingerprint of the primary key even if the primary key has
|
||||||
|
been replaced by a stub key during secret key export.
|
||||||
|
|
||||||
*** EXPORT_RES <args>
|
*** EXPORT_RES <args>
|
||||||
|
|
||||||
Final statistics on export process (this is one long line). The
|
Final statistics on export process (this is one long line). The
|
||||||
|
31
g10/export.c
31
g10/export.c
@ -809,6 +809,22 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Print an "EXPORTED" status line. PK is the primary public key. */
|
||||||
|
static void
|
||||||
|
print_status_exported (PKT_public_key *pk)
|
||||||
|
{
|
||||||
|
char *hexfpr;
|
||||||
|
|
||||||
|
if (!is_status_enabled ())
|
||||||
|
return;
|
||||||
|
|
||||||
|
hexfpr = hexfingerprint (pk);
|
||||||
|
write_status_text (STATUS_EXPORTED, hexfpr? hexfpr : "[?]");
|
||||||
|
xfree (hexfpr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Export the keys identified by the list of strings in USERS to the
|
/* Export the keys identified by the list of strings in USERS to the
|
||||||
stream OUT. If Secret is false public keys will be exported. With
|
stream OUT. If Secret is false public keys will be exported. With
|
||||||
secret true secret keys will be exported; in this case 1 means the
|
secret true secret keys will be exported; in this case 1 means the
|
||||||
@ -1182,7 +1198,10 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
|
|||||||
|
|
||||||
err = build_packet (out, node->pkt);
|
err = build_packet (out, node->pkt);
|
||||||
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
|
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
|
||||||
stats->exported++;
|
{
|
||||||
|
stats->exported++;
|
||||||
|
print_status_exported (node->pkt->pkt.public_key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!err)
|
else if (!err)
|
||||||
{
|
{
|
||||||
@ -1239,7 +1258,10 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
|
|||||||
|
|
||||||
err = build_packet (out, node->pkt);
|
err = build_packet (out, node->pkt);
|
||||||
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
|
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
|
||||||
stats->exported++;
|
{
|
||||||
|
stats->exported++;
|
||||||
|
print_status_exported (node->pkt->pkt.public_key);
|
||||||
|
}
|
||||||
goto unwraperror_leave;
|
goto unwraperror_leave;
|
||||||
|
|
||||||
unwraperror:
|
unwraperror:
|
||||||
@ -1278,7 +1300,10 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
|
|||||||
{
|
{
|
||||||
err = build_packet (out, node->pkt);
|
err = build_packet (out, node->pkt);
|
||||||
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
|
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
|
||||||
stats->exported++;
|
{
|
||||||
|
stats->exported++;
|
||||||
|
print_status_exported (node->pkt->pkt.public_key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user