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.
This is the first part which handles the new key case. We also need
to implement an upload after key modifications.
- GnuPG-bug-id: T7333