aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Put full commit id into VERSION.Werner Koch2025-02-182-3/+3
| | | | | | | | * autogen.sh: Update from current libgpg-error. * configure.ac: Append commit id to the VERSION file. (BUILD_REVISION): New ac_define. * src/sysutils.c (_assuan_sysutils_blurb): Replace revision by full commit id.
* w32: Enable "w32_error" for assuan_sock_get_flag.NIIBE Yutaka2024-12-164-10/+17
| | | | | | | | | | | | | | | | | * src/assuan-defs.h (struct assuan_context_s): Have w32_error field. (_assuan_sock_wsa2errno): Supply CTX argument. * src/assuan-socket.c (_assuan_sock_wsa2errno): Put ERR to the field in CTX argument. (_assuan_sock_get_flag): Support "w32_error" string. (_assuan_sock_accept, _assuan_sock_bind): Follow the change. * src/assuan-uds.c (uds_reader, uds_writer): Likewise. * src/system-w32.c (__assuan_close, __assuan_socket): Likewise. (__assuan_connect): Likewise. -- GnuPG-bug-id: 7456 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix errno for assuan_sock_bind failure.NIIBE Yutaka2024-12-131-1/+1
| | | | | | | | | | * src/assuan-socket.c (_assuan_sock_bind): Use WSAGetLastError and the mapping to set ERRNO. -- GnuPG-bug-id: 7456 Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix FreeBSD to set the pid of assuan_peercred_t.Ben Kibbey2024-09-161-0/+9
| | | | | | | | * configure.ac: Check for struct xucred.cr_pid. * src/assuan-socket-server.c (accept_connection_bottom): Obtain the pid via LOCAL_PEERCRED. Signed-off-by: Ben Kibbey <[email protected]>
* Use socklen_t for the length of socket address.NIIBE Yutaka2024-07-113-12/+15
| | | | | | | | | | | | | | | * src/assuan-defs.h (_assuan_sock_connect): Use socklen_t. (_assuan_sock_bind, _assuan_sock_get_nonce): Likewise. * src/assuan-socket.c (_assuan_sock_connect): Likewise. (_assuan_sock_bind, _assuan_sock_get_nonce, assuan_sock_connect) (assuan_sock_bind, assuan_sock_get_nonce): Likewise. * src/assuan.h.in (assuan_sock_connect, assuan_sock_bind) (assuan_sock_get_nonce): Likewise. -- GnuPG-bug-id: 5924 Signed-off-by: NIIBE Yutaka <[email protected]>
* Update date of libassuan.m4.NIIBE Yutaka2024-07-111-1/+1
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix typo in assuan.h.NIIBE Yutaka2024-07-111-1/+1
| | | | | | | | * src/assuan.h.in (ASSUAN_NO_NPTH_SYSTEM_HOOKS_ANY_MORE): Fix. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* libassuan.m4: Fix AC_DEFINE variable expansion.Ben Kibbey2024-07-061-1/+1
| | | | | | | * src/libassuan.m4 (_AM_PATH_LIBASSUAN_COMMON): Use AC_DEFINE_UNQUOTED() to expand $req_libassuan_api. Signed-off-by: Ben Kibbey <[email protected]>
* Remove an declaration for an unused functionWerner Koch2024-06-251-3/+0
| | | | | | | | * src/assuan-defs.h (putc_unlocked): Remove declaration. -- It seems the test for putc_unlocked was remove a long time ago. GnuPG-bug-id: 7111
* Release 3.0.1libassuan-3.0.1Werner Koch2024-06-241-1/+1
| | | | | | | * src/libassuan.vers: Change to LIBASSUAN_2.0. -- GnuPG-bug-id: 7163
* Update copyright noticesWerner Koch2024-06-182-2/+2
| | | | --
* Add new socket flags "linger" and "reuseaddr".Werner Koch2024-06-181-0/+54
| | | | | * src/assuan-socket.c (_assuan_sock_set_flag): Add new flags. (_assuan_sock_get_flag): Ditto.
* libassuan.m4: Fix setting/using GPG_ERROR_CONFIG.NIIBE Yutaka2024-06-131-9/+8
| | | | | | | | | libassuan.m4 (_AM_PATH_GPGRT_CONFIG): Don't set GPG_ERROR_CONFIG and gpg_error_config_version. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Always append the process identification to hello line.Werner Koch2024-06-071-5/+0
| | | | | | | | * src/assuan-listen.c (assuan_accept): Always append "process %i". -- Is was surprising that we see this on Unix only for servers which do not set their own hello line.
* Fix the previous commit.NIIBE Yutaka2024-05-141-1/+1
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* m4: Include _AM_PATH_GPGRT_CONFIG definition.NIIBE Yutaka2024-05-141-2/+89
| | | | | | | | | * src/libassuan.m4: Find gpgrt-config. -- GnuPG-bug-id: 7114 Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix for v2 support: ASSUAN_REALLY_REQUIRE_V2_NPTH_SYSTEM_HOOKSNIIBE Yutaka2023-08-041-3/+3
| | | | | | | | | * src/assuan.h.in (ASSUAN_REALLY_REQUIRE_V2_NPTH_SYSTEM_HOOKS): Rename. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* New function: assuan_control.NIIBE Yutaka2023-08-024-0/+33
| | | | | | | | | | | | | * src/assuan.c (assuan_control): New. * src/assuan.h.in (ASSUAN_CONTROL_REINIT_SYSCALL_CLAMP): New. (assuan_control): New. * src/libassuan.def (assuan_control): Add. * src/libassuan.vers (assuan_control): Add. -- GnuPG-bug-id: 6625 Signed-off-by: NIIBE Yutaka <[email protected]>
* libassuan.m4: Allow use of libassuan 3 for API of version 2.NIIBE Yutaka2023-07-261-1/+3
| | | | | | | | * src/libassuan.m4: API 3 is backward compatible to API 2. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Add new pipe functions to control its server process.NIIBE Yutaka2023-07-246-5/+73
| | | | | | | | | | | | | | | | * src/assuan-pipe-connect.c (assuan_pipe_wait_server_termination) (assuan_pipe_kill_server): New. * src/assuan.h.in: Add new functions. * src/libassuan.def: Add symbols for those functions. * src/libassuan.vers: Likewise. * src/system-posix.c (__assuan_waitpid): Extend the semantics for OPTIONS. * src/system-w32.c (__assuan_waitpid): Likewise. -- GnuPG-bug-id: T6487 Signed-off-by: NIIBE Yutaka <[email protected]>
* socket: Don't call pre/post_syscall for bind.NIIBE Yutaka2023-07-241-3/+0
| | | | | | | | | | | | | | | * src/assuan-socket.c (_assuan_sock_bind): Don't call _assuan_pre_syscall and _assuan_post_syscall. -- In the current use cases in GnuPG, the socket is bound *before* calling npth_init and gpgrt_set_syscall_clamp, which results no syscall clamping. It's OK for bind to use with no syscall clamping as it is not blocked longer. Fixes-commit: 703b4100a4162216314d3489fa9d3160c3aadeb5 Signed-off-by: NIIBE Yutaka <[email protected]>
* Expose assuan_sock_accept function.NIIBE Yutaka2023-07-202-0/+2
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* Add _assuan_pre_syscall / _assuan_post_syscall to _assuan_sock_*.NIIBE Yutaka2023-07-201-12/+31
| | | | | | | | | | * src/assuan-socket.c (_assuan_sock_accept): Add _assuan_pre_syscall / _assuan_post_syscall. (_assuan_sock_bind): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Support larger greeting message.NIIBE Yutaka2023-07-191-1/+1
| | | | | | | | * src/assuan-listen.c (assuan_accept): Update the size. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Flush data before clearing the confidential flag.Werner Koch2023-06-151-1/+3
| | | | | | | | | | | | | * src/context.c (assuan_end_confidential): Flush data. -- This is required so that for example gpg-agent won't reveal a password in a log file if requested via get_passphrase --data X X X X (Note that --data is required in any case because the default of returing it with the OK line can't be secured).
* w32: Fix closing for non-socket HANDLE.NIIBE Yutaka2023-06-061-9/+4
| | | | | | | | | | | | * src/system-w32.c (__assuan_close): Revert the change. -- There are use cases where closing output_fd / input_fd which may be not socket. Fixes-commit: c93eb901e58d5b31294c2d452659b5150d95ec59 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix hello_line parsing for fd passing.NIIBE Yutaka2023-06-011-1/+1
| | | | | | | * tests/fdpassing.c (server_socket): Test with comma in the hello line. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Always include process information in HELLO.NIIBE Yutaka2023-05-311-4/+23
| | | | | | | * src/assuan-listen.c (assuan_accept): Supply process information when ctx->hello is avaliable, too. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix error return for sending fd.NIIBE Yutaka2023-05-311-6/+16
| | | | | | | | * src/system-w32.c (get_file_handle): Have a CTX to compose an error. (w32_fdpass_send): Check PROCESS_ID. Compose an error with _assuan_error. Signed-off-by: NIIBE Yutaka <[email protected]>
* Allow use of global system hooks with API version 2.NIIBE Yutaka2023-05-242-1/+7
| | | | | | | | * src/libassuan.m4 (LIBASSUAN_API_REQUESTED): New. * src/assuan.h.in (ASSUAN_NO_GLOBAL_SYSTEM_HOOKS_ANY_MORE): New. (ASSUAN_SYSTEM_NPTH_IMPL, ASSUAN_SYSTEM_NPTH): Relax the condition. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: File handle passing to server is now supported.NIIBE Yutaka2023-05-171-2/+2
| | | | | | | | | * configure.ac: Fix for MinGW. * src/assuan-buffer.c (assuan_sendfd): Fix runtime check. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Don't use ASSUAN_INVALID_PID for assuan_pid_t value.NIIBE Yutaka2023-05-172-3/+3
| | | | | | | | | * src/assuan.c (assuan_new_ext): Use -1. * src/client.c (_assuan_client_finish): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Cleaner semantics for PID and Process handle.NIIBE Yutaka2023-05-1715-36/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/assuan-defs.h (struct assuan_context_s): Introduce SERVER_PROC member. Clarify the use of PROCESS_ID and PID. Introduce assuan_pid_t for internal use of process id or handle. * src/assuan.h.in: Follow the change. * src/assuan.c (assuan_new_ext): Likewise. * src/client.c (_assuan_client_finish): Likewise. * src/assuan-pipe-connect.c (pipe_connect): Likewise. * src/server.c (_assuan_server_finish): Likewise. * src/system-posix.c: Likewise. * src/system-w32.c: Likewise. * src/system.c: Likewise. * src/assuan-pipe-server.c (assuan_init_pipe_server) [HAVE_W32_SYSTEM]: Exclude the use of _assuan_pipe_connect_pid. * src/assuan-socket-server.c (accept_connection_bottom) [HAVE_W32_SYSTEM]: Exclude the use of the member peercred.pid. * src/assuan-socket.c (_assuan_sock_check_nonce): Support Cygwin Unix domain emulation for having valid client process ID. * src/context.c (assuan_get_pid): Clarify the use cases. * src/posix-types.inc.h, src/w32-types.inc.h: Introduce assuan_pid_t. -- GnuPG-bug-id: 6487 Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix comments.NIIBE Yutaka2023-05-172-2/+2
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix wrong return type for functions.NIIBE Yutaka2023-05-161-6/+6
| | | | | | | * src/system.c (_assuan_recvmsg, _assuan_sendmsg): Fix to int. (_assuan_waitpid): Fix to pid_t. Signed-off-by: NIIBE Yutaka <[email protected]>
* Deprecate ASSUAN_SYSTEM_NPTH.NIIBE Yutaka2023-05-111-0/+5
| | | | | | | | | | | * src/assuan.h.in: Introduce new configuration with ASSUAN_REALLY_REQUIRE_OLD_WAY_OF_SYSTEM_NPTH. -- Existing use cases just works with ASSUAN_SYSTEM_NPTH=NULL. Signed-off-by: NIIBE Yutaka <[email protected]>
* Allow NULL for system_hooks.NIIBE Yutaka2023-05-111-0/+3
| | | | | | * src/system.c (_assuan_system_hooks_copy): Do nothing with SRC=NULL. Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix the previous commit.NIIBE Yutaka2023-05-111-0/+2
| | | | | | | * src/assuan.c (_assuan_pre_syscall): Call the pre_syscall_func function after get it. Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix calling gpgrt_get_syscall_clamp.NIIBE Yutaka2023-05-111-6/+5
| | | | | | | | | * src/assuan.c (assuan_new_ext): Move gpgrt_get_syscall_clamp to... (_assuan_pre_syscall): ... here. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Minor fixes for ifdef/endif for W32 and W64.NIIBE Yutaka2023-05-103-3/+3
| | | | | | | | | | * src/assuan-defs.h: Fix. * src/assuan-pipe-connect.c: Likewise. * src/assuan-socket-connect.c: Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix the semantics of sending FD, it's Windows HANDLE.NIIBE Yutaka2023-05-102-29/+12
| | | | | | | | | | | | * src/assuan-handler.c (w32_handler_sendfd): It's Windows HANDLE. * src/system-w32.c (get_file_handle, w32_fdpass_send): Likewise. * tests/fdpassing.c (cmd_echo): Received FD is Windows HANDLE. (client): Use Windows HANDLE for assuan_sendfd. -- GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>
* Implement timeout in assuan_sock_connect_byname.NIIBE Yutaka2023-05-082-17/+42
| | | | | | | | | | | | | * src/assuan-socket.c (socks5_connect): Add new argument TIMEOUT in milliseconds. (_assuan_sock_connect): Follow the change. (_assuan_sock_connect_byname): Fourth argument is now TIMEOUT. (assuan_sock_connect_byname): Likewise. -- GnuPG-bug-id: 3302 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix assuan_socket_connect.NIIBE Yutaka2023-01-041-1/+2
| | | | | | | | | | | | | * src/assuan-socket-connect.c (_assuan_connect_finalize): Don't set flags.is_socket here, since it's too late. (assuan_socket_connect_fd): Set flags.is_socket. (assuan_socket_connect): Set flags.is_socket, before _assuan_sock_new. -- GnuPG-bug-id: 6324 Fixes-commit: c93eb901e58d5b31294c2d452659b5150d95ec59 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix confusion between process ID and process HANDLE.NIIBE Yutaka2022-11-154-12/+12
| | | | | | | | | | | | | | | * src/assuan-defs.h (struct assuan_context_s): Rename to process_id. * src/assuan-pipe-connect.c (initial_handshake): Fix variable name and access to the member field. * src/assuan-socket-connect.c (_assuan_connect_finalize): Likewise. * src/system-w32.c (get_file_handle): Likewise. (w32_fdpass_send): Likewise. -- Fixes-commit: ba84b780df973ba7ca7f7c51fbd1b6d1a69b8c01 GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Have PROCESS_HANDLE in struct assuan_context_s.NIIBE Yutaka2022-11-094-10/+17
| | | | | | | | | | | | | | | | | | * src/assuan-defs.h (struct assuan_context_s): Add process_handle field. It's "int" instead of DWORD, because of getpid function. * src/assuan-pipe-connect.c (initial_handshake): Set ->process_handle, not override ->pid. * src/assuan-socket-connect.c (assuan_connect_finalize): Likewise. * src/system-w32.c (w32_fdpass_send): Use ->process_handle. -- In the client code, ctx->pid (by the function assuan_get_pid) may be used to watch the finish of server process. Thus, it should not be overridden. See: gnupg/agent/call-daemon.c. GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Support fd passing through socket.NIIBE Yutaka2022-11-072-1/+29
| | | | | | | | | | | | * src/assuan-socket-connect.c (_assuan_connect_finalize): Use w32_fdpass_send. Get peer's PID from the initial connection. * src/assuan-socket-server.c (assuan_init_socket_server): Use w32_fdpass_recv. -- GnuPG-bug-id: GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Support fd passing through pipe.NIIBE Yutaka2022-11-072-3/+35
| | | | | | | | | | | | | | | | * src/assuan-pipe-connect.c (initial_handshake): Get peer's PID from the initial interaction. * src/assuan-pipe-server.c (assuan_init_pipe_server): Handle the case of FILEDES == NULL on Windows. * tests/Makefile.am [HAVE_W32_SYSTEM] (TESTS): Add fdpassing. * tests/fdpassing.c: Remove including sys/socket.h and sys/wait.h. (cmd_echo): Output to stder, as stdout is /dev/null. (main): Support Windows. -- GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>
* Show the pid of listening process in the hello line.NIIBE Yutaka2022-11-071-1/+1
| | | | | | | | | | | | | | | | | * src/assuan-listen.c (assuan_accept): Use getpid instead of assuan_get_pid. -- This changes the initial interaction. Before the change, the PID of peer was shown from listening process (but not used at all, in the code). That is, it was the PID of connecting process. After the change, the PID of listening process is shown, which can be used by connecting process. GnuPG-bug-id: 6236 Fixes-commit: a00b1ede5403f1e38534cc3b232739f20b8567e9 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Support sendfd/recvfd through pipe connection.NIIBE Yutaka2022-11-044-8/+91
| | | | | | | | | | | | | | | | | * src/assuan-defs.h (w32_fdpass_send, w32_fdpass_recv): New. * src/assuan-pipe-connect.c [HAVE_W32_SYSTEM] (pipe_connect): Set w32_fdpass_send. [!HAVE_W32_SYSTEM] (assuan_pipe_connect): Use socketpair_connect. * src/assuan-pipe-server.c [HAVE_W32_SYSTEM] (assuan_init_pipe_server): Set w32_fdpass_recv. * src/system-w32.c (get_file_handle): New. (w32_fdpass_send): New, using "SENDFD" internal command. (w32_fdpass_recv): New, using the result of "SENDFD" internal command. -- GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Add SENDFD internal command.NIIBE Yutaka2022-11-041-0/+48
| | | | | | | | | | * src/assuan-handler.c (w32_handler_sendfd): New. (std_cmd_table): Add the "SENDFD" command. -- GnuPG-bug-id: 6236 Signed-off-by: NIIBE Yutaka <[email protected]>