aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgconf-comp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpgconf: Fix reload and kill of keyboxd.Werner Koch2025-03-171-4/+4
| | | | | | | | * tools/gpgconf-comp.c (keyboxd_runtime_change): Fix order of args. -- Fixes-commit: acaeba2dbdb9bbd68a823c671d5c3577fef5d26d GnuPG-bug-id: 7569
* gpgconf: Add list flag to trusted-key et al.Werner Koch2024-10-011-3/+3
| | | | | | | | * tools/gpgconf-comp.c (known_options_gpg): Add list flag to sume options. -- GnuPG-bug-id: 7313
* Use gpgrt_process_spawn API from libgpg-error.NIIBE Yutaka2024-07-091-42/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/genkey.c (do_check_passphrase_pattern): Use the gpgrt API. * common/asshelp.c (start_new_service): Ditto. * common/exechelp.h: Remove gnupg_process_spawn API. * common/exechelp-posix.c: Remove gnupg_process_spawn implementation. * common/exechelp-w32.c: Likewise. * common/exectool.c (gnupg_exec_tool_stream): Use the gpgrt API. * common/t-exechelp.c (test_pipe_stream): Remove. * dirmngr/ldap-wrapper.c (destroy_wrapper, ldap_reaper_thread): Use the gpgrt API. (ldap_wrapper_connection_cleanup, ldap_wrapper): Ditto. * dirmngr/ldap.c, g10/call-keyboxd.c: No need to include exechelp.h. * g10/photoid.c (run_with_pipe, show_photo): Use the gpgrt API. * g13/be-encfs.c (run_umount_helper, run_encfs_tool): Ditto. * g13/g13.c, g13/mount.c, g13/runner.c: No need to include exechelp.h. * scd/apdu.c: No need to include exechelp.h. * scd/app.c (report_change): Use the gpgrt API. * sm/export.c, sm/import.c: No need to include exechelp.h. * tests/gpgscm/ffi.c (proc_object_finalize, proc_wrap) (do_process_spawn_io, do_process_spawn_fd, do_process_wait): Use the gpgrt API. * tools/gpg-auth.c: No need to include exechelp.h. * tools/gpg-card.c (cmd_gpg): Use the gpgrt API. * tools/gpg-connect-agent.c: No need to include exechelp.h. * tools/gpg-mail-tube.c (mail_tube_encrypt, prepare_for_appimage) (start_gpg_encrypt): Use the gpgrt API. * tools/gpgconf-comp.c (gpg_agent_runtime_change) (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Ditto. * tools/gpgconf.c (show_versions_via_dirmngr): Ditto. * tools/gpgtar-create.c (gpgtar_create): Ditto. * tools/gpgtar-extract.c (gpgtar_extract): Ditto. * tools/gpgtar-list.c (gpgtar_list): Ditto. -- GnuPG-bug-id: 7192 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
* indent: Fix spellingDaniel Kahn Gillmor2024-05-311-6/+6
| | | | | | | | | | | | | -- 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-311-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* common,agent,gpg,dirmngr,g13,scd,tests,tools: New spawn function.NIIBE Yutaka2023-05-111-47/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/exechelp-posix.c (do_exec, gnupg_spawn_process): Remove. (check_syscall_func, pre_syscall, post_syscall) : New. (do_create_socketpair, posix_open_null, call_spawn_cb): New. (my_exec, spawn_detached, gnupg_spawn_helper): New. (gnupg_process_spawn, process_kill, gnupg_process_terminate): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_release): New. (gnupg_process_wait_list): New. * common/exechelp-w32.c: Add definition of _WIN32_WINNT as 0x600. (check_syscall_func, pre_syscall, post_syscall): New. (gnupg_spawn_process): Remove. (check_windows_version): New. (spawn_detached, gnupg_spawn_helper, gnupg_process_spawn): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_kill, process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_terminate): New. (gnupg_process_release, gnupg_process_wait_list): New. * common/exechelp.h: Re-write for new API. * common/exectool.c (gnupg_exec_tool_stream): Follow the change. * common/asshelp.c (start_new_service): Likewise. * agent/genkey.c (do_check_passphrase_pattern): Likewise. * dirmngr/ldap-wrapper.c (struct wrapper_context_s): Use PROC. (destroy_wrapper): Follow the change of API. (read_log_data): Follow the change of API, use printable_pid. (ldap_reaper_thread, ldap_wrapper_release_context): Likewise. (ldap_wrapper_connection_cleanup, ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Follow the change of API. (show_photo): Likewise. * g13/be-encfs.c (run_umount_helper): Likewise. (run_encfs_tool): Likewise. * g13/g13.c: Add including ./common/exechelp.h. * g13/mount.c: Likewise. * g13/runner.c: Follow the change of API. * g13/runner.h: Follow the change of API. * scd/app.c (setup_env): New. (report_change): Follow the change of API. * tests/gpgscm/ffi.c (proc_object_finalize): New. (proc_object_to_string): New. (proc_wrap, proc_unwrap): New. (do_spawn_process): Remove. (do_process_spawn): New. (setup_std_fds): New. (do_spawn_process_fd): Remove. (do_process_spawn_fd): New. (do_wait_process): Remove. (do_process_wait): New. (do_wait_processes): Remove. * tests/gpgscm/t-child.scm: Follow the change of API. * tests/gpgscm/tests.scm: Likewise. * tests/openpgp/defs.scm: Likewise. * tests/tpm2dtests/defs.scm: Likewise. * tools/gpg-card.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgconf.c: Likewise. * tools/gpgtar-create.c: Likewise. * tools/gpgtar-extract.c: Likewise. * tools/gpgtar-list.c: Likewise. -- GnuPG-bug-id: 6275 Signed-off-by: NIIBE Yutaka <[email protected]>
* agent,common,dirmngr,tests,tools: Remove spawn PREEXEC argument.NIIBE Yutaka2022-10-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/exechelp-posix.c (do_exec): Remove PREEXEC argument. (gnupg_spawn_process): Likewise. (gnupg_spawn_process_fd): Follow the change of do_exec. (gnupg_spawn_process_detached): Likewise. * common/exechelp-w32.c (gnupg_spawn_process): Remove PREEXEC. * common/exechelp.h (gnupg_spawn_process): Remove PREEXEC. * agent/genkey.c (do_check_passphrase_pattern): Follow the change. * common/exectool.c (gnupg_exec_tool_stream): Likewise. * dirmngr/ldap-wrapper.c (ldap_wrapper): Likewise. * tests/gpgscm/ffi.c (do_spawn_process): Likewise. * tools/gpgconf-comp.c (gc_component_check_options): Likewise. (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. -- PREEXEC is not portable feature and it's not used. GnuPG-bug-id: 6249 Signed-off-by: NIIBE Yutaka <[email protected]>
* Remove remaining support for WindowsCEWerner Koch2022-06-031-2/+5
| | | | --
* tools:gpgconf: Fix gc_component table.NIIBE Yutaka2022-03-251-0/+2
| | | | | | | | | | | * tools/gpgconf-comp.c [!BUILD_WITH_TPM2D] (gc_component): Add a dummy entry. -- GnuPG-bug-id: 5701 Reported-by: Adriaan de Groot Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgconf: Return again "keyserver" for gpgsm.Werner Koch2022-01-271-1/+1
| | | | | * tools/gpgconf-comp.c (known_options_gpgsm): Change "ldapserver" back to "keyserver".
* gpgconf: Fix --list-options for forced optionsWerner Koch2022-01-261-1/+6
| | | | | | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_program): Ignore to to ignored options. Add failsafe code to avoid calling percent_escape with NULL. -- Remember: When using ARGPARSE_FLAG_WITHATTR the ARGPARSE_OPT_IGNORE flags in the returned type needs to be considered. GnuPG-bug-id: 5800
* gpgconf: Return --ldapserver and --keyserver from dirmngr.Werner Koch2022-01-251-1/+3
| | | | | | | | | | | * dirmngr/dirmngr.c: Reorder two option groups. * tools/gpgconf-comp.c (known_options_gpgsm): Rename "keyserver" to "ldapserver" and set level to invisible. (known_options_dirmngr): Add "ldapserver" at the basic level. * sm/gpgsm.c (opts): No more help text for "ldapserver". -- GnuPG-bug-id: 5800
* gpgconf: Do not list ignored options and mark forced options as r/o.Werner Koch2021-12-301-7/+17
| | | | | | | | * tools/gpgconf-comp.c (list_one_option): Skip ignored options and set the no_change flag for forced options. (retrieve_options_from_program): Put the attributes into the option table. --
* gpgconf: Allow changing gpg's deprecated keyserver optionikloecker/t5462Ingo Klöcker2021-11-031-0/+1
| | | | | | | | | | * tools/gpgconf-comp.c (known_options_gpg): Add "keyserver". -- This allows Kleopatra to read and change the keyserver that is used by gpg if the deprecated keyserver option in gpg.conf is set. GnuPG-bug-id: 5462
* common: Respect gpgconf.ctl when looking up translationsIngo Klöcker2021-10-061-1/+1
| | | | | | | | | | | | | * common/i18n.c (i18n_init): Use gnupg_localedir() instead of LOCALEDIR. (i18n_localegettext): Ditto. * tools/gpgconf-comp.c (my_dgettext): Ditto. -- On Unix, gnupg_localedir() returns the locale directory relative to the root directory of the gnupg installation if specified in the gpgconf.ctl. Otherwise, it returns the built-in LOCALEDIR. GnuPG-bug-id: 5999
* agent: New option --check-sym-passphrase-pattern.Werner Koch2021-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c (oCheckSymPassphrasePattern): New. (opts): Add --check-sym-passphrase-pattern. (parse_rereadable_options): Set option. (main): Return option info. * tools/gpgconf-comp.c: Add new option. * agent/agent.h (opt): Add var check_sym_passphrase_pattern. (struct pin_entry_info_s): Add var constraints_flags. (CHECK_CONSTRAINTS_NOT_EMPTY): New to replace a hardwired 1. (CHECK_CONSTRAINTS_NEW_SYMKEY): New. * agent/genkey.c (check_passphrase_pattern): Rename to ... (do_check_passphrase_pattern): this to make code reading easier. Handle the --check-sym-passphrase-pattern option. (check_passphrase_constraints): Replace arg no_empty by a generic flags arg. Also handle --check-sym-passphrase-pattern here. * agent/command.c (cmd_get_passphrase): In --newsymkey mode pass CHECK_CONSTRAINTS_NEW_SYMKEY flag. * agent/call-pinentry.c (struct entry_parm_s): Add constraints_flags. (struct inq_cb_parm_s): New. (inq_cb): Use new struct for parameter passing. Pass flags to teh constraints checking. (do_getpin): Pass constraints flag down. (agent_askpin): Take constrainst flag from the supplied pinentry struct. -- Requirements for a passphrase to protect a private key and for a passphrase used for symmetric encryption are different. Thus a the use of a different pattern file will be useful. Note that a pattern file can be used to replace the other passphrase constraints options and thus we don't need to duplicate them for symmetric encryption. GnuPG-bug-id: 5517 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Make runtime changes with different homedir work.Werner Koch2021-05-281-4/+4
| | | | * tools/gpgconf-comp.c (dirmngr_runtime_change): Pass --homedir first.
* tools: Fix for --disable-tpm2d.NIIBE Yutaka2021-04-231-0/+8
| | | | | | | | | * tools/gpgconf-comp.c: Conditionalize with BUILD_WITH_TPM2D. -- GnuPG-bug-id: 5408 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgconf: Fix a diagnostic output.Werner Koch2021-04-201-1/+4
| | | | | | | * tools/gpgconf-comp.c (gc_component_launch): Fix diagnostic. * doc/examples/common.conf: Fix example. Signed-off-by: Werner Koch <[email protected]>
* gpg,gpgsm: Move use-keyboxd to the new conf file common.confWerner Koch2021-04-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/comopt.c, common/comopt.h: New. * common/Makefile.am: Add them. * g10/gpg.c: Include comopt.h. (main): Also parse common.conf. * sm/gpgsm.c: Include comopt.h. (main): Set a flag for the --no-logfile option. Parse common.conf. * tools/gpgconf-comp.c (known_options_gpg): Remove "use-keyboxd", add pseudo option "use_keyboxd". (known_pseudo_options_gpg): Add pseudo option "use_keyboxd". (known_options_gpgsm): Remove "use-keyboxd". * tests/openpgp/defs.scm (create-gpghome): Create common.conf. * doc/examples/common.conf: New. -- Note that --use-keybox still works but prints a warning. We will eventually remove this option becuase it was marked as an experimental feature anyway. It would be too confusing if gpg and gpgsm use different key storages. Further, other components (e.g. dirmngr or gpg-wks-client) which call gpg or gpgsm need to be aware that the keyboxd is used and pass that option on the command line. Now that common.conf is always read (even if --no-options is used) those tools will work instantly.
* gpgconf: Return a new pseudo option compliance_de_vs.Werner Koch2021-04-011-2/+6
| | | | | | | | | | | | | * tools/gpgconf-comp.c (known_pseudo_options_gpg): Add "compliance_de_vs". * g10/gpg.c (gpgconf_list): Returh that pseudo option. -- Of course this will always return false for this version of gnupg. But as soon as this version has been approved we have everything ready for a runtime check. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Do not i18n an empty string to the PO files meta data.Werner Koch2021-03-281-0/+3
| | | | | | | * tools/gpgconf-comp.c (my_dgettext): Ignore empty strings. -- GnuPG-bug-id: 5363
* gpgconf: Fix another argv overflow if --homedir is used.Werner Koch2021-03-261-2/+3
| | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_check_options): Increase array. -- I missed to fix that one with the last patch. Note that there was no problem in 2.2 at thismlocation - probably because it had been manually backported once. GnuPG-bug-id: 5366 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Fix argv overflow if --homedir is used.Werner Koch2021-03-261-28/+43
| | | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_launch): Fix crasg due to too small array. (gpg_agent_runtime_change): Fix error message. (scdaemon_runtime_change): Ditto. (tpm2daemon_runtime_change): Ditto. (dirmngr_runtime_change): Ditto. (keyboxd_runtime_change): Ditto. -- GnuPG-bug-id: 5366 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Fix listing of default_pubkey_algo.Werner Koch2021-03-231-28/+108
| | | | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (known_options_gpg, known_options_gpgsm): No flags needed for pseudo options. (known_pseudo_options_gpg, known_pseudo_options_gpgsm): New. (gc_component): Add field known_pseudo_options. (struct read_line_wrapper_parm_s): New. (read_line_wrapper): New. (retrieve_options_from_program): Use read_line_wrapper to handle pseudo options. -- GnuPG-bug-id: 5341 Due to reading the list of options from the argparser of the component, we had no more information about the pseudo options and thus could not emit them. Well, there is just one pseudo option right now, but with this change we have a generalized concept for them: Pseudo options are used to convey information from a component to gpgconf; for example build-in values.
* gpgconf: Support use-keyboxd.Werner Koch2021-03-221-0/+5
| | | | | | | -- We flag this option as invisible so that it does not show up in a GUI but it will be possible to grep for the option.
* tpm2d: Add tpm2daemon codeJames Bottomley2021-03-101-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tpm2d: New directory. * Makefile.am (SUBDIRS): Add directory. * configure.ac: Detect libtss and decide whether to build tpm2d. * am/cmacros.am: Add a define. * util.h (GNUPG_MODULE_NAME_TPM2DAEMON): New. * common/homedir.c (gnupg_module_name): Add tpm2d. * common/mapstrings.c (macros): Add "TPM2DAEMON". * tools/gpgconf.h (GC_COMPONENT_TPM2DAEMON): New. * tools/gpgconf-comp.c (known_options_tpm2daemon): New. (gc_component): Add TPM2. (tpm2daemon_runtime_change): New. * tpm2d/Makefile.am: New. * tpm2d/command.c: New. * tpm2d/ibm-tss.h: New. * tpm2d/tpm2.c: New. * tpm2d/tpm2.h: New. * tpm2d/tpm2daemon.c: New. * tpm2d/tpm2daemon.h: New. --- This commit adds and plumbs in a tpm2daemon to the build to mirror the operation of scdaemon. The architecture of the code is that tpm2daemon.c itself is pretty much a clone of scd/scdaemon.c just with updated function prefixes (this argues there could be some further consolidation of the daemon handling code). Note that although this commit causes the daemon to be built and installed, nothing actually starts it or uses it yet. Command handling ---------------- command.c is copied from the command handler in scd.c except that the command implementation is now done in terms of tpm2 commands and the wire protocol is far simpler. The tpm2daemon only responds to 4 commands IMPORT: import a standard s-expression private key and export it to TPM2 format. This conversion cannot be undone and the private key now can *only* be used by the TPM2. To anyone who gets hold of the private key now, it's just an encrypted binary blob. PKSIGN: create a signature from the tpm2 key. The TPM2 form private key is retrieved by KEYDATA and the hash to be signed by EXTRA. Note there is no hash specifier because the tpm2 tss deduces the hash type from the length of the EXTRA data. This is actually a limitation of the tpm2 command API and it will be interesting to see how this fares if the tpm2 ever supports say sha3-256 hashes. PKDECRYPT: decrypt (RSA case) or derive (ECC case) a symmetric key. The tpm2 for private key is retrieved by KEYDATA and the information used to create the symmetric key by EXTRA. KILLTPM2D: stop the daemon All the tpm2 primitives used by command.c are in tpm2.h and all the tpm2 specific gunk is confined to tpm2.c, which is the only piece of this that actually does calls into the tss library. Signed-off-by: James Bottomley <[email protected]> Changes from James' patch: - gpgconf: The displayed name is "TPM" and not "TPM2". That string is used by GUIs and should be something the user understands. For example we also use "network" instead of "Dirmngr". - Removed some commented includes. - Use 16 as emulation of GPG_ERR_SOURCE_TPM2. - Silenced a C90 compiler warning and flags unused parameters. - Removed "if HAVE_LIBS" from tpm2/Makefile.am and add missing files so that make distcheck works. Signed-off-by: Werner Koch <[email protected]>
* Replace most calls to open by a new wrapper.Werner Koch2020-10-201-2/+3
| | | | | | | | | | | | * common/sysutils.c (any8bitchar) [W32]: New. (gnupg_open): New. Replace most calls to open by this. * common/iobuf.c (any8bitchar) [W32]: New. (direct_open) [W32]: Use CreateFileW if needed. -- This is yet another step for full Unicode support on Windows. GnuPG-bug-id: 5098
* Replace all calls to access by gnupg_accessWerner Koch2020-10-201-2/+2
| | | | | | | | | | | | | | | | * common/sysutils.c (gnupg_access): New. Replace all calls to access by this wrapper. * common/homedir.c (w32_shgetfolderpath): Change to return UTF-8 directory name. (standard_homedir): Adjust for change. (w32_commondir, gnupg_cachedir): Ditto. -- Also use SHGetFolderPathW instead of SHGetFolderPathA on Windows. This is required to correctly handle non-ascii filenames on Windows. GnuPG-bug-id: 5098
* dirmngr: Add warning on the use of --add-servers.Werner Koch2020-10-051-1/+1
| | | | | * tools/gpgconf-comp.c (known_options_dirmngr): Degrade add-servers to expert mode.
* gpgconf: New option --show-versions.Werner Koch2020-10-021-8/+0
| | | | | | | | | | | | | | | | | | | * tools/gpgconf.c: Include exechelp.h. New option --show-versions. (get_revision_from_blurb): New. (show_version_gnupg): New. (show_version_libgcrypt): New. (show_version_gpgrt): New. (show_versions_via_dirmngr): New. (show_versions): New. * tools/gpgconf-comp.c (GPGNAME): Remove unused macro. * dirmngr/dirmngr.c (main): New internal option --gpgconf-versions. (get_revision_from_blurb): New. (gpgconf_versions): New. -- This option should be helpful to gather information for debugging. Signed-off-by: Werner Koch <[email protected]>
* keyboxd: Integrate into gpgconf.Werner Koch2020-09-241-1/+56
| | | | | | | | | | | | | | * common/asshelp.c (lock_spawning): Use a dedicated name for keyboxd. * common/homedir.c (keyboxd_socket_name): New. (gnupg_module_name): Put keyboxd into libexecdir. * tools/gpgconf-comp.c (known_options_keyboxd): New. (gc_component): Add entry for keyboxd. (keyboxd_runtime_change): New. (gc_component_launch): Support keyboxd. * tools/gpgconf.c (list_dirs): Emit new item keyboxd-socket. (main): Also remove keyboxd socket. Signed-off-by: Werner Koch <[email protected]>
* common,agent,dirmngr,g10,tools: Fix split_fields API.NIIBE Yutaka2020-09-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | * common/stringhelp.h (split_fields): Use const * for the strings in the ARRAY. (split_fields_colon): Likewise. * common/stringhelp.c (split_fields, split_fields_colon): Fix the implementation. * agent/call-scd.c, agent/command.c: Follow the change. * common/t-stringhelp.c, dirmngr/loadswdb.c: Likewise. * g10/call-agent.c, tools/card-call-scd.c: Likewise. * tools/card-yubikey.c, tools/gpg-card.c: Likewise. * tools/gpg-card.h, tools/gpg-wks-client.c: Likewise. * tools/gpgconf-comp.c, tools/gpgconf.c: Likewise. * tools/wks-util.c: Likewise. -- The strings in the ARRAY don't need to be released by caller, as those are references. It's easier to follow the code when it's explicitly const *. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgconf: Silence warnings from parsing the options filesWerner Koch2020-08-251-2/+3
| | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_program): Set verbose flag for the arg parser only in --verbose mode. -- Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Fix regression in --launch and --kill from MarchWerner Koch2020-06-241-0/+4
| | | | | | | | | | | | * tools/gpgconf.h (gc_component_id_t): Align order with gc_component array. -- Fixes-commit: b4f1159a5bd7b2799d7d35e883e0632ebf3339c8 gpgconf: Rewrite the gpgconf-comp module from 2020-03-12 Signed-off-by: Werner Koch <[email protected]>
* doc: Typo fix in code comment.Werner Koch2020-04-071-1/+1
| | | | --
* gpgconf: Take care of --homedir when reading/updating options.Werner Koch2020-03-191-7/+20
| | | | | | | | | | | | | | * tools/gpgconf-comp.c (gpg_agent_runtime_change): Remove unused var. (scdaemon_runtime_change): Ditto. (dirmngr_runtime_change): Ditto. (gc_component_check_options): Pass --homedir if needed. (retrieve_options_from_program): Take care of --homedir. -- This is related to bug 4882 but different due all the code changes. GnuPG-bug-id: 4882 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Further simplify the gpgconf option processing.Werner Koch2020-03-141-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/gc-opt-flags.h (GC_OPT_FLAG_RUNTIME): Move to ... * tools/gpgconf-comp.c: here. (known_options_scdaemon): Remove "options". (known_options_dirmngr): Remove "options". (known_options_gpgsm): Remove "options". (known_options_gpg): Remove "options" and "keyserver". (struct gc_option_s): Rename active t gpgconf_list. (gc_component_list_options): Do not act upon active. (option_check_validity): Ditto. (is_known_option): Make it work correctly for unknown options. (retrieve_options_from_program): Use renamed flag gpgconf_list only to detect duplicated items from --gpgconf-list. Do not set runtime. Only e set the options if set by --gpgconf-list; never clear them. * agent/gpg-agent.c: Simplify the --gpgconf-list output. * dirmngr/dirmngr.c: Ditto. * g10/gpg.c: Ditto. * kbx/keyboxd.c: Ditto. * scd/scdaemon.c: Ditto. * sm/gpgsm.c: Ditto. * tests/openpgp/gpgconf.scm: Use "compliance" instead of "keyserver" for the string arg test. -- There is no need to read the list of options from the components unless they convey a default value. It is better to consult only the list we have in gpgconf-comp.c to decide on whether an option should be displayed. Right, this might mess up thing if a newer gpgconf version is used with an older component, but we already print warnings in this case and in general we do not want to support this anymore - the times of gpg 1.4. and 2.0 are long over now. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --auto-key-importWerner Koch2020-03-141-1/+2
| | | | | | | | | | | | | | | | | * g10/gpg.c (opts): New options --auto-key-import, --no-auto-key-import, and --no-include-key-block. (gpgconf_list): Add them. * g10/options.h (opt): Add field flags.auto_key_import. * g10/mainproc.c (check_sig_and_print): Use flag to enable that feature. * tools/gpgconf-comp.c: Give the new options a Basic config level. -- Note that the --no variants of the options are intended for easy disabling at the command line. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Rewrite the gpgconf-comp module.Werner Koch2020-03-121-1581/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf.h (gc_component_t): Change type to ... (gc_component_id_t): this. (GC_COMPONENT_ANY): New, so that we can use that in gpgconf-comp.c directly. * tools/gpgconf-comp.c: Major rework. -- The primary reason for this rework is to support the global options. A second reason is to clean up the code and simplify it so that we do not anymore need to maintain a list of options in the components _and_ in gpgconf-comp.c. What we do now is to 1. Read the option tables directly from the components using the new generic --dump-option-table option. This includes the header (group) descriptions. 2. Read the default values from the components as before using --gpgconf-list and update gpgconf's internal tables with that info. 3. Read the options using gpgrt_argparser in the same way as we do this in the components. The changes also do away with the second level notion of backends; they were only used for dirmngr's extra dirmngr_ldapservers.conf file. We intend to remove that file and replace it with a regular option so that it will be similar on how OpenPGP keyservers are specified. The whole thing will currently be slower than before (in particular on Windows) but we can optimize that by keeping a cached version of the option tables and the default values in a per homedir cache file. There is also some work planned to remove most of the data returned by --gpgconf-list. What can also be done is to replace the internal tables, which list the gpgconf maintainable options, by a configuration file so that admins are able to maintain the list of these options. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
* gpg: Re-group the options in the --help output.Werner Koch2020-03-061-1/+2
| | | | | | | | | | | * g10/gpg.c (opts): Change oLoadExtensions, oStrict, and oNoStrict to use ARGPARSE_ignore and remove the code in the option switch. -- This looks better and is also required for further simplifications of gpgconf. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Support reading global options (part 2).Werner Koch2020-03-061-115/+96
| | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c: Remove all regular option descriptions. They are now read in from the component. Also remove a few meanwhile obsolete options. * agent/gpg-agent.c: Add option description which were only set in gpgconf-comp.c. * dirmngr/dirmngr.c: Ditto. * scd/scdaemon.c: Ditto. * sm/gpgsm.c: Ditto. * g10/gpg.c: Ditto. -- This second part removes all regular option descriptions because they can be read from the components. A few were missing in the components and thus moved to there. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Support reading global options (part 1).Werner Koch2020-03-051-103/+186
| | | | | | | | | | | | | | | | | | | | | * tools/gpgconf.c (main): Set the coinfig directories. * tools/gpgconf-comp.c (gc_backend): Change the name of the config files. (struct gc_option): Add new field 'attr'. (retrieve_options_from_program): Rewrite to use gpgrt_argparser. -- We need to do larger changes to gpgconf so that it is possible to get also global config options and their attributes. The old code worked along its own list of option and used a generic option file parser. This has no support for global config files. We now use gpgrt_argparser so that we to do exactly the same as the component does and thus delivers the actual option values as seen by the component. This is just a first step and we need to change more things. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Always use xmalloc.Werner Koch2020-03-031-30/+25
| | | | | | | | | | | | | | * tools/gpgconf-comp.c: Fix spelling of "cannot". Use log_assert instead of a plain assert. (gc_percent_escape, percent_deescape): Fail on malloc error. -- It does not make sense to use xtryalloc and failing then anyway. We also should use our wrappers and not a plain realloc. Everywhere elese we use the non-formal "can't" so it is better to do the same here. Signed-off-by: Werner Koch <[email protected]>
* Spelling cleanup.Daniel Kahn Gillmor2020-02-181-3/+3
| | | | | | | | | | | | | | | | No functional changes, just fixing minor spelling issues. --- Most of these were identified from the command line by running: codespell \ --ignore-words-list fpr,stati,keyserver,keyservers,asign,cas,iff,ifset \ --skip '*.po,ChangeLog*,help.*.txt,*.jpg,*.eps,*.pdf,*.png,*.gpg,*.asc' \ doc g13 g10 kbx agent artwork scd tests tools am common dirmngr sm \ NEWS README README.maint TODO Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpgconf: Suggest the use of --gpgconf-test on --launch problems.Werner Koch2019-08-231-1/+1
| | | | | | | | * tools/gpgconf-comp.c (gc_component_launch): Change suggestion. -- GnuPG-bug-id: 4668 Signed-off-by: Werner Koch <[email protected]>
* tools: gpgconf: Killing order is children-first.NIIBE Yutaka2019-07-011-1/+1
| | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_kill): Reverse the order. -- The order matters in a corner case; On a busy machine, there was a race condition between gpg-agent's running KILLAGENT command and its accepting incoming request on the socket. If a request by gpg-connect-agent was accepted, it resulted an error by sudden shutdown. This change of the order can remove such a race. Here, we know backend=0 is none. GnuPG-bug-id: 4577 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgconf: Before --launch check that the config file is fine.Werner Koch2019-05-161-4/+14
| | | | | | | | * tools/gpgconf-comp.c (gc_component_launch): Check the conf file. * tools/gpgconf.c (gpgconf_failure): Call log_flush. -- GnuPG-bug-id: 4497 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Support --homedir for --launch.Werner Koch2019-05-151-16/+9
| | | | | | | | | | | | * tools/gpgconf-comp.c (gpg_agent_runtime_change): Simplify because gnupg_homedir already returns abd absolute name. (scdaemon_runtime_change): Ditto. (dirmngr_runtime_change): Ditto. (gc_component_launch): Support --homedir. -- GnuPG-bug-id: 4496 Signed-off-by: Werner Koch <[email protected]>