aboutsummaryrefslogtreecommitdiffstats
path: root/common/call-gpg.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-07-09common: On Windows, we care about how PIPE handles are inherited.NIIBE Yutaka1-4/+4
* agent/gpg-agent.c (handle_connections): It's for POSIX. * kbx/keyboxd.c (handle_connections): Ditto. * scd/app.c (handle_connections): Ditto. * scd/scdaemon.c (handle_connections): Ditto. tpm2d/tpm2daemon.c (handle_connections): Ditto. * tests/gpgscm/ffi.c (do_pipe): Use GNUPG_PIPE_BOTH. (do_inbound_pipe): Use GNUPG_PIPE_INBOUND. (do_outbound_pipe): Use GNUPG_PIPE_OUTBOUND. * common/call-gpg.c (_gpg_encrypt): Specify outbound and inbound. (_gpg_decrypt): Likewise. * common/exechelp-posix.c (gnupg_create_pipe): Add an argument. * common/exechelp-w32.c (create_pipe_and_estream): Care about how PIPE handles are inherited to child process. (gnupg_create_pipe): Add an argument. * common/exechelp.h: Add enum values. -- Fixes-commit: af6c47b2910f394faf582800d60d88e9b4dcf834 Signed-off-by: NIIBE Yutaka <[email protected]>
2024-07-09common,kbx,tests: Clean up the PIPE function API.NIIBE Yutaka1-4/+5
* common/call-gpg.c (_gpg_encrypt, _gpg_decrypt): Simply, use gnupg_create_pipe. * tests/gpgscm/ffi.c (do_inbound_pipe): Likewise. * common/exechelp.h (gnupg_create_inbound_pipe): Use gnupg_fd_t for native pipe descriptor and don't expose other end of pipe. (gnupg_create_outbound_pipe): Ditto. * common/exechelp-posix.c (create_pipe_and_estream): Clean up. (gnupg_create_inbound_pipe): Fail if R_FD or R_FP is NULL. (gnupg_create_outbound_pipe: Ditto. * common/exechelp-w32.c (create_pipe_and_estream): Clean up. (gnupg_create_inbound_pipe): Fail if R_FD or R_FP is NULL. (gnupg_create_outbound_pipe: Ditto. (gnupg_create_pipe): Move the code from original create_pipe_and_estream to call _open_osfhandle. * common/exectool.c (gnupg_exec_tool_stream): Follow the change of API. * kbx/kbx-client-util.c (prepare_data_pipe): Likewise. -- GnuPG-bug-id: 7194 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-06-22agent,gpg,tools: Fix use of log_get_fd.NIIBE Yutaka1-2/+0
* agent/call-daemon.c (daemon_start): Don't put file descriptor from log_get_fd to no_close_list. * agent/call-pinentry.c (start_pinentry): Likewise. * common/call-gpg.c (start_gpg): Likewise. * call-syshelp.c (start_syshelp): Likewise. * tools/gpg-connect-agent.c (main): Likewise. -- GnuPG-bug-id: 5921 Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-28Spelling fixes in docs and comments.NIIBE Yutaka1-1/+1
-- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-05-27common: Extend gnupg_create_inbound_pipe et al.Werner Koch1-4/+4
* common/exechelp-posix.c (gnupg_create_inbound_pipe): Add args 'r_fp' and 'nonblock'. (gnupg_create_outbound_pipe): Ditto. * common/exechelp-w32.c (gnupg_create_inbound_pipe): Add non yet functional args 'r_fp' and 'nonblock'. (gnupg_create_outbound_pipe): Ditto. * common/exechelp-w32ce.c (gnupg_create_inbound_pipe): Ditto. (gnupg_create_outbound_pipe): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
2015-12-15common: Use default_errsource for call-gpg and exectool.Werner Koch1-14/+27
* common/call-gpg.c (my_error_from_syserror, my_error_from_errno): New. Use these wrappers. * common/exectool.c (my_error_from_syserror): New. Use these wrappers. -- Function in common should use the error source of the component which links them. The global variable DEFAULT_ERRSOURCE is set early by each component to make this possible. Signed-off-by: Werner Koch <[email protected]>
2015-11-27Silence compiler warnings related to not using assuan_fd_t.Werner Koch1-2/+2
* common/call-gpg.c (start_gpg): Use assuan_fd_t. Note that the declaration was already fixed by a previous change. * dirmngr/server.c (cmd_getinfo): Use assuan_fd_t. -- Note that this matters only for Windows and it does not harm as long as we can only build for 32 bit Windows withsizeof(int)==sizeof(void*). Signed-off-by: Werner Koch <[email protected]>
2015-11-26common: Make the GPG arguments configurable in call-gpg.Justus Winter1-18/+37
* common/call-gpg.c (start_gpg): Add parameter 'gpg_arguments'. (_gpg_encrypt, gpg_encrypt_blob, gpg_encrypt_stream): Likewise. (_gpg_decrypt, gpg_decrypt_blob, gpg_decrypt_stream): Likewise. * common/call-gpg.h: Adapt prototypes. * g13/create.c (encrypt_keyblob): Adapt callsite. * g13/g13-common.h (opt): Add field 'gpg_arguments'. * g13/g13.c (main): Construct default arguments. * g13/mount.c (decrypt_keyblob): Adapt callsite. * tools/gpgtar-create.c (gpgtar_create): Likewise. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. Signed-off-by: Justus Winter <[email protected]>
2015-11-25common: Add stream interface to call-pgp.Justus Winter1-18/+117
* common/call-gpg.c (struct writer_thread_parms): Add field 'stream'. (writer_thread_main): Support reading from a stream. (start_writer): Add stream argument. (struct reader_thread_parms): Add field 'stream'. (reader_thread_main): Support writing to a stream. (start_reader): Add stream argument. (_gpg_encrypt): Add stream api. (gpg_encrypt_blob): Adapt accordingly. (gpg_encrypt_stream): New function. (_gpg_decrypt): Add stream api. (gpg_decrypt_blob): Adapt accordingly. (gpg_decrypt_stream): New function. * common/call-gpg.h (gpg_encrypt_stream): New prototype. (gpg_decrypt_stream): Likewise. Signed-off-by: Justus Winter <[email protected]>
2015-11-25common: Refactor the call-gpg code.Justus Winter1-46/+79
* common/call-gpg.c (gpg_{en,de}crypt_blob): Move most of the code into two new functions, _gpg_encrypt and _gpg_decrypt. Signed-off-by: Justus Winter <[email protected]>
2015-11-25g13: Move 'call-gpg.c' to common.Justus Winter1-29/+26
* common/Makefile.am (common_sources): Add files. * g13/call-gpg.c: Move to 'common' and adapt slightly. Add a parameter to let callees override the gpg program to execute. * g13/call-gpg.h: Likewise. * g13/Makefile.am (g13_SOURCES): Drop files. * g13/create.c (encrypt_keyblob): Hand in the gpg program to execute. * g13/mount.c (decrypt_keyblob): Likewise. Signed-off-by: Justus Winter <[email protected]>
2015-04-06Rename DBG_ASSUAN to DBG_IPC and add separate DBG_EXTPROG.Werner Koch1-1/+1
* g10/options.h (DBG_EXTPROG_VALUE): Separate from DBG_IPC_VALUE.
2014-09-18g13: Avoid segv after pipe creation failure.Werner Koch1-6/+6
* g13/call-gpg.c (gpg_encrypt_blob): Init some vars in case of an early error. (gpg_decrypt_blob): Ditto.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-1/+1
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2012-01-25Port to npth.Marcus Brinkmann1-71/+67
* configure.ac: Don't check for PTH but for NPTH. (AH_BOTTOM): Remove PTH_SYSCALL_SOFT. (have_pth): Rename to ... (have_npth): ... this. (USE_GNU_NPTH): Rename to ... (USE_GNU_PTH): ... this. * m4/npth.m4: New file. * agent/Makefile.am, agent/cache.c, agent/call-pinentry.c, agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c, agent/trustlist.c, common/Makefile.am, common/estream.c, common/exechelp-posix.c, common/exechelp-w32.c, common/exechelp-w32ce.c, common/http.c, common/init.c, common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c, dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c, dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am, g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am, scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c, scd/scdaemon.c, tools/Makefile.am: Port to npth.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-17/+15
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2009-12-08common/Marcus Brinkmann1-4/+4
2009-12-08 Marcus Brinkmann <[email protected]> * asshelp.c (start_new_gpg_agent): Convert posix FD to assuan FD. agent/ 2009-12-08 Marcus Brinkmann <[email protected]> * call-pinentry.c (start_pinentry): Convert posix fd to assuan fd. * call-scd.c (start_scd): Likewise. sm/ 2009-12-08 Marcus Brinkmann <[email protected]> * call-dirmngr.c (start_dirmngr_ext): Convert posix fd to assuan fd. tools/ 2009-12-08 Marcus Brinkmann <[email protected]> * gpg-connect-agent.c (main): Convert posix fd to assuan fd.
2009-11-05agent/Marcus Brinkmann1-1/+2
2009-11-05 Marcus Brinkmann <[email protected]> * call-pinentry.c (start_pinentry): Call assuan_pipe_connect, not assuan_pipe_connect_ext. * command.c (start_command_handler): Change assuan_init_socket_server_ext into assuan_init_socket_server. * call-scd.c (start_scd): Update use of assuan_socket_connect and assuan_pipe_connect. * gpg-agent.c (check_own_socket_thread, check_for_running_agent): Update use of assuan_socket_connect. common/ 2009-11-05 Marcus Brinkmann <[email protected]> * asshelp.c (start_new_gpg_agent): Update use of assuan_socket_connect and assuan_pipe_connect. scd/ 2009-11-05 Marcus Brinkmann <[email protected]> * command.c (scd_command_handler): Call assuan_init_socket_server, not assuan_init_socket_server_ext. sm/ 2009-11-05 Marcus Brinkmann <[email protected]> * call-dirmngr.c (start_dirmngr_ext): Update use of assuan_pipe_connect and assuan_socket_connect. tools/ 2009-11-05 Marcus Brinkmann <[email protected]> * gpg-connect-agent.c (start_agent): Update use of assuan_socket_connect and assuan_pipe_connect.
2009-10-19[g13] Add RECIPEINT and CREATE command.Werner Koch1-7/+14
[sm] Chnage --include-certs default
2009-10-17Removed audit.h cruft which forced us to link against libksba.Werner Koch1-6/+0
There is no need for an audit file.
2009-10-13Keep on hacking on g13. A simple --create and --mount does now work.Werner Koch1-1/+131
A hacked up encfs is required.
2009-09-30Some changes to suport g13.Werner Koch1-0/+466