aboutsummaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* tests,tools: Reimplement 'mk-tdata' in Scheme.Justus Winter2016-11-072-76/+1
| | | | | | | | | | * tests/openpgp/defs.scm (tools): Drop 'mk-tdata'. * tests/openpgp/setup.scm (make-test-data): New function. * tests/openpgp/verify.scm: Avoid 'mk-tdata'. * tools/Makefile.am (noinst_PROGRAMS): Drop 'mk-tdata'. * tools/mk-tdata.c: Drop file. Signed-off-by: Justus Winter <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-0533-33/+33
| | | | --
* gpgconf: Add a new field to the --query-swdb output.Werner Koch2016-11-031-5/+16
| | | | | | | * tools/gpgconf.c (query_swdb): Insert new field with the installed version. Check that the supplied version does not contain a colon. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Add command --query-swdb.Werner Koch2016-11-021-0/+246
| | | | | | | | | | | | | | | | * tools/gpgconf.c (aQuerySWDB): New. (opts): Add --query-swdb. (valid_swdb_name_p): New. (query_swdb): New. (main): Implement command --query-swdb. -- Right now this command is not very useful because dimngr has not yet been changed to create the swdb.lst. For manual tests the swdb.lst file from the Net can be used with these additional lines: .filedate 20161102T130337 .verified 20161102T150000
* gpgconf: Fix for --homedir.NIIBE Yutaka2016-10-171-20/+60
| | | | | | | | | * tools/gpgconf-comp.c (gpg_agent_runtime_change, scdaemon_runtime_change, dirmngr_runtime_change): Provide the homedir arguments by --homedir when it's not default. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* tools: Fix error handling.Justus Winter2016-10-071-3/+1
| | | | | | | * tools/gpgtar-create.c (gpgtar_create): Do not crash if opening the tarball failed. Signed-off-by: Justus Winter <[email protected]>
* tools: Improve error handling.Justus Winter2016-10-061-1/+1
| | | | | | * tools/gpg-wks-server.c (copy_key_as_binary): Initialize 'argv'. Signed-off-by: Justus Winter <[email protected]>
* wks: Send key encrypted as required by draft -02Werner Koch2016-10-051-5/+41
| | | | | | | * tools/gpg-wks-client.c (get_key): Encrypt. (encrypt_response): Take care of --fake-submission-addr. Signed-off-by: Werner Koch <[email protected]>
* wks: Add option --fake-submission-addr to gpg-wks-client.Werner Koch2016-10-051-16/+33
| | | | | | | | | | | | | * tools/gpg-wks-client.c (oFakeSubmissionAddr): New. (opts): Add option --fake-submission-addr. (fake_submission_addr): New variable. (parse_arguments): Set it. (command_send): Use --fake-submission-addr. -- This option is useful for testing. Signed-off-by: Werner Koch <[email protected]>
* tools: Ignore existing directories in gpgtar.Justus Winter2016-10-041-2/+6
| | | | | | | * tools/gpgtar-extract.c (extract_directory): Ignore existing directories now that we have '--directory'. Signed-off-by: Justus Winter <[email protected]>
* agent: Create the extra sockets in the standard socket dir.Werner Koch2016-09-301-0/+2
| | | | | | | | | * agent/gpg-agent.c (main): Take the socketdir in account for the default sockets. * tools/gpgconf.c (list_dirs): Add "agent-extra-socket" and "agent-browser-socket". Signed-off-by: Werner Koch <[email protected]>
* wks: Avoid long trustdb checks.Werner Koch2016-09-301-0/+1
| | | | | | * tools/wks-receive.c (verify_signature): Use --always-trust. Signed-off-by: Werner Koch <[email protected]>
* build: Fix build against libiconv.Justus Winter2016-09-301-6/+9
| | | | | | | | * agent/Makefile.am: Add INCICONV and LIBICONV. * common/Makefile.am: Likewise. * tools/Makefile.am: Likewise. Signed-off-by: Justus Winter <[email protected]>
* wks: Partly implement draft-koch-openpgp-webkey-service-02.Werner Koch2016-09-294-57/+417
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpg-wks.h (WKS_RECEIVE_DRAFT2): New. * tools/wks-receive.c: Include rfc822parse.h. (struct receive_ctx_s): Add fields PARSER, DRAFT_VERSION_2, and MULTIPART_MIXED_SEEN. (decrypt_data): Add --no-options. (verify_signature): Ditto. (new_part): Check for Wks-Draft-Version header. Take care of text parts. (wks_receive): Set Parser and pass a flag value to RESULT_CB. * tools/gpg-wks-client.c (read_confirmation_request): New. (main) <aRead>: Call read_confirmation_request instead of process_confirmation_request. (command_receive_cb): Ditto. Add arg FLAGS.. (decrypt_stream_status_cb, decrypt_stream): New. (command_send): Set header Wks-Draft-Version. * tools/gpg-wks-server.c (struct server_ctx_s): Add field DRAFT_VERSION_2. (sign_stream_status_cb, sign_stream): New. (command_receive_cb): Set draft flag. (send_confirmation_request): Rework to implement protocol draft version 2. * tools/gpg-wks.h (DBG_MIME_VALUE, DBG_PARSER_VALUE): New. (DBG_MIME, DBG_PARSER, DBG_CRYPTO): New. Use instead of a plain opt.debug where useful. * tools/gpg-wks-client.c (debug_flags): Add "mime" and "parser". * tools/gpg-wks-server.c (debug_flags): Ditto. -- If a client supporting the version 2 of the protocol is used, it will tell this the server using a mail header. An old server will ignore that but a recent server will use the new protocol. Next task is to actually write draft-02. There are still a lot of FIXMEs - take care. Signed-off-by: Werner Koch <[email protected]>
* tools: Convey signeddata also to the part_data callback in mime-parser.Werner Koch2016-09-291-20/+38
| | | | | | | | * tools/mime-parser.c (mime_parser_parse): Factor some code out to ... (process_part_data): new. ((mime_parser_parse): Also call process_part_data for signed data. Signed-off-by: Werner Koch <[email protected]>
* tools: Allow retrieval of signed data from mime-maker.Werner Koch2016-09-292-0/+69
| | | | | | | * tools/mime-maker.c (find_part): New. (mime_maker_get_part): New. Signed-off-by: Werner Koch <[email protected]>
* tools: Change mime-maker to write out CR,LF.Werner Koch2016-09-292-34/+107
| | | | | | | | | | | | | | | | | | | | * tools/mime-maker.c (struct part_s): Add field PARTID. (struct mime_maker_context_s): Add field PARTID_COUNTER. (dump_parts): Print part ids. (mime_maker_add_header): Assign PARTID. (mime_maker_add_container): Ditto. (mime_maker_get_partid): New. (write_ct_with_boundary): Remove. (add_header): Strip trailing white spaces. (write_header): Remove trailing spaces trimming. Add arg BOUNDARY. Handle emdedded LFs. (write_gap, write_boundary, write_body): New. (write_tree): Use new functions. -- These changes prepare for forthcoming enhancements. Signed-off-by: Werner Koch <[email protected]>
* tools: Simplify the mime-maker container creation.Werner Koch2016-09-294-40/+34
| | | | | | | | | | | * tools/mime-maker.c (struct part_s): Remove field MEDIATYPE. (release_parts): Ditto. (dump_parts): Print a body line only if tehre is a body. (mime_maker_add_header): Check for body or container. (mime_maker_add_container): Remove arg MEDIATYPE. Change all callers. (mime_maker_end_container): New. Signed-off-by: Werner Koch <[email protected]>
* tools: Give mime parser callbacks access to the rfc822 parser.Werner Koch2016-09-292-0/+24
| | | | | | | | | * tools/mime-parser.c (mime_parser_context_s): Add field MSG. (parse_message_cb): Set it. (mime_parser_rfc822parser): New. * tools/mime-parser.h: Declare rfc822parse_t for the new prototype. Signed-off-by: Werner Koch <[email protected]>
* build: Do not link gpg-connect-agent against npth.Justus Winter2016-09-271-2/+1
| | | | | | * tools/Makefile.am: Do not link gpg-connect-agent against npth. Signed-off-by: Justus Winter <[email protected]>
* Fix more spellingDaniel Kahn Gillmor2016-09-174-6/+6
| | | | | | | | | | | | | | | | | | | * NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c, agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c, common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS, doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi, doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi, doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c, g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c, g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c, sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt, tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm, tests/openpgp/multisig.test, tests/openpgp/verify.scm, tests/pkits/README, tools/applygnupgdefaults, tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c: minor spelling cleanup. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* tools: Minor fix to the usbmon debugging tool.Werner Koch2016-09-131-10/+13
| | | | | | | | | | | | -- * tools/ccidmon.c (GNUPG_NAME): Define if not defined. (digitp, hexdigitp): Change to our common semantics. -- Note that this tool only exists in the repo. GnuPG-bug-id: 2678 Signed-off-by: Werner Koch <[email protected]>
* common: Add an assuan logging monitor.Werner Koch2016-09-051-1/+1
| | | | | | | | | * common/asshelp.c (my_log_monitor): New var. (my_libassuan_log_handler): Run that monitor. (setup_libassuan_logging): Add arg to set a log monitor and change all callers. Signed-off-by: Werner Koch <[email protected]>
* wks: Add framework for policy flags.Werner Koch2016-09-026-11/+310
| | | | | | | | | | | | | * tools/call-dirmngr.c (wkd_get_policy_flags): New. * tools/gpg-wks.h (struct policy_flags_s, policy_flags_t): New. * tools/wks-util.c (wks_parse_policy): New. * tools/gpg-wks-client.c (command_send): Get the policy flags to show a new info line. * tools/gpg-wks-server.c (get_policy_flags): New. (process_new_key): get policy flag and add a stub for "auth-submit". (command_list_domains): Check policy flags. Signed-off-by: Werner Koch <[email protected]>
* wks: Send a final message to the user.Werner Koch2016-08-311-2/+119
| | | | | | | * tools/gpg-wks-server.c (send_congratulation_message): New. (check_and_publish): Call it. Signed-off-by: Werner Koch <[email protected]>
* wks: Relax permission check for the top directory.Werner Koch2016-08-311-3/+3
| | | | | | * tools/gpg-wks-server.c: Allow S_IXOTH for the top directory. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Print the plain socket directory with --list-dirs.Werner Koch2016-08-291-0/+1
| | | | | | * tools/gpgconf.c (list_dirs): Add plain socketdir out. Signed-off-by: Werner Koch <[email protected]>
* wks: Add command --supported to gpg-wks-client.Werner Koch2016-08-241-0/+55
| | | | | | | | | | * tools/gpg-wks-client.c (aSupported): New. (opts): Add --supported. (parse_arguments): Ditto. (main): Call command_supported. (command_supported): New. Signed-off-by: Werner Koch <[email protected]>
* wks: Install gpg-wks-client under libexecWerner Koch2016-08-221-2/+5
| | | | | | | | * tools/Makefile.am (bin_PROGRAMS): Move gpg-wks-client to ... (libexec_PROGRAMS): ...here. -- Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Remove all system daemon features.Werner Koch2016-08-181-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (opts): Remove fields 'system_service' and 'system_daemon'. * common/homedir.c (dirmngr_sys_socket_name): Remove. (dirmngr_user_socket_name): Rename to ... (dirmngr_socket_name): this. Change call callers. * common/asshelp.c (start_new_dirmngr): Remove the system socket feature. * tools/gpgconf.c (list_dirs): Do not print "dirmngr-sys-socket". * sm/server.c (gpgsm_server): Adjust for removed system socket feature. * dirmngr/server.c (cmd_getinfo): Ditto. (cmd_killdirmngr): Remove check for system daemon. (cmd_reloaddirmngr): Ditto. * dirmngr/dirmngr.c (USE_W32_SERVICE): Remove macro. (aService): Remove. (opts): Remove --service. (w32_service_control): Remove. (real_main, call_real_main) [W32]: Remove wrapper. (main): Remove Windows system service feature. Remove system dameon feature. Use only the "~/.gnupg/dirmngr_ldapservers.conf" file. * dirmngr/certcache.c (load_certs_from_dir): Remove warning in the system dameon case. * dirmngr/crlcache.c (DBDIR_D): Always use "~/.gnupg/crls.d". * dirmngr/ocsp.c (validate_responder_cert): Do not call validate_cert_chain which was used only in system daemon mode. * dirmngr/validate.c (validate_cert_chain): Always use the code. -- We are now starting dirmngr as needed as a user daemon. The deprecated system daemon mode does not anymore make sense. In case a system wide daemon is required, it is better to setup a dedicated account to run dirmngr and tweak socket permissions accordingly. Signed-off-by: Werner Koch <[email protected]>
* Call log_set_prefix() with human-readable labels.Daniel Kahn Gillmor2016-08-125-5/+5
| | | | | | | | | | | | | | | | | | * agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c * dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c * g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c * tests/gpgscm/main.c, tools/gpg-check-pattern.c * tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c * tools/symcryptrun.c: Invoke log_set_prefix() with human-readable labels. -- Some invocations of log_set_prefix() were done with raw numeric values instead of values that humans can understand. Use symbolic representations instead of numeric for better readability. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* common: Rework the simple password query module.Justus Winter2016-08-111-1/+1
| | | | | | | | | | | | | * common/simple-pwquery.c (writen, readline): Drop. (agent_send_option, agent_send_all_options, agent_open): Just use libassuan. (simple_pw_set_socket): Simplify. (default_inq_cb): New function. (simple_pwquery, simple_query): Just use libassuan. * agent/Makefile.am (gpg_preset_passphrase_LDADD): Add libassuan. * tools/Makefile.am (symcryptrun_LDADD): Likewise. Signed-off-by: Justus Winter <[email protected]>