aboutsummaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use gpgrt_process_spawn functions from libgpg-error.NIIBE Yutaka2024-07-029-127/+116
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgconf: Allow listing of some new optionsWerner Koch2024-07-011-0/+3
| | | | | | | | -- Also one old option. GnuPG-bug-id: 6882
* gpg-mail-tube: New utility.Werner Koch2024-06-282-1/+832
| | | | | * tools/gpg-mail-tube.c: new. * tools/Makefile.am: Add it.
* tools: New support functions for the mail parser.Werner Koch2024-06-286-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.
* tools: Make gpg-authcode-sign.sh more robust on network errors.Werner Koch2024-06-111-3/+18
| | | | | | | | * tools/gpg-authcode-sign.sh: Return on HTTP status 500 -- We have seen timestamping failures after signing some file using GlobalSign certs.
* indent: Fix spellingDaniel Kahn Gillmor2024-05-319-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
* spawn: Remove spawn callback, introduce gnupg_spawn_actions.NIIBE Yutaka2024-05-316-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]>
* gpg-auth: Fix use after free.Jakub Jelen2024-05-281-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
* wks: Make sure that ERR is always initialized.Werner Koch2024-05-281-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]>
* tools: Fix help output for gpg-authcode-sign.shWerner Koch2024-05-221-2/+2
| | | | --
* Merge branch 'STABLE-BRANCH-2-4' into masterWerner Koch2024-05-163-64/+104
|\ | | | | | | | | | | | | | | | | | | -- Fixed conflicts in: NEWS g10/call-agent.c g10/options.h kbx/kbxutil.c tools/gpgconf.c
| * card: Fix compiler warning.Werner Koch2024-05-161-3/+3
| | | | | | | | | | * tools/gpg-card.h (opt): Make gpg_program, gpgsm_program, and agent_program const.
| * gpgconf: Change layout of the gpgconf -X output.Werner Koch2024-04-041-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.
| * gpgconf: Check readability of some files with -XWerner Koch2024-03-181-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.
| * gpg-check-pattern: Consider an empty pattern file as validWerner Koch2024-03-131-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.
* | scd:piv: Support listing of retired keys with KEYINFO.Werner Koch2024-05-061-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.
* | speedo: Use gpg-authcode-sign.sh and change archive label to v2.5.Werner Koch2024-04-251-1/+1
| | | | | | | | --
* | Install the new gpg-authcode-sign.sh script.Werner Koch2024-04-252-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.
* | Remove the deprecated gcry_set_log_handler.Werner Koch2024-04-231-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.
* | Allow installation with a gpgconf.ctl changed homedir.Werner Koch2024-03-211-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
* | card: Use xstrdup for module names.Werner Koch2024-03-121-2/+2
| | | | | | | | --
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2024-03-128-37/+67
|\| | | | | | | | | | | | | | | -- Resolved conflicts: NEWS common/exechelp-w32.c configure.ac
| * doc: Typo fix in commentWerner Koch2024-03-061-1/+1
| | | | | | | | --
| * wks: Make gpg-wks-client --mirror work w/o args.Werner Koch2024-03-061-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.
| * wks: Add option --realclean to gpg-wks-client.Werner Koch2024-03-044-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.
| * Allow tilde expansion for the foo-program options.Werner Koch2024-02-275-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
| * wks: Allow command style args for gpg-wks-client.Werner Koch2024-02-211-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.
| * doc: Fix spelling errors found by lintian.Werner Koch2024-01-292-2/+2
| | | | | | | | | | | | -- Reported-by: Andreas Metzler <[email protected]>
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2024-01-264-55/+309
|\| | | | | | | | | | | | | | | -- Fixed conflicts: NEWS configure.ac doc/gpg.texi
| * card: Tweak the checkcmds sub-command.Werner Koch2024-01-251-5/+8
| | | | | | | | * tools/gpg-card.c (cmd_checkkeys): Skip not found keys.
| * card: flush stdout to get checkcmd's info messages in order.Werner Koch2024-01-241-0/+1
| | | | | | | | * tools/gpg-card.c (cmd_checkkeys): Insert an fflush.
| * card: New subcommand "checkkeys".Werner Koch2024-01-223-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
| * doc: Document the gpgconf --unlock command.Werner Koch2024-01-111-4/+4
| | | | | | | | | | | | | | * tools/gpgconf.c (main): Fix usage message. -- GnuPG-bug-id: 6838
| * gpgconf: Adjust -X command for the new VERSION file formatWerner Koch2024-01-091-10/+38
| | | | | | | | | | | | | | | | * tools/gpgconf.c (show_version_gnupg): Read and parse the entire VERSION file. -- GnuPG-bug-id: 6918
| * tools: Fix argparse table of gpgconf.NIIBE Yutaka2023-12-251-35/+37
| | | | | | | | | | | | | | | | | | * tools/gpgconf.c (opts): Use ARGPARSE macros. -- GnuPG-bug-id: 6902 Signed-off-by: NIIBE Yutaka <[email protected]>
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2023-12-221-1/+69
|\| | | | | | | | | | | | | | | | | | | -- Fixed conflicts in NEWS g10/encrypt.c sm/encrypt.c sm/sign.c
| * tools: Remove the dotlock tool.NIIBE Yutaka2023-12-212-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]>
| * tools: Integrate the dotlock tool into gpgconf.NIIBE Yutaka2023-12-201-1/+69
| | | | | | | | | | | | | | | | | | * tools/gpgconf.c (dotlock_tool): New. (main): Add --lock and --unlock commands. -- Signed-off-by: NIIBE Yutaka <[email protected]>
| * common: Add dotlock util under libexec.NIIBE Yutaka2023-12-202-31/+65
| | | | | | | | | | | | | | | | | | * tools/Makefile.am (libexec_PROGRAMS): Add dotlock. * tools/dotlock.c: Finish the first implementation. -- Signed-off-by: NIIBE Yutaka <[email protected]>
| * kbx: Create public-keys.d, after creating the homedir.NIIBE Yutaka2023-12-191-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]>
| * gpg,tools: Handle GPG_ERR_PIN_BLOCKED and GPG_ERR_NO_RESET_CODE.NIIBE Yutaka2023-11-081-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]>
| * tools:gpg-card: Fix an error code for Reset Code.NIIBE Yutaka2023-11-081-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]>
* | gpg,tools: Handle GPG_ERR_PIN_BLOCKED and GPG_ERR_NO_RESET_CODE.NIIBE Yutaka2023-11-081-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]>
* | tools:gpg-card: Fix an error code for Reset Code.NIIBE Yutaka2023-11-081-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]>
* | Merge branch 'STABLE-BRANCH-2-4'Werner Koch2023-11-072-0/+3
|\| | | | | | | | | | | | | * common/b64dec.c (b64decode): Move to ... * common/miscellaneous.c: here. * common/t-b64.c: Re-inroduce and keep only the b64decode test code.
| * scd:openpgp: Return better error codes for the Reset Code.Werner Koch2023-10-061-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.
| * tools: Add TPM2DAEMON_SOCK_NAME for --remove-socketdir.NIIBE Yutaka2023-10-061-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]>
| * gpg-card: Give a hint on how to get help for the "yubikey" command.Werner Koch2023-10-051-0/+2
| | | | | | | | * tools/card-yubikey.c (yubikey_commands): Print a hint.
* | tools: Add TPM2DAEMON_SOCK_NAME for --remove-socketdir.NIIBE Yutaka2023-10-031-3/+7
| | | | | | | | | | | | | | | | * tools/gpgconf.c (main): Care about tpm2d. Emit correct ERR. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* | Use gpgrt_b64* API of libgpg-error.NIIBE Yutaka2023-09-263-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]>