aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Put extra parens around bit tests.Werner Koch2016-10-074-7/+10
| | | | | | | | * g10/options.h (DBG_MPI): New. * g10/gpg.c (set_debug): Use macro or extra parens for binary operator. * g10/parse-packet.c (set_packet_list_mode): Use dbg macro. Signed-off-by: Werner Koch <[email protected]>
* agent, dirmngr, scd: Fix init_common_subsystems.NIIBE Yutaka2016-10-074-11/+4
| | | | | | | | | | | * common/init.c (_init_common_subsystems): Don't call gpgrt_set_syscall_clamp in this function. * agent/gpg-agent.c, dirmngr/dirmngr.c, scd/scdaemon.c: Call gpgrt_set_syscall_clamp after npth_init. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* common: Avoid pointer arithmetic on string literals.Justus Winter2016-10-062-4/+4
| | | | | * common/gettime.c (rfctimestamp): Use indexing instead. * common/signal.c (got_fatal_signal): Likewise.
* g10: Fix singular term.Justus Winter2016-10-061-1/+1
| | | | | | * g10/tofu.c (ask_about_binding): Fix singular message. Signed-off-by: Justus Winter <[email protected]>
* g10: Use appropriate variant of 'abs'.Justus Winter2016-10-061-6/+6
| | | | | | * g10/tofu.c (ask_about_binding): Use 'labs' instead of 'abs'. Signed-off-by: Justus Winter <[email protected]>
* sm: Remove statement without effect.Justus Winter2016-10-061-1/+0
| | | | | | | * sm/call-dirmngr.c (gpgsm_dirmngr_isvalid): Remove statement without effect. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix testing for debug flag.Justus Winter2016-10-061-1/+1
| | | | | | | * g10/parse-packet.c (set_packet_list_mode): Fix testing for debug flag. 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]>
* gpgscm: Update callsite of 'gnupg_spawn_process'.Justus Winter2016-10-061-1/+1
| | | | | | | | | * tests/gpgscm/ffi.c (do_spawn_process): Adapt to the changes to 'gnupg_spawn_process'. Fixes-commit: 44a32455 Fixes-commit: 96c7901e 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]>
* agent: Another minor fix to map_supervised_sockets.Werner Koch2016-10-051-3/+1
| | | | | | | * agent/gpg-agent.c (map_supervised_sockets): Remove debug message. Provide correct fd in the second error case. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix npth + supervised mode problem.Werner Koch2016-10-051-0/+2
| | | | | | | | | | | * agent/gpg-agent.c (main): Initialize modules in supervised mode. -- It was probably my fault. I had to rebase my patches to take in the npth patches but for some reason my addition of initialize_modules got lost. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix error handling in map_supervised_socketsDaniel Kahn Gillmor2016-10-051-2/+2
| | | | | | | * agent/gpg-agent.c (map_supervised_sockets): the file descriptor to close on error is fd, not i. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* agent: Streamline the supervised mode code.Werner Koch2016-10-042-200/+216
| | | | | | | | | | | * agent/gpg-agent.c (get_socket_path): Rename to ... (get_socket_name): this. This is to comply with the GNU coding guide. Use xtrymalloc instead of malloc. Do not build for W32. (map_supervised_sockets): Use strtokenize and set the the socket names here. (main): Adjust for above change. Do not close the socket. Signed-off-by: Werner Koch <[email protected]>
* agent: Adjust cleanup for supervised mode. Fix for W32.Werner Koch2016-10-041-13/+20
| | | | | | | | | | | * agent/gpg-agent.c (opts) [W32]: Remove option --supervised. (is_supervised): Move from main() to global. (inhibit_socket_removal): New. (cleanup): Take care of supervise mode and INHIBIT_SOCKET_REMOVAL. (check_own_socket_thread): Set INHIBIT_SOCKET_REMOVAL instead of seting the socket names to empty. Signed-off-by: Werner Koch <[email protected]>
* agent: Adjust supervised mode for the new default socket names.Werner Koch2016-10-041-12/+20
| | | | | | | | * agent/gpg-agent.c (main): In supervised mode do not provide default socket names. Unset DISPLAY and INSIDE_EMACS. Use log_error and agent_exit. Signed-off-by: Werner Koch <[email protected]>
* agent: Implement --supervised command (for systemd, etc).Daniel Kahn Gillmor2016-10-042-2/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c (get_socket_path): New function for POSIX systems to return the path for a provided unix-domain socket. (map_supervised_sockets): New function to inspect $LISTEN_FDS and $LISTEN_FDNAMES and map them to the specific functionality offered by the agent. (main): Add --supervised command. When used, listen on already-open file descriptors instead of opening our own. * doc/gpg-agent.texi: Document --supervised option. -- "gpg-agent --supervised" is a way to invoke gpg-agent such that a system supervisor like systemd can provide socket-activated startup, log management, and scheduled shutdown. When running in this mode, gpg-agent: * Does not open its own listening socket; rather, it expects to be given a listening socket on incoming file descriptors. * Does not detach from the invoking process, staying in the foreground instead. Unless otherwise specified, logs are sent to stderr. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* build,w32: Unconditionally build tests.Justus Winter2016-10-043-26/+4
| | | | | | | | | | | | * configure.ac (run_tests, RUN_TESTS, RUN_GPG_TESTS): Remove variables. They are misleadingly named, as they inhibit building the tests. There is no reason not to build the tests even when cross-compiling, as they are only run if one does 'make check'. * Makefile: Adapt accordingly. * tests/Makefile.am: Adapt accordingly. Avoid building 'asschk' on Windows as it uses non-portable functions. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Do not expose 'glob' to gpgscm.Justus Winter2016-10-041-38/+0
| | | | | | | | | | * tests/gpgscm/ffi.c (do_glob): Remove function. (ffi_init): Likewise. -- 'glob' is not available on mingw, and portability is the whole point of gpgscm. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Avoid using 'glob'.Justus Winter2016-10-041-2/+1
| | | | | | | * tests/openpgp/setup.scm: Avoid 'glob' which is not available on mingw. Signed-off-by: Justus Winter <[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, dirmngr, scd: npth_init must be after fork.NIIBE Yutaka2016-10-043-21/+52
| | | | | | | | | | | | | | | | | | * agent/gpg-agent.c (thread_init_once, initialize_modules): New. (main): Make sure no daemonizing-fork call after npth_init, and no npth calls before npth_init, with care of npth calls by assuan hooks. * dirmngr/dirmngr.c (thread_init): New. (main): Make sure npth_init must not be called before daemonizing fork. * scd/scdaemon.c (main): Likewise. -- It is simply the best for nPth not to allow the daemonizing fork after npth_init, because semantics and implementations of forked child process in a threaded application is a difficult corner case. GnuPG-bug-id: 1779 Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Remove the warning for the GKR hijacking.Werner Koch2016-09-301-65/+0
| | | | | | | * g10/call-agent.c (check_hijacking): Remove. (start_agent): Remove call. Signed-off-by: Werner Koch <[email protected]>
* agent: Create the extra sockets in the standard socket dir.Werner Koch2016-09-302-6/+14
| | | | | | | | | * 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]>
* agent: Kludge to allow disabling of the extra sockets.Werner Koch2016-09-302-2/+19
| | | | | | * agent/gpg-agent.c (main): Check for special socket names. 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-303-9/+14
| | | | | | | | * agent/Makefile.am: Add INCICONV and LIBICONV. * common/Makefile.am: Likewise. * tools/Makefile.am: Likewise. Signed-off-by: Justus Winter <[email protected]>
* agent: Enable restricted, browser, and ssh socket by default.Justus Winter2016-09-303-10/+26
| | | | | | | | | | | | | | | | | * agent/gpg-agent.c (main): Provide defaults for 'extra-socket' and 'browser-socket', enable ssh socket by default, but do not emit the 'SSH_AUTH_SOCK' variable unless it has been explicitly requested. * configure.ac (GPG_AGENT_{EXTRA,BROWSER}_SOCK_NAME): New definitions. * doc/gpg-agent.texi: Update documentation. -- This change enables the restricted, browser, and ssh socket by default. Note that in all cases, the user has to do some additional configuration to her setup to make use of these features. Therefore, this should not break any existing setups, but makes it simpler to discover and use these features. Signed-off-by: Justus Winter <[email protected]>
* w32: Fix STARTTLS on LDAP connections.Justus Winter2016-09-301-1/+15
| | | | | | | | | | * dirmngr/ks-engine-ldap.c (my_ldap_connect): Fix build against <winldap.h>. GnuPG-bug-id: 1338 Debian-bug-id: 623526 Fixes-commit: 9e6f8a55 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]>
* dirmngr: Fix STARTTLS on LDAP connections.Justus Winter2016-09-291-1/+1
| | | | | | | | * dirmngr/ks-engine-ldap.c (my_ldap_connect): Fix unfortunate typo. -- Courtesy of pkgsrc contributor fhajny. Signed-off-by: Justus Winter <[email protected]>
* gpg: Improve WKD by importing only the requested UID.Werner Koch2016-09-281-5/+32
| | | | | | | | | | | | | * g10/keyserver.c: Include mbox-util.h. (keyserver_import_wkd): Do not use the global import options but employ an import filter. -- We also make sure that an mbox has been passed to keyserver_import_wkd so it may also be called with a complete user id (which is currently not the case). Signed-off-by: Werner Koch <[email protected]>
* gpg: Reject import if an import filter removed all user ids.Werner Koch2016-09-281-0/+27
| | | | | | | * g10/import.c (any_uid_left): New. (import_one): Check that a UID is left. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make import filter data object more flexible.Werner Koch2016-09-282-15/+63
| | | | | | | | | | | | | * g10/main.h (import_filter_t): New. * g10/import.c (struct import_filter_s): Declare struct. (import_keep_uid, import_drop_sig): Replace by ... (import_filter): new. Adjust all users. (cleanup_import_globals): Move code to ... (release_import_filter): new. (save_and_clear_import_filter): New. (restore_import_filter): New. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make sure that internal key import is done with a binary stream.Werner Koch2016-09-281-1/+1
| | | | | | * g10/import.c (import_keys_internal): Open stream in binary mode. 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]>
* build: Fix check for resolver library on macOS.Justus Winter2016-09-271-2/+9
| | | | | | * configure.ac: Check for the mangled name of 'dn_skipname' first. Signed-off-by: Justus Winter <[email protected]>
* common: Correctly handle modules relying on npth.Justus Winter2016-09-271-2/+4
| | | | | | | | * common/Makefile.am (common_sources): Drop 'call-gpg.{c,h}'. (with_npth_sources): New variable. (libcommonpth_a_SOURCES): Use the new variable. Signed-off-by: Justus Winter <[email protected]>
* agent, sm: Set CTX after start_agent.NIIBE Yutaka2016-09-272-12/+31
| | | | | | | | | | | | | | | | * g10/call-agent.c (agent_keytocard): Assign parm.ctx after start_agent. * sm/call-agent.c (gpgsm_agent_pksign, gpgsm_scd_pksign) (gpgsm_agent_readkey, gpgsm_agent_scd_serialno) (gpgsm_agent_scd_keypairinfo, gpgsm_agent_marktrusted) (gpgsm_agent_passwd, gpgsm_agent_get_confirmation) (gpgsm_agent_ask_passphrase, gpgsm_agent_keywrap_key) (gpgsm_agent_export_key): Likewise. -- Reported-by: Rainer Perske GnuPG-bug-id: 2699 Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Removal of no-libgcrypt.o.NIIBE Yutaka2016-09-271-8/+1
| | | | | | | | | | | | | * dirmngr/Makefile.am (dirmngr_ldap_LDADD): Remove no-libgcrypt.o. -- Thanks to Rainer Perske who located the issue. GnuPG-bug-id: 2698 Signed-off-by: NIIBE Yutaka <[email protected]> This is a fix for the commit: 49829c29e541546084950b8a153067db371d101a
* agent: Allow only specific digest size for ECDSA.NIIBE Yutaka2016-09-271-13/+9
| | | | | | | | | | | | * agent/pksign.c (do_encode_dsa): Fix validation of digest size. -- Thanks to Steven Noonan <[email protected]> who offers patches and a test case. GnuPG-bug-id: 2702 Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: When adding a user id, make sure the keyblock has been prepared.Neal H. Walfield2016-09-222-1/+24
| | | | | | | | | | | | * g10/keyedit.c (keyedit_quick_adduid): Call merge_keys_and_selfsig on KEYBLOCK before adding the user id. * tests/openpgp/quick-key-manipulation.scm: Make sure that the key capabilities don't change when adding a user id. (key-data): New function. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2697
* tests: Add documentation, make interactive debugging possible.Justus Winter2016-09-202-1/+45
| | | | | | | | | * tests/openpgp/README: Add documentation about debugging and interfacing with GnuPG. * tests/openpgp/run-tests.scm (test::run-sync): Hand stdin to the child so that we can use a repl in the tests. Signed-off-by: Justus Winter <[email protected]>
* tests: Drop the old shell-based tests.Justus Winter2016-09-2040-3337/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>