aboutsummaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make gpg-zip use tar from $PATHDaniel Kahn Gillmor2019-07-201-1/+1
| | | | | | | | | | Apparently there is no clean way to configure this from ./configure, and upstream is deprecating gpg-zip anyway. So just force-set tar to be manually "tar" (meaning, that we should look in the $PATH at runtime). See also https://dev.gnupg.org/T4251 and https://bugs.debian.org/913582 Gbp-Pq: Name Make-gpg-zip-use-tar-from-PATH.patch
* wkd: Change client/server limit back to 64 KiBWerner Koch2019-07-051-1/+1
| | | | | | | | | | * tools/wks-receive.c (decrypt_data): Change limit. -- The former limit ~1MiB of was used during development. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b0e8724b102535c27a8c973ec038d340858a8eb8)
* tools: gpgconf: Killing order is children-first.NIIBE Yutaka2019-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_kill): Reverse the order. -- Cherry-picked from master commit: 7c877f942a344e7778005840ed7f3e20ace12f4a 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-162-4/+15
| | | | | | | | * 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]>
* wkd: New command --print-wkd-url for gpg-wks-client.Werner Koch2019-03-253-3/+44
| | | | | | | | | * tools/gpg-wks-client.c (aPrintWKDURL): New. (opts): Add option. (main): Implement. * tools/wks-util.c (wks_cmd_print_wkd_url): New. Signed-off-by: Werner Koch <[email protected]>
* wkd: New command --print-wkd-hash for gpg-wks-client.Werner Koch2019-03-254-12/+125
| | | | | | | | | | | | | * tools/gpg-wks-client.c (aPrintWKDHash): New. (opts) : Add "--print-wkd-hash". (main): Implement that command. (proc_userid_from_stdin): New. * tools/wks-util.c (wks_fname_from_userid): Add option HASH_ONLY. (wks_cmd_print_wkd_hash): New. -- GnuPG-bug-id: 4418 Signed-off-by: Werner Koch <[email protected]>
* gpgtar: Make option -C work for archive creation.Werner Koch2019-03-072-1/+9
| | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Switch to the -C directory. -- The -C option is pretty useful given that pattern are always relative to the current directory. In contrast to GNU tar, the switching is done only once. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b3a7a5140784b5a015107b5c5c73b15ae44e71dc)
* gpgtar: Improve error messages.Werner Koch2019-03-074-43/+89
| | | | | | | | | | | | | | | | | | | | | * tools/gpgtar.h (struct tarinfo_s): New. * tools/gpgtar.c (cmd, skip_crypto, files_from, null_names): Move global vars more to the top. (set_cmd): Rename 'cmd' to 'c'. * tools/gpgtar-list.c (parse_header): Add arg 'info' and improve error messages. (read_header): Add arg 'info' and update counter. (skip_data): Ditto. (gpgtar_list): Pass info object to read functions. (gpgtar_read_header): Add arg 'info'. * tools/gpgtar-extract.c (gpgtar_extract): add arg 'info' and pass on. (extract_regular): Add arg 'info' and update counter. -- This now prints the block number of a header with error. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 72feb8fa8280aba674573a1afc955a92e8065242)
* conf: New option --show-socket.Werner Koch2019-02-263-29/+48
| | | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_t): Move this enum to ... * tools/gpgconf.h: here. * tools/gpgconf.c (oShowSocket): New. (opts): Add new option. (main): Implement new option. -- This is a convenience options for software which directly connects to gpg-agent and thus needs to new the socket. By using --show-socket along with --launch that software can also autostart the agent or the dirmngr. Without this two calls to gpgconf would be required. Actually the same behaviour can be achieved by running gpg-connect-agent to query the running gpg-agent's socket via GETINFO. The gpg-connect also makes sure that the agent is started. This is not anymore suggested because gpgconf shall in future be used for all such things. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ac485b4f253ad6bbd2bc648650b56d60fc82f89d)
* wks: Do not use compression for the encrypted data.Werner Koch2018-12-182-0/+2
| | | | | | | | | | | | | | | | | | | * tools/gpg-wks-client.c (encrypt_response): Add arg -z0. * tools/gpg-wks-server.c (encrypt_stream): Ditto. -- If for example a server was built without the development packages of the compression libraries installed, the server will not be able to decrypt a request. In theory this can't happen due to the preference system but it is just to easy to create the server's key using a different version of gpg and then use gpg-wks-server built differently. For the short messages we exchange compression is not really required and thus we better do without to make the system more robust. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 70a8db0333e3c22403b3647f8b5f924f6dace719)
* tools: Use POSIX compatible arguments for findTomi Leppänen2018-12-111-1/+1
| | | | * tools/addgnupghome (filelist): Remove bashism.
* wks: Fix filter expression syntax flaw.Werner Koch2018-12-051-4/+10
| | | | | | | | | | | | | | * tools/wks-util.c (wks_get_key, wks_filter_uid): The filter expression needs a space before the value. (install_key_from_spec_file): Replace es_getline by es_read_line and remove debug output. -- A value of starting with '<' was considered an invalid operator due to our tokenization method. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 0c36ec241d285545f286069843de4f663cd274a3)
* wks: Allow reading of --install-key arguments from stdin.Werner Koch2018-12-053-7/+73
| | | | | | | | | | * tools/wks-util.c (install_key_from_spec_file): New. (wks_cmd_install_key): Call it. * tools/gpg-wks-client.c (main): Allow --install-key w/o arguments. * tools/gpg-wks-server.c (main): Ditto. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ba46a359b9d6549b74ec8401ea39bad434d87564)
* wks: Create sub-directoriesWerner Koch2018-12-051-5/+25
| | | | | | | | * tools/wks-util.c (wks_compute_hu_fname): Stat and create directory if needed. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 73e5b0ec9b9ba5e04e55f8c42d81e23df7c3afe0)
* wks: Add new commands --install-key and --remove-key to the client.Werner Koch2018-12-051-0/+53
| | | | | | | | | | | | | | | * tools/gpg-wks-client.c (aInstallKey, aRemoveKey, oDirectory): New. (opts): Add "--install-key", "--remove-key" and "-C". (parse_arguments): Parse them. (main): Check that the given directory exists. Implement the new commands. -- These commands maybe useful to prepare a WKD directory on a non-Unix box using the standard wks client. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 602b1909632925d5a2e0778c102d66109795c627)
* wks: Move a few server functions to wks-util.Werner Koch2018-12-053-309/+317
| | | | | | | | | | | | | | | | * tools/gpg-wks-server.c (write_to_file): Move to ... * tools/wks-util.c: here. * tools/gpg-wks-server.c (compute_hu_fname): Move to ... * tools/wks-util.c (wks_compute_hu_fname): here. * tools/gpg-wks-server.c (fname_from_userid): Move to ... * tools/wks-util.c (wks_fname_from_userid): here. * tools/gpg-wks-server.c (command_install_key): Move to ... * tools/wks-util.c (wks_cmd_install_key): here and change caller. * tools/gpg-wks-server.c (command_remove_key): Move to ... * tools/wks-util.c (wks_cmd_remove_key): here and change callers. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 99094c992c20dd22971beb3527cfda109cd1df89)
* tools: Let gpg-zip print a deprecation warning.Werner Koch2018-11-151-0/+3
| | | | | | | -- GnuPG-bug-id: 4251 Signed-off-by: Werner Koch <[email protected]>
* wks: New option --with-colons for gpg-wks-client.Werner Koch2018-11-053-67/+190
| | | | | | | | | | | | | | | | | | | | * tools/gpg-wks.h (opt): Add field with_colons. * tools/gpg-wks-client.c (oWithColons): New const. (opts, parse_arguments): Add option --with-colons. (main): Change aSupported to take several domains in --with-colons mode. (command_send): Factor policy getting code out to ... (get_policy_and_sa): New function. (command_supported): Make use of new function. -- In addition to this the --create command now also supports a submission address only in the policy file. That means the submission-address file is not anymore required and can be replaced by the policy file. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit e3a1e80d13487c9336640a99b2f6d385d7d6f55c)
* tools: Replace duplicated code in mime-maker.Werner Koch2018-11-053-62/+90
| | | | | | | | | | | | | | | | | | | | | | | | * tools/rfc822parse.c (HEADER_NAME_CHARS): New. Taken from mime-maker.c. (rfc822_valid_header_name_p): New. Based on code from mime-maker.c. (rfc822_capitalize_header_name): New. Copied from mime-maker.c. (capitalize_header_name): Remove. Replace calls by new func. (my_toupper, my_strcasecmp): New. * tools/mime-maker.c: Include rfc822parse.h. (HEADER_NAME_CHARS, capitalize_header_name): Remove. (add_header): Replace check and capitalization by new functions. -- This is a straightforward change with two minor chnages: - In rfc822parse.c the capitalization handles MIME-Version special. - The check in mime-maker bow detects a zero-length name as invalid. my_toupper and my_strcasecmp are introduced to allow standalone use of that file. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f03928b16c4fb00077d22d8ec141575ef6d26913)
* wkd: Add option --directory to the server.Werner Koch2018-10-261-11/+18
| | | | | | | | | | | | | | * tools/gpg-wks-server.c (opts): Add '--directory', (main): Explain how to set correct permissions. (command_list_domains): Create an empty policy file and remove the warning for an empty policy file. -- Note that a policy file is meanwhile required and thus is is useful to create it. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f248416bc9792e80bb0785302058131de49d7639)
* tools: Fix FILE memory leak in gpg-connect-agent.Werner Koch2018-10-241-2/+4
| | | | | | | | | * tools/gpg-connect-agent.c (do_open): dup the fileno and close the stream. GnuPG-bug-id: 4220 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 378719f25fe00d46393541f4a4f79e04484c3000)
* gpgconf, w32: Allow UNC pathsAndre Heinecke2018-02-281-1/+3
| | | | | | | | | | | | | * tools/gpgconf-comp.c (get_config_filename): Allow UNC paths. -- The homedir of GnuPG on Windows can be on a network share e.g. if %APPDATA% is redirected to a network share. The file API calls work and GnuPG itself works nicely with such paths so gpgconf should work with them, too. GnuPG-Bug-Id: T3818 Signed-off-by: Andre Heinecke <[email protected]>
* wks: Add special mode to --install-key.Werner Koch2018-02-204-124/+146
| | | | | | | | | | | * tools/gpg-wks-client.c (get_key_status_parm_s) (get_key_status_cb, get_key): Move to ... * tools/wks-util.c: ...here. (get_key): Rename to wks_get_key. * tools/gpg-wks-server.c: Include userids.h. (command_install_key): Allow use of a fingerprint. Signed-off-by: Werner Koch <[email protected]>
* wks: Implement server command --install-key.Werner Koch2018-02-204-36/+208
| | | | | | | | | | | * tools/wks-util.c (wks_filter_uid): Add arg 'binary'. * tools/gpg-wks-server.c (main): Expect 2 args for --install-key. (write_to_file): New. (check_and_publish): Factor some code out to ... (compute_hu_fname): ... new. (command_install_key): Implement. Signed-off-by: Werner Koch <[email protected]>
* wks: Support alternative submission address.Werner Koch2018-02-204-14/+67
| | | | | | | | | | | | * tools/gpg-wks.h (policy_flags_s): Add field 'submission_address'. * tools/wks-util.c (wks_parse_policy): Parse that field. (wks_free_policy): New. * tools/gpg-wks-client.c (command_send): Also try to take the submission-address from the policy file. Free POLICY. * tools/gpg-wks-server.c (process_new_key): Free POLICYBUF. (command_list_domains): Free POLICY. Signed-off-by: Werner Koch <[email protected]>
* wks: New server options --check, --with-dir, with-file.Werner Koch2017-12-191-13/+182
| | | | | | | | | | | | | | * tools/gpg-wks-server.c (aCheck, oWithDir, oWithFile): New const. (opts): New options --check, --with-dir, and --with-file. (main): Call command_check_key. (command_list_domains): Implement option --with-dir. (fname_from_userid): New. (command_check_key): New. (command_remove_key): Implement existsing command. (command_revoke_key): Call command_remove_key as a simple implementation. Signed-off-by: Werner Koch <[email protected]>
* conf: New option --status-fd.Werner Koch2017-12-184-18/+129
| | | | | | | | | | | | | | * tools/gpgconf.c (oStatusFD): New const. (opts): New option --status-fd. (statusfp): New var. (set_status_fd): New. (gpgconf_write_status): New. (gpgconf_failure): New. (main): Set status fd and replace exit by gpgconf_failure. * tools/gpgconf-comp.c: Repalce exit by gpgconf_failure. (gc_process_gpgconf_conf): Print a few warning status messages. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Show --compliance in expert mode.Werner Koch2017-12-181-2/+2
| | | | | | | * tools/gpgconf-comp.c (gc_options_gpg): Set compliance to expert. (gc_options_gpgsm): Ditto. Signed-off-by: Werner Koch <[email protected]>
* sm: Allow explicit setting of the default --compliance=gnupgWerner Koch2017-12-181-0/+3
| | | | | | | | | | * sm/gpgsm.c (main): Allow setting of the default compliance. * tools/gpgconf-comp.c (gc_options_gpgsm): Add "compliance". -- This is required so that we can use this option in in gpgconf.conf. Signed-off-by: Werner Koch <[email protected]>
* gpgtar: Prefer --set-filename over implicit nameAndre Heinecke2017-11-151-6/+6
| | | | | | | | | | | | | * tools/gpgtar-extract.c: Prefer opt.filename over filename for the directory prefix. -- If you would extract from stdin (filename -) and use set-filename to provide a real filename the "-" would be used for the directory name. With this change an explicit filename is prefered. GnuPG-Bug-Id: T3500 Signed-off-by: Andre Heinecke <[email protected]>
* gpgconf: Ignore non-installed components with --apply-profile.Werner Koch2017-10-241-4/+13
| | | | | | | | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_program): Add arg only_installed. (gc_component_retrieve_options): Use this if we want to process all components. -- Note that this also also ignores them in --with-defaults. This is useful for systems which come without scdaemon. GnuPG-bug-id: 3313 Signed-off-by: Werner Koch <[email protected]>
* wks: Create a new user id if provider wants mailbox-only.Werner Koch2017-09-181-8/+69
| | | | | | | | * tools/gpg-wks-client.c (get_key): Add arg 'exact'. (add_user_id): New. (command_send): Create new user id. Signed-off-by: Werner Koch <[email protected]>
* wks: Send only the newest UID to the server.Werner Koch2017-09-184-22/+158
| | | | | | | | | | | | | | | | | | | * tools/wks-util.c (list_key_status_cb): Rename to key_status_cb. (wks_filter_uid): New. (wks_list_key): Allow FPR to be NULL. Return an error if no fingerprint was found. * tools/gpg-wks-server.c (process_new_key) (check_and_publish): Remove now useless extra check for FPR. * tools/gpg-wks-client.c (command_check): Ditto. (command_send): Filter out the newest uid. -- This fixes the case of having several userids with all the the same mailbox. Now we use the latest user id created. This patch is also a prerequisite to automatically create a new user id for providers with the mailbox-only policy. Signed-off-by: Werner Koch <[email protected]>
* wks: Print the UID creation time with gpg-wks-client --check.Werner Koch2017-09-183-2/+6
| | | | | | | | | * tools/gpg-wks.h (uidinfo_list_s): Add field 'created'. * tools/wks-util.c (append_to_uidinfo_list): Add arf 'created'. (wks_list_key): Pass timestamp to append_to_uidinfo_list. * tools/gpg-wks-client.c (command_check): Print UID creation time. Signed-off-by: Werner Koch <[email protected]>
* wks: Use dedicated type to convey user ids.Werner Koch2017-09-184-32/+91
| | | | | | | | | | | | | | | | | * tools/gpg-wks.h (uidinfo_list_s, uidinfo_list_t): New. * tools/wks-util.c (append_to_uidinfo_list): New. (free_uidinfo_list): New. (wks_list_key): Change arg r_mboxes to uidinfo_list_t. Use append_to_uidinfo_list. * tools/gpg-wks-server.c (sserver_ctx_s): Replace strlist_t by uidinfo_list_t. (process_new_key): Ditto. (check_and_publish): Ditto. (command_receive_cb): Replace free_strlist by free_uidinfo_list. * tools/gpg-wks-client.c (command_check): Replace strlist_t by uidinfo_list_t. Also print user id in verbose mode. Signed-off-by: Werner Koch <[email protected]>
* wks: Add hack for the broken posteo systemWerner Koch2017-09-121-2/+18
| | | | | | | * tools/gpg-wks-client.c (command_send): Additional hack for posteo. Check the protocol-version flag. Signed-off-by: Werner Koch <[email protected]>
* wks: Add new policy flag protocol-versionWerner Koch2017-09-122-2/+13
| | | | | | | * tools/gpg-wks.h (policy_flags_s): Add field protocol_version. * tools/wks-util.c (wks_parse_policy): Add new policy flag. Signed-off-by: Werner Koch <[email protected]>
* wks: Use unencrypted draft-1 mode for posteo.deWerner Koch2017-09-121-39/+81
| | | | | | | | | | | | | * tools/gpg-wks-client.c (command_send): Allow sending in draft-1 mode. -- Obviously Posteo did not implement the current draft and thus it was not possible to send a request to them. This hack uses the old method for posteo.de. Not sending it encrypted is okay here because they use authenticated sending anyway. Signed-off-by: Werner Koch <[email protected]>
* tools: New function mime_maker_add_body_data.Werner Koch2017-09-122-1/+14
| | | | | | * tools/mime-maker.c (mime_maker_add_body_data): New. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Swap "auto-key-retrieve" and "no-auto-key-retrieve".Werner Koch2017-08-231-2/+2
| | | | | | | | | | | | | | * g10/gpg.c (gpgconf_list): Announce "auto-key-retrieve". (main): Simplify setting of KEYSERVER_AUTO_KEY_RETRIEVE. * tools/gpgconf-comp.c: Make "no-auto-key-retrieve" invisible. Make "auto-key-retrieve" an expert option. -- This basically reverts 9bb13a0e819334681caca38c9074bd7bfc04e45e because --no-auto-key-retrieve is again the default. Note that we allow both options for the sake of profiles. Signed-off-by: Werner Koch <[email protected]>
* build: Change SWDB tag "gnupg21" to "gnupg22".Werner Koch2017-08-231-1/+1
| | | | | | | | | * configure.ac (GNUPG_SWDB_TAG): New ac_define. Set it to "gnupg22". * tools/gpgconf.c (query_swdb): Use it. * build-aux/speedo.mk: Change tag "gnupg21" to "gnupg22". * Makefile.am (distcheck-hook): Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Make WoT settings configurable by gpgconf.Damien Goutte-Gattat2017-08-211-0/+12
| | | | | | | | | | | | * tools/gpgconf-comp.c (gc_options_gpg): Add max-cert-depth, completes-needed, and marginals-needed options. * g10/gpg.c (gpgconf_list): Likewise. -- Some tests to come for the PGP trust model will need to manipulate these parameters. Signed-off-by: Damien Goutte-Gattat <[email protected]>
* gpg: Add option '--disable-dirmngr'.Justus Winter2017-08-081-0/+3
| | | | | | | | | | | | | | * doc/gpg.texi: Document new option. * g10/call-dirmngr.c (create_context): Fail if option is given. * g10/gpg.c (cmd_and_opt_values): New value. (opts): New option. (gpgconf_list): Add new option. (main): Handle new option. * g10/options.h (struct opt): New field 'disable_dirmngr'. * tools/gpgconf-comp.c (gc_options_gpg): New option. GnuPG-bug-id: 3334 Signed-off-by: Justus Winter <[email protected]>
* gpg: gpgconf needs to support the now default --auto-key-retrieve.Werner Koch2017-08-051-0/+2
| | | | | | | | | | * tools/gpgconf-comp.c (gc_options_gpg): Re-add "auto-key_retrieve". -- Although this option is invisible, it might be in use by gpgconf profiles. We don't want to break them. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make --no-auto-key-retrieve gpgconf-igurable.Werner Koch2017-08-041-1/+1
| | | | | | | | | * g10/gpg.c (gpgconf_list): Print no-auto-key-retrieve instead of auto-key-retrieve. * tools/gpgconf-comp.c (gc_options_gpg): Replace auto-key-retrieve by no-auto-key-retrieve and chnage level from invisible to advanced. Signed-off-by: Werner Koch <[email protected]>
* agent: Make --no-grab the default.Werner Koch2017-08-041-3/+3
| | | | | | | | | | | * agent/gpg-agent.c (oGrab): New const. (opts): New option --grab. Remove description for --no-grab. (parse_rereadable_options): Make --no-grab the default. (finalize_rereadable_options): Allow --grab to override --no-grab. (main) <gpgconflist>: Add "grab". * tools/gpgconf-comp.c (gc_options_gpg_agent): Add "grab". Signed-off-by: Werner Koch <[email protected]>
* wks: Allow gpg-wks-client --supported with just the domain nameWerner Koch2017-08-031-1/+8
| | | | | | | * tools/gpg-wks-client.c (command_supported): Hack for missing local part. Signed-off-by: Werner Koch <[email protected]>
* Simple typo fix.NIIBE Yutaka2017-08-011-1/+1
| | | | | | * tools/rfc822parse.c: Fix. Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Make --ssh-fingerprint-digest re-readable.Werner Koch2017-07-281-0/+4
| | | | | | | | | | | * agent/gpg-agent.c (main): Move oSSHFingerprintDigest to ... (parse_rereadable_options): here. (opts): Change its description. (main) <aGPGConfList>: Include this option. * tools/gpgconf-comp.c (gc_options_gpg_agent): Add option at expert level. Signed-off-by: Werner Koch <[email protected]>