aboutsummaryrefslogtreecommitdiffstats
path: root/common/call-gpg.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* common: On Windows, we care about how PIPE handles are inherited.NIIBE Yutaka2024-07-091-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]>
* common,kbx,tests: Clean up the PIPE function API.NIIBE Yutaka2024-07-091-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]>
* agent,gpg,tools: Fix use of log_get_fd.NIIBE Yutaka2022-06-221-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]>
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-281-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]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* common: Extend gnupg_create_inbound_pipe et al.Werner Koch2016-05-271-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]>
* common: Use default_errsource for call-gpg and exectool.Werner Koch2015-12-151-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]>
* Silence compiler warnings related to not using assuan_fd_t.Werner Koch2015-11-271-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]>
* common: Make the GPG arguments configurable in call-gpg.Justus Winter2015-11-261-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]>
* common: Add stream interface to call-pgp.Justus Winter2015-11-251-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]>
* common: Refactor the call-gpg code.Justus Winter2015-11-251-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]>
* g13: Move 'call-gpg.c' to common.Justus Winter2015-11-251-0/+589
* 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]>