aboutsummaryrefslogtreecommitdiffstats
path: root/tools (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-07-02Use gpgrt_process_spawn functions from libgpg-error.NIIBE Yutaka9-127/+116
Signed-off-by: NIIBE Yutaka <[email protected]>
2024-07-01gpgconf: Allow listing of some new optionsWerner Koch1-0/+3
-- Also one old option. GnuPG-bug-id: 6882
2024-06-28gpg-mail-tube: New utility.Werner Koch2-1/+832
* tools/gpg-mail-tube.c: new. * tools/Makefile.am: Add it.
2024-06-28tools: New support functions for the mail parser.Werner Koch6-6/+58
* tools/rfc822parse.h (RFC822PARSE_HEADER_SEEN): New. * tools/rfc822parse.c (rfc822_cmp_header_name): New. (insert_header): Run header seen callback. (rfc822parse_last_header_line): New. (rfc822_free): New. * tools/wks-receive.c (t2body): Use it here. * tools/mime-parser.c (parse_message_cb): and here.
2024-06-11tools: Make gpg-authcode-sign.sh more robust on network errors.Werner Koch1-3/+18
* tools/gpg-authcode-sign.sh: Return on HTTP status 500 -- We have seen timestamping failures after signing some file using GlobalSign certs.
2024-05-31indent: Fix spellingDaniel Kahn Gillmor9-18/+18
-- These are non-substantive corrections for minor spelling mistakes within the GnuPG codebase. With something like this applied to the codebase, and a judiciously tuned spellchecker integrated as part of a standard test suite, it should be possible to keep a uniform orthography within the project. GnuPG-bug-id: 7116
2024-05-31spawn: Remove spawn callback, introduce gnupg_spawn_actions.NIIBE Yutaka6-25/+60
* common/exechelp-posix.c (call_spawn_cb): Remove. (gnupg_spawn_actions_new, gnupg_spawn_actions_release) (gnupg_spawn_actions_set_environ, gnupg_spawn_actions_set_atfork) (gnupg_spawn_actions_set_redirect) (gnupg_spawn_actions_set_inherit_fds): New. (my_exec, spawn_detached): Use spawn actions. (gnupg_spawn_helper): Remove. (gnupg_process_spawn): Remove callback, introduce gnupg_spawn_actions. * common/exechelp-w32.c: Ditto. * common/exechelp.h: Ditto. * agent/genkey.c (do_check_passphrase_pattern): Follow the change of gnupg_process_spawn API. * common/asshelp.c (start_new_service): Likewise. * common/exectool.c (gnupg_exec_tool_stream): Likewise. * common/t-exechelp.c (test_pipe_stream): Likewise. * dirmngr/ldap-wrapper.c (ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Likewise. * scd/app.c (report_change): Likewise. * tests/gpgscm/ffi.c (do_process_spawn_io, do_process_spawn_fd): Likewise. * tools/gpg-card.c (cmd_gpg): Likewise. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Likewise. (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Likewise. * tools/gpgconf.c (show_versions_via_dirmngr): Likewise. * tools/gpgtar-create.c (gpgtar_create): Likewise. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2024-05-28gpg-auth: Fix use after free.Jakub Jelen1-1/+1
* tools/gpg-auth.c (ssh_authorized_keys): Move free after printing error message. -- Signed-off-by: Jakub Jelen <[email protected]> This is part of GnuPG-bug-id: 7129
2024-05-28wks: Make sure that ERR is always initialized.Werner Koch1-0/+1
* tools/wks-util.c (install_key_from_spec_file): Initialize ERR in case the loop is never run. -- This is part of GnuPG-bug-id: 7129 Co-authored-by: Jakub Jelen <[email protected]>
2024-05-22tools: Fix help output for gpg-authcode-sign.shWerner Koch1-2/+2
--
2024-05-16card: Fix compiler warning.Werner Koch1-3/+3
* tools/gpg-card.h (opt): Make gpg_program, gpgsm_program, and agent_program const.
2024-05-06scd:piv: Support listing of retired keys with KEYINFO.Werner Koch1-3/+25
* scd/app-piv.c (data_objects): Mark returned key as having a keypair. (do_with_keygrip): Check against encrusage and not used one tag. * tools/gpg-card.c (piv_keyref_is_retired): New. (list_all_kinfo): Pretty print retired keys. -- This allows to list all existing retired keys without using separate readkey commands.
2024-04-25speedo: Use gpg-authcode-sign.sh and change archive label to v2.5.Werner Koch1-1/+1
--
2024-04-25Install the new gpg-authcode-sign.sh script.Werner Koch2-0/+258
* tools/gpg-authcode-sign.sh: New. * tools/Makefile.am (bin_SCRIPTS): Add that tool. -- This script makes use of gpg anyway and thus it is best to have it also installed with the gpg version used to cross-build our software. The script was orginally developed for gpg4win.
2024-04-23Remove the deprecated gcry_set_log_handler.Werner Koch1-8/+0
* common/miscellaneous.c (my_gcry_logger): Remove. (setup_libgcrypt_logging): Do not call the deprecated gcry_set_log_handler. * kbx/kbxutil.c (my_gcry_logger): Remove. * tools/no-libgcrypt.c (gcry_set_log_handler): Remove stub.
2024-04-04gpgconf: Change layout of the gpgconf -X output.Werner Koch1-52/+71
* tools/gpgconf.c (list_dirs): Change the config mode output. (my_copy_file): Adjust output for org-mode style. (show_configs_one_file): Ditto. (show_other_registry_entries): Ditto. (show_registry_entries_from_file): Ditto. (show_configs): Ditto.
2024-03-21Allow installation with a gpgconf.ctl changed homedir.Werner Koch1-10/+18
* common/homedir.c (gpgconf_ctl): Add field "gnupg". (parse_gpgconf_ctl): Support keyword "gnupg". (my_gnupg_dirname): New. (my_fixed_default_homedir): New. (gnupg_registry_dir): New. (standard_homedir): Use my_gnupg_dirname and my_fixed_default_homedir. (default_homedir): Use gnupg_registry_dir and my_fixed_default_homedir. (_gnupg_socketdir_internal): Use my_gnupg_dirname. Increase size of prefixbuffer. (gnupg_sysconfdir): Use my_gnupg_dirname. * tools/gpgconf.c (list_dirs): Use gnupg_registry_dir. (show_other_registry_entries): Ditto. -- This will be useful to install versions of GnuPG VS-Desktop and GnuPG Desktop in addition to a standard GnuPG version. Only basic tests on Unix done; Windows testing is still outstanding. GnuPG-bug-id: 7040
2024-03-18gpgconf: Check readability of some files with -XWerner Koch1-8/+29
* tools/gpgconf.c (list_dirs): Rename arg from special to show_config_mode. Add "S.Uiserver" test and test existsing files for readability.
2024-03-13gpg-check-pattern: Consider an empty pattern file as validWerner Koch1-1/+1
* tools/gpg-check-pattern.c (read_file): Check length before calling fread. -- The problem with an empty file is that es_fread is called to read one element of length zero which seems to be undefined behaviour and results in ENOENT on my test box.
2024-03-12card: Use xstrdup for module names.Werner Koch1-2/+2
--
2024-03-06doc: Typo fix in commentWerner Koch1-1/+1
--
2024-03-06wks: Make gpg-wks-client --mirror work w/o args.Werner Koch1-1/+1
* tools/gpg-wks-client.c (mirror_one_key): Test for no domain specified. -- The code did not really work if no domain was given. It worked but filtered out all keys so that no key was actually exported.
2024-03-04wks: Add option --realclean to gpg-wks-client.Werner Koch4-4/+12
* tools/gpg-wks-client.c (oRealClean): New. (opts): Add "realclean". (parse_arguments): Implement. (main): Take a copy of the module name to fix bad assignment from a former patch. * tools/gpg-wks-server.c (main): Ditto. * tools/gpg-wks.h (opt): Add field realclean. * tools/wks-util.c (wks_get_key): Call gpg with export-realclean depending on the new option. -- The default for gpg-wks-client is to install keys with all valid key signatures. The new option will eventually allow to install the keys only with key signatures done by trusted-keys. Also the export-option is in gpg, it requires one more gpg patch to make it actually work.
2024-02-27Allow tilde expansion for the foo-program options.Werner Koch5-18/+32
* agent/gpg-agent.c (parse_rereadable_options): Use make_filename_try for opt.pinentry_program. Change definition accordingly. * g10/gpg.c (main): Use make_filename for agent_program, dirmngr_program, and keyboxd_program. Change definition accordingly. * sm/gpgsm.c (main): Ditto. * tools/gpg-card.c (parse_arguments): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpg-wks-client.c (parse_arguments): Likewise. Do it also for option --output. (process_confirmation_request): Print a note for a successful sent. -- GnuPG-bug-id: 7017
2024-02-21wks: Allow command style args for gpg-wks-client.Werner Koch1-11/+19
* tools/gpg-wks-client.c (wrong_args): Take two args. Change all callers. (main): Pass ARGPARSE_FLAG_COMMAND for recent gpgrt version. -- This requires gpgrt 1.48. Of course "gpg-wks-client --create ..." continues to work.
2024-01-29doc: Fix spelling errors found by lintian.Werner Koch2-2/+2
-- Reported-by: Andreas Metzler <[email protected]>
2024-01-25card: Tweak the checkcmds sub-command.Werner Koch1-5/+8
* tools/gpg-card.c (cmd_checkkeys): Skip not found keys.
2024-01-24card: flush stdout to get checkcmd's info messages in order.Werner Koch1-0/+1
* tools/gpg-card.c (cmd_checkkeys): Insert an fflush.
2024-01-22card: New subcommand "checkkeys".Werner Koch3-6/+226
* agent/command.c (cmd_havekey): Add new option --info. * tools/card-call-scd.c (scd_readkey): Allow using without result arg. (struct havekey_status_parm_s): New. (havekey_status_cb): New. (scd_havekey_info): New. (scd_delete_key): New. * tools/gpg-card.c (print_keygrip): Add arg with_lf. (cmd_checkkeys): New. (cmdCHECKKEYS): New. (cmds): Add command "checkkeys". (dispatch_command, interactive_loop): Call cmd_checkkeys. -- GnuPG-bug-id: 6943
2024-01-11doc: Document the gpgconf --unlock command.Werner Koch1-4/+4
* tools/gpgconf.c (main): Fix usage message. -- GnuPG-bug-id: 6838
2024-01-09gpgconf: Adjust -X command for the new VERSION file formatWerner Koch1-10/+38
* tools/gpgconf.c (show_version_gnupg): Read and parse the entire VERSION file. -- GnuPG-bug-id: 6918
2023-12-25tools: Fix argparse table of gpgconf.NIIBE Yutaka1-35/+37
* tools/gpgconf.c (opts): Use ARGPARSE macros. -- GnuPG-bug-id: 6902 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-12-21tools: Remove the dotlock tool.NIIBE Yutaka2-122/+1
* tools/Makefile.am (libexec_PROGRAMS): Remove dotlock. * tools/dotlock.c: Remove. -- It's integrated into gpgconf (--lock/--unlock). Signed-off-by: NIIBE Yutaka <[email protected]>
2023-12-20tools: Integrate the dotlock tool into gpgconf.NIIBE Yutaka1-1/+69
* tools/gpgconf.c (dotlock_tool): New. (main): Add --lock and --unlock commands. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-12-20common: Add dotlock util under libexec.NIIBE Yutaka2-31/+65
* tools/Makefile.am (libexec_PROGRAMS): Add dotlock. * tools/dotlock.c: Finish the first implementation. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-12-19kbx: Create public-keys.d, after creating the homedir.NIIBE Yutaka1-0/+87
* kbx/keyboxd.c (create_directories): Following the behavior of gpg-agent, call create_public_keys_directory after mkdir. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-11-08gpg,tools: Handle GPG_ERR_PIN_BLOCKED and GPG_ERR_NO_RESET_CODE.NIIBE Yutaka1-0/+6
* g10/card-util.c (write_sc_op_status): Emit 3 and 4 in status line. * tools/card-call-scd.c (status_sc_op_failure): Likewise. -- Cherry-pick from master commit of: 64f5f7b74e428b15205f6e8ae14dec84663c3076 GnuPG-bug-id: 6425 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-11-08tools:gpg-card: Fix an error code for Reset Code.NIIBE Yutaka1-1/+1
* tools/gpg-card.c (cmd_unblock): Use GPG_ERR_NO_RESET_CODE. -- Cherry-pick from master commit of: 65607fb81def5fc55320a1abfbb8ebdad9512011 GnuPG-bug-id: 6425 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-11-08gpg,tools: Handle GPG_ERR_PIN_BLOCKED and GPG_ERR_NO_RESET_CODE.NIIBE Yutaka1-0/+6
* g10/card-util.c (write_sc_op_status): Emit 3 and 4 in status line. * tools/card-call-scd.c (status_sc_op_failure): Likewise. -- GnuPG-bug-id: 6425 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-11-08tools:gpg-card: Fix an error code for Reset Code.NIIBE Yutaka1-1/+1
* tools/gpg-card.c (cmd_unblock): Use GPG_ERR_NO_RESET_CODE. -- GnuPG-bug-id: 6425 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-10-06scd:openpgp: Return better error codes for the Reset Code.Werner Koch1-0/+1
* scd/app-openpgp.c (do_change_pin): Use GPG_ERR_BAD_RESET_CODE where appropriate. * common/util.h: Add error codes missing in gpgrt 1.46. * agent/call-pinentry.c (unlock_pinentry): Handle GPG_ERR_BAD_RESET_CODE. (agent_askpin): Ditlo. Also simply condition. (agent_get_passphrase): Ditto. * g10/call-agent.c (status_sc_op_failure): Handle GPG_ERR_BAD_RESET_CODE. * g10/card-util.c (write_sc_op_status): Ditto. * tools/card-call-scd.c (status_sc_op_failure): Ditto.
2023-10-06tools: Add TPM2DAEMON_SOCK_NAME for --remove-socketdir.NIIBE Yutaka1-3/+7
* tools/gpgconf.c (main): Care about tpm2d. Emit correct ERR. -- Cherry-picked from master commit of: 25c84ffd1078e6619761aa731a82dbaf4175c02e Signed-off-by: NIIBE Yutaka <[email protected]>
2023-10-05gpg-card: Give a hint on how to get help for the "yubikey" command.Werner Koch1-0/+2
* tools/card-yubikey.c (yubikey_commands): Print a hint.
2023-10-03tools: Add TPM2DAEMON_SOCK_NAME for --remove-socketdir.NIIBE Yutaka1-3/+7
* tools/gpgconf.c (main): Care about tpm2d. Emit correct ERR. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-09-26Use gpgrt_b64* API of libgpg-error.NIIBE Yutaka3-26/+24
* common/Makefile.am (common_sources): Remove b64enc.c and b64dec.c. (module_maint_tests): Remove t-b64. (t_b64_LDADD): Remove. * common/util.h: Remove the internal API. * common/ssh-utils.c (get_fingerprint): Use the gpgrt_b64 API. (ssh_public_key_in_base64): Likewise. * dirmngr/crlfetch.c (my_es_read, crl_close_reader): Likewise. * dirmngr/dirmngr-client.c (data_cb, do_lookup): Likewise. * dirmngr/misc.c (armor_data): Likewise. * g10/export.c (export_one_ssh_key, export_secret_ssh_key): Likewise. * tools/gpg-card.c (cmd_writecert): Likewise. * tools/mime-parser.c (parse_message_cb, mime_parser_release) (process_part_data): Likewise. * tools/wks-util.c (wks_armor_key): Likewise. -- GnuPG-bug-id: 6734 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-08-29common: Prepare for more flags in start_new_service.Werner Koch4-6/+8
* common/asshelp.h (ASSHELP_FLAG_AUTOSTART): New. * common/asshelp.c (start_new_service): Rename arg autostart to flags and adjust checks. (start_new_gpg_agent): Likewise. Change all callers. (start_new_keyboxd): Likewise. Change all callers. (start_new_dirmngr): Likewise. Change all callers. -- It is easier to have a generic flags arg instead of adding more and more dedicated args. verbose and debug are kept as they are because they are not boolean.
2023-07-18dirmngr,kbk,tools: Fix type casting.NIIBE Yutaka1-1/+1
* dirmngr/http.c (send_request): Remove cast which is not needed. * kbx/kbx-client-util.c (prepare_data_pipe): Cast to HANDLE. * tools/gpg-connect-agent.c (do_open): Ditto. -- GnuPG-bug-id: 6508 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-07-03tools:gpg-connect-agent: Fix use of HANDLE on Windows.NIIBE Yutaka1-4/+24
* tools/gpg-connect-agent.c [HAVE_W32_SYSTEM] (do_open): Use %p to format the HANDLE. [HAVE_W32_SYSTEM] (do_close): Use gnupg_parse_fdstr to parse the string representation of the HANDLE. Use %p. -- GnuPG-bug-id: 6508 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-06-28tools:gpgtar: Clean up the use of --status-fd.NIIBE Yutaka1-25/+6
* common/sysutils.c (gnupg_parse_fdstr): Rename from gnupg_sys2libc_fdstr, as there is no translation any more. * common/sysutils.h (gnupg_parse_fdstr): Rename from gnupg_sys2libc_fdstr. * tools/gpgtar.c (main): Use gnupg_parse_fdstr, in cleaner way. -- GnuPG-bug-id: 6562 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-06-27gpgtar: Use FD on POSIX.NIIBE Yutaka1-1/+1
* tools/gpgtar.c (main): Fix the use of the union. -- Fixes-commit: 2756147e392c8f58fc79db6b9420b306b6ddd082 GnuPG-bug-id: 6562 Signed-off-by: NIIBE Yutaka <[email protected]>