aboutsummaryrefslogtreecommitdiffstats
path: root/g10/export.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-08-28 12:41:31 +0000
committerWerner Koch <[email protected]>2025-08-28 12:47:56 +0000
commit48e5282c86c253789e7e4f8bfc0930ce07037acc (patch)
tree4fa995020583f5b40935f3490864ded09a7daf9e /g10/export.c
parentgpg: Change the ADSK key binding time to the current time. (diff)
downloadgnupg-48e5282c86c253789e7e4f8bfc0930ce07037acc.tar.gz
gnupg-48e5282c86c253789e7e4f8bfc0930ce07037acc.zip
gpg: New option --auto-key-upload
* g10/options.h (opt.flags): Add member auto_key_upload. (EXPORT_NO_STATUS): New. (KEYSERVER_LDAP_ONLY): New. (KEYSERVER_WARN_ONLY): New. * g10/gpg.c (oAutoKeyUpload): New. (opts): New option --auto-key-upload. (main): Set option. * g10/keyserver.c (keyserver_export_pubkey): New. (keyserver_put): Take care of the WARN_ONLY and LDAP_ONLY options. Delay printing of the EXPORTED status. * g10/keygen.c (do_generate_keypair): Export new key if option is set. * g10/export.c (do_export_one_keyblock): Take care of the NO_STATUS option. (print_status_exported): Move function to ... * g10/cpr.c (write_status_warning): here and make public. -- This change also fixes a bug with --send-key which used to emit an EXPORTED line before actually sending the key to the dirmngr. Thus if the upload failed a EXPORTED status has already been emitted. GnuPG-bug-id: 7333 This is the first part which handles the new key case. We also need to implement an upload after key modifications.
Diffstat (limited to 'g10/export.c')
-rw-r--r--g10/export.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/g10/export.c b/g10/export.c
index ffc37297c..5dcb9c665 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -1403,7 +1403,7 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
/* Print an "EXPORTED" status line. PK is the primary public key. */
-static void
+void
print_status_exported (PKT_public_key *pk)
{
char *hexfpr;
@@ -2018,7 +2018,8 @@ do_export_one_keyblock (ctrl_t ctrl, kbnode_t keyblock, u32 *keyid,
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
{
stats->exported++;
- print_status_exported (node->pkt->pkt.public_key);
+ if (!(options & EXPORT_NO_STATUS))
+ print_status_exported (node->pkt->pkt.public_key);
}
}
else if (!err)
@@ -2054,7 +2055,8 @@ do_export_one_keyblock (ctrl_t ctrl, kbnode_t keyblock, u32 *keyid,
if (node->pkt->pkttype == PKT_PUBLIC_KEY)
{
stats->exported++;
- print_status_exported (node->pkt->pkt.public_key);
+ if (!(options & EXPORT_NO_STATUS))
+ print_status_exported (node->pkt->pkt.public_key);
}
}
}
@@ -2088,7 +2090,8 @@ do_export_one_keyblock (ctrl_t ctrl, kbnode_t keyblock, u32 *keyid,
if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
{
stats->exported++;
- print_status_exported (node->pkt->pkt.public_key);
+ if (!(options & EXPORT_NO_STATUS))
+ print_status_exported (node->pkt->pkt.public_key);
}
}