aboutsummaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-287-7/+7
| | | | | | | | | | -- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
* tools: Fix condition for gpg-connect-agent.NIIBE Yutaka2017-04-121-1/+1
| | | | | | | | | | | * tools/gpg-connect-agent.c (start_agent): Add paren. -- The intention is comparing the error code depending opt.use_dirmngr. Considering C Operator Precedence, we should have paren here. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10,tools: Fix bzlib.h include order.NIIBE Yutaka2017-04-111-3/+4
| | | | | | | | | | | | * g10/compress-bz2.c: Include bzlib.h after gcrypt.h. * tools/gpgsplit.c: Likewise. -- bzlib.h may include windows.h on Windows. It is better after gcrypt.h which may include winsock2.h. Signed-off-by: NIIBE Yutaka <[email protected]>
* tools: Portability fix for gpgparsemail.NIIBE Yutaka2017-04-111-1/+2
| | | | | | | | | | | | | | * tools/rfc822parse.c (my_stpcpy): Rename from stpcpy. -- When HAVE_STPCPY is not defined (no definition in libc), still, compiler may have definition as a built-in function (for some specific case like second argument is constant). In that case, having stpcpy implementation with the same name but different signature ("static" qualifier) is not good. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgconf: Add --enable-extended-key-format for the agent.Werner Koch2017-04-031-0/+3
| | | | | | | * tools/gpgconf-conf.c: Add option. * agent/gpg-agent.c (main) <aGPGConfList>: Add option. Signed-off-by: Werner Koch <[email protected]>
* tests: Use gpgconf to stop the agent.Werner Koch2017-03-231-1/+37
| | | | | | | | | | | | | * tests/openpgp/defs.scm (stop-agent): Swap order of actions. Kill all daemons using gpgconf. * tools/gpgconf.c (main) <aRemoveSocketDir>: Try to remove known socketfails on rmdir failure. Do no fail for ENONET. -- Killing all daemons is not really required but it does not harm to be prepared for the future. Signed-off-by: Werner Koch <[email protected]>
* wks: Put stdout into binary mode for Windows at another place.Werner Koch2017-03-081-1/+5
| | | | | | * tools/wks-util.c (wks_send_mime): Set stdout to binary. Signed-off-by: Werner Koch <[email protected]>
* wks: Put stdout into binary mode for Windows.Werner Koch2017-03-081-5/+15
| | | | | | | | | | | | * tools/send-mail.c (send_mail_to_file): Call es_set_binary. -- Without that, output to stdout via --send is mangled: The "\r\n" is translated to "\r\r\n" which is bad because other software (e.g. Thunderbird) translates this again to "\n\n" and thus put all mail header liens after the first into the body. Signed-off-by: Werner Koch <[email protected]>
* tools: Removal of -Icommon.NIIBE Yutaka2017-03-071-8/+8
| | | | | | * tools/gpg-wks-server.c: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
* More change for common.NIIBE Yutaka2017-03-072-2/+2
| | | | | | * g10, scd, test, tools: Follow the change of removal of -Icommon. Signed-off-by: NIIBE Yutaka <[email protected]>
* Remove -I option to common.NIIBE Yutaka2017-03-0717-49/+49
| | | | | | | | | | | | | * dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
* tools: More portable for openpty use.NIIBE Yutaka2017-03-071-0/+12
| | | | | | | | | | | * configure.ac (AC_CHECK_HEADERS): Add util.h libutil.h and termios.h. * tools/symcryptrun.c: Include those headers. -- This is for OpenBSD and FreeBSD. Signed-off-by: NIIBE Yutaka <[email protected]>
* wks: Set published keys world-readable.Werner Koch2017-03-061-0/+5
| | | | | | * tools/gpg-wks-server.c (check_and_publish): Set the permissions. Signed-off-by: Werner Koch <[email protected]>
* tools: Fix compile error with older gcc versions.Werner Koch2017-03-021-4/+2
| | | | | | | | | * tools/mime-parser.h: Include rfc822parse.h. (struct rfc822parse_context): Remove duplicate definition. -- GnuPG-bug-id: 2851 Signed-off-by: Werner Koch <[email protected]>
* common,tools: Always escape newlines when escaping data.Justus Winter2017-03-021-0/+7
| | | | | | | | | | * common/stringhelp.c (do_percent_escape): Always escape newlines. * tools/gpgconf-comp.c (gc_percent_escape): Likewise. -- Newlines always pose a problem for a line-based communication format. GnuPG-bug-id: 2387 Signed-off-by: Justus Winter <[email protected]>
* gpg,tools: Make auto-key-retrieve configurable via gpgconf.Justus Winter2017-02-281-0/+2
| | | | | | | | * g10/gpg.c (gpgconf_list): Add 'auto-key-retrieve'. * tools/gpgconf-comp.c (gc_options_gpg): Likewise. GnuPG-bug-id: 2381 Signed-off-by: Justus Winter <[email protected]>
* gpg,tools: Make trust-model configurable via gpgconf.Justus Winter2017-02-281-0/+4
| | | | | | | | * g10/gpg.c (gpgconf_list): Add 'trust-model'. * tools/gpgconf-comp.c (gc_options_gpg): Likewise. GnuPG-bug-id: 2381 Signed-off-by: Justus Winter <[email protected]>
* wks: Make sure that the draft 2 request is correctly detected.Werner Koch2017-02-234-35/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpg-wks.h (WKS_DRAFT_VERSION): New. * tools/wks-receive.c (new_part): Move test wks draft version to ... (t2body): new callback. (wks_receive): Register this callback. * tools/gpg-wks-server.c (send_confirmation_request): Emit draft version header. (send_congratulation_message): Ditto. * tools/gpg-wks-client.c (decrypt_stream_parm_s): New. (decrypt_stream_status_cb): Check DECRYTPION_KEY status. (decrypt_stream): Get infor from new callback. (process_confirmation_request): New arg 'mainfpr'. Check that it matches the decryption key. (read_confirmation_request): Check that the decryption key has been generated by us. (command_send): Use macro from draft version header. (send_confirmation_response): Emit draft version header. -- This patch also adds a check to only send a confirmation when the decryption has been done by an ultimately trusted (self-generated) key. Signed-off-by: Werner Koch <[email protected]>
* wks: New callback for the mime parser.Werner Koch2017-02-232-0/+27
| | | | | | | | | | | * tools/mime-parser.c (mime_parser_context_s): New field 't2body'. (parse_message_cb): Call that callback. (mime_parser_set_t2body): New. -- This callback allows to process header values even on the outer level. Signed-off-by: Werner Koch <[email protected]>
* Fix spelling.Daniel Kahn Gillmor2017-02-211-1/+1
| | | | | | | | | -- Clean up several other misspellings noticed while reviewing Yuri's de-duplication patch. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Clean up word replication.Yuri Chornoivan2017-02-217-11/+11
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpgconf: No ENOENT warning with --change-options et al.Werner Koch2017-02-131-2/+5
| | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_program): Check ERRNO before printing a warning. -- It is common that a conf files does not exist - thus we should not print a warning. GnuPG-bug-id: 2944 BTW: The error messages in gpgconf should be reworked to match those of the other components. Signed-off-by: Werner Koch <[email protected]>
* wks: Add WKS-Phase headers to the server messages.Werner Koch2017-02-071-0/+10
| | | | | | | | * tools/gpg-wks-server.c (send_confirmation_request): Add custom header. (send_congratulation_message): Ditto. Signed-off-by: Werner Koch <[email protected]>
* tools: Use platform abstraction for I/O.Justus Winter2017-01-241-10/+10
| | | | | | | | | | | | * tools/gpg-connect-agent.c (main): Use a gpgrt_stream_t for 'script_fp'. Adapt accordingly. -- Werner asked me to make gpgconf use the platform abstractions that were introduced after gpgconf's inception. After doing that, I realized that 'read_line' is only used in two more places, one of which this patch takes care of. Signed-off-by: Justus Winter <[email protected]>
* tools: Use platform abstraction for I/O.Justus Winter2017-01-241-96/+95
| | | | | | | | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_file): Use a gpgrt_stream_t for 'list_file'. Adapt accordingly. (copy_file): Likewise for 'src' and 'dst'. (change_options_file): Likewise for 'src_file' and 'dest_file'. (change_options_program): Likewise for 'src_file' and 'dest_file'. (gc_process_gpgconf_conf): Likewise for 'config'. -- Werner asked me to make gpgconf use the platform abstractions that were introduced after gpgconf's inception. Signed-off-by: Justus Winter <[email protected]>
* tools: Use platform abstraction for renaming files.Justus Winter2017-01-241-22/+16
| | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_change_options): Use 'gnupg_rename_file'. Also, block signals across all renames in an attempt to make the whole process atomic. -- Werner asked me to make gpgconf use the platform abstractions that were introduced after gpgconf's inception. Signed-off-by: Justus Winter <[email protected]>
* tools: Add comments explaining the functions parameters.Justus Winter2017-01-241-2/+27
| | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (change_options_file): Add comments explaining the functions parameters. (change_options_program): Likewise. -- From reading those two functions it is not clear why we write the new configuration to the source file, and read the current configuration from the destination file. The identifiers are named for the benefit of the callee. Note that identifiers that require that much explanation are poorly chosen. Signed-off-by: Justus Winter <[email protected]>
* tools: Improve error handling.Justus Winter2017-01-241-0/+2
| | | | | | | | | | * tools/gpgconf-comp.c (gp_component_change_options): Improve error handling when reading from stdin. -- Previously, errors encountered while reading the configuration changes were ignored. Signed-off-by: Justus Winter <[email protected]>
* tools: Fix memory leak.Justus Winter2017-01-241-0/+2
| | | | | | | | | * tools/gpgconf-comp.c (change_options_file): Fix leak. -- Previously, 'src_filename' and 'orig_filename' leaked if creating the backup file failed. Signed-off-by: Justus Winter <[email protected]>
* Update copyright notices for 2017.Werner Koch2017-01-231-2/+2
| | | | | | | | -- Also some http:// -> https:// fixes. Signed-off-by: Werner Koch <[email protected]>
* Fix format string errors and some missing error case initialization.Werner Koch2017-01-232-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/logging.c (do_logv): Remove extra parentheses in comparison. * dirmngr/dns-stuff.c (resolve_addr_libdns): Init RES so that dns_res_close is given a defined value in the error case. * dirmngr/http.c (cookie_read, cookie_write) [HTTP_USE_NTBTLS]: Fix format string char. * dirmngr/ks-engine-hkp.c (ks_hkp_help): Remove duplicate "const". * dirmngr/ks-engine-http.c (ks_http_help): Ditto. * dirmngr/ks-engine-kdns.c (ks_kdns_help): Ditto. * dirmngr/ks-engine-ldap.c (ks_ldap_help): Ditto. * scd/app-p15.c (send_keypairinfo, do_getattr): Fix format string char. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Init PID for the error case. (scdaemon_runtime_change): Ditto. (dirmngr_runtime_change): Ditto. * tools/gpgconf.c (query_swdb): Init VALUE_SIZE_UL. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Allow "all" for --launch, --kill, and --reload.Werner Koch2017-01-182-3/+32
| | | | | | | | | | * tools/gpgconf-comp.c (gc_component_launch): Allow -1 for COMPONENT. (gc_component_kill): Ditto. (gc_component_reload): For robustness change the condition to < 0. * tools/gpgconf.c (main) <aLaunch, aKill, aReload>: Support argument "all". Signed-off-by: Werner Koch <[email protected]>
* tools: Fix memory leaks and improve error handling.Justus Winter2017-01-103-6/+52
| | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_option_free): New function. (gc_components_free): Likewise. (gc_components_init): Likewise. (retrieve_options_from_program): Use 'xfree', fix memory leak. (change_options_program): Improve error handling. (gc_component_change_options): Fix memory leaks. * tools/gpgconf.c (main): Initialize components. * tools/gpgconf.h (gc_components_init): New prototype. Signed-off-by: Justus Winter <[email protected]>
* Silence two -Wlogical-op warnings.Werner Koch2017-01-051-1/+5
| | | | | | | | * common/tlv.c (parse_ber_header): Avoid compiler warning about a duplicate condition. * tools/gpgtar-create.c (pattern_valid_p): Likewise. Signed-off-by: Werner Koch <[email protected]>
* tools: Show a clearer error message if a server doesn't support WKSNeal H. Walfield2016-12-221-2/+11
| | | | | | | | | * tools/gpg-wks-client.c (command_send): If we fail to lookup the submission address, print a better error message. If it is because the corresponding file doesn't exist, provide the hint that the server probably doesn't support WKS. Signed-off-by: Neal H. Walfield <[email protected]>
* wks: Let the client ignore missing policy flags.Werner Koch2016-12-221-1/+1
| | | | | | * tools/gpg-wks-client.c (command_send): Ignore missing policy flags. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New option --resolver-timeout.Werner Koch2016-12-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (DEFAULT_TIMEOUT): New. (opt_timeout): New var. (set_dns_timeout): New. (libdns_res_open): Set the default timeout. (libdns_res_wait): Use configurable timeout. (resolve_name_libdns): Ditto. * dirmngr/dirmngr.c (oResolverTimeout): New const. (opts): New option --resolver-timeout. (parse_rereadable_options): Set that option. (main) <aGPGConfList>: Add --nameserver and --resolver-timeout. * tools/gpgconf-comp.c (gc_options_dirmngr): Add --resolver-timeout and --nameserver. * dirmngr/http.c (connect_server): Fix yesterday introduced bug in error diagnostic. -- This timeout is a pretty crude thing because libdns has a few other internal timeouts as well. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: New command --apply-profile.Werner Koch2016-12-163-33/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf.c (aApplyProfile): New. (opts): New command --apply-profile. (main): Implement that command. * tools/gpgconf-comp.c (option_check_validity): Add arg VERBATIM. (change_options_program): Ditto. (change_one_value): Ditto. (gc_component_change_options): Ditto. (gc_apply_profile): New. -- Here is an example for a profile --8<---------------cut here---------------start------------->8--- # foo.prf - Sample profile [gpg] compliance de-vs default-new-key-algo brainpoolP256r1+brainpoolP256r1 [gpgsm] enable-crl-checks [gpg-agent] default-cache-ttl 900 max-cache-ttl [] 3600 no-allow-mark-trusted no-allow-external-cache enforce-passphrase-constraints min-passphrase-len 9 min-passphrase-nonalpha 0 [dirmngr] keyserver hkp://keys.gnupg.net allow-ocsp --8<---------------cut here---------------end--------------->8--- Note that flags inside of brackets are allowed after the option name. The only defined flag for now is "[default]". In case the value starts with a bracket, it is possible to insert "[]" as a nop-flag. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Fix --apply-defaults.Werner Koch2016-12-161-3/+3
| | | | | | * tools/gpgconf-comp.c: Skip pinentry also in process_all mode. Signed-off-by: Werner Koch <[email protected]>
* common: Support locating components in the build tree.Justus Winter2016-12-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * common/homedir.c (gnupg_build_directory): New variable. (gnupg_module_name_called): Likewise. (gnupg_set_builddir): New function. (gnupg_set_builddir_from_env): Likewise. (gnupg_module_name): Support locating components in the build tree. * common/util.h (gnupg_set_builddir): New prototype. * tests/openpgp/defs.scm (tools): Drop 'gpg and 'gpg-agent. (tool): Rename to 'tool-hardcoded. (gpg-conf): New function, with accessors for the results. (gpg-components): New variable. (tool): New function. * tools/gpgconf.c (enum cmd_and_opt_values): New key. (opts): New option '--build-prefix'. (main): Handle new option. -- This change makes sure that the components from the build tree are used, and not some older installed version in PATH. It also lets us make GPGME use components from the build tree, making it possible to execute GPGME's test suite with them. Signed-off-by: Justus Winter <[email protected]>
* wks: New option --status-fd for gpg-wks-client.Werner Koch2016-12-083-1/+76
| | | | | | | | | | | | | | | | | | * tools/wks-util.c: Include status.h. (statusfp): New global var. (wks_set_status_fd): New func. (wks_write_status): New func. * tools/gpg-wks-client.c: Include status.h. (oStatusFD): New constant. (opts): New option --status-fd. (parse_arguments): Handle that option. (main): Return STATUS_SUCCESS or STATUS_FAILURE. -- This option is useful in case gpg-wks-client is spawed using a double fork approach which does not allow to return the exit code. Signed-off-by: Werner Koch <[email protected]>
* wks: New option --check for gpg-wks-client.Werner Koch2016-12-083-0/+155
| | | | | | | | | | | | * tools/call-dirmngr.c (wkd_get_key): New. * tools/gpg-wks-client.c (aCheck): New constant. (opts): New option "--check". (main): Call command_check. (command_check): New. -- GnuPG-bug-id: 2866 Signed-off-by: Werner Koch <[email protected]>
* tools: Move a function from gpg-wks-server to wks-util.c.Werner Koch2016-12-083-164/+186
| | | | | | | | | | | | | | * tools/gpg-wks-server.c (list_key_status_cb): Remove. (list_key): Move to ... * tools/wks-util.c (wks_list_key): here and rename. Add new args R_FPR and R_MBOXES and remove the CTX. (list_key_status_cb): New. * tools/wks-util.c: Include ccparray.h, exectool.h, and mbox-util.h. * tools/gpg-wks-server.c (process_new_key): Replace list_key by wks_list_key. (check_and_publish): Ditto. Signed-off-by: Werner Koch <[email protected]>
* tools: Fix use of uninitialized var in mime-maker.Werner Koch2016-12-082-2/+8
| | | | | | | | | | * tools/mime-maker.c (ensure_part): Make sure to set R_PARENT on error. (add_missing_headers): Ensure that ERR is set on success. * tools/wks-util.c (wks_parse_policy): Fix indentation. Signed-off-by: Werner Koch <[email protected]>
* tools: Fix memleak in gpgconf.Werner Koch2016-12-081-0/+1
| | | | | | * tools/gpgconf.c (main): Free SOCKETDIR. Signed-off-by: Werner Koch <[email protected]>
* tools,build: Build WKS tools against libintl.Justus Winter2016-11-291-2/+2
| | | | | | | | * tools/Makefile.am (gpg_wks_server_LDADD): Link against libintl. (gpg_wks_client_LDADD): Likewise. GnuPG-bug-id: 2846 Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Auto-sownload the swdb.lstWerner Koch2016-11-171-1/+4
| | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (struct opt): Add field allow_version_check. * dirmngr/dirmngr.c (oAllowVersionCheck): New. (opts): Add --allow-version-check. (network_activity_seen): New variable. (parse_rereadable_options): Set opt.allow_version_check. (main) <aGPGConfList>: Do not anymore set the no change flag for Windows. Add allow-version-check. (netactivity_action): Set network_activity_seen. (housekeeping_thread): Call dirmngr_load_swdb. * tools/gpgconf-comp.c (gc_options_dirmngr): Add allow-version-check. Make "use-tor" available at Basic level. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Change the displayed names of the components.Werner Koch2016-11-171-6/+6
| | | | Signed-off-by: Werner Koch <[email protected]>
* wks: Always build gpg-wks-client.Werner Koch2016-11-161-4/+1
| | | | | | | * tools/Makefile.am (gpg_wks_client): Remove macro. (libexec_PROGRAMS): Add gpg-wks-client. Signed-off-by: Werner Koch <[email protected]>
* wks: Encrypt all client mails also the target key,Werner Koch2016-11-071-14/+32
| | | | | | | | | | | | | * tools/gpg-wks-client.c (encrypt_response): Add arg FINGERPRINT. (send_confirmation_response): Ditto. (process_confirmation_request): Parse out fingerprint and pass send_confirmation_response. -- This is useful for debugging the protocol and to avoid surprises when the sender tries to open a message from the Sent folder. Signed-off-by: Werner Koch <[email protected]>