aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan.h.in (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-10-12build: Remove WindowsCE support from mkheader.NIIBE Yutaka1-4/+2
* src/assuan.h.in (@include:sys/types.h@, @include:unistd.h@): Simply include <sys/types.h> and <unistd.h>. (@include:w32ce-add@): Remove. * src/mkheader.c (write_special): Remove mingw32ce support. -- GnuPG-bug-id: 6170 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-04-08Add assuan_sock_accept function.NIIBE Yutaka1-0/+2
* src/assuan-socket.c (_assuan_sock_accept): New. (assuan_sock_accept): New. * src/assuan.h.in (assuan_sock_accept): New. -- GnuPG-bug-id: 5925 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-04-04w32: Fix assuan_socket_connect_fd to be usable.NIIBE Yutaka1-1/+1
* src/assuan.h.in (assuan_socket_connect_fd): Second arg assuan_fd_t. * src/assuan-socket-connect.c (assuan_socket_connect_fd): Second arg should be an object of type SOCKET. * src/posix-fd-t.inc.h (assuan_fd_from_posix_fd): Remove. * src/w32-fd-t.inc.h (assuan_fd_from_posix_fd): Move to... * src/system-w32.c (assuan_fd_from_posix_fd): ... here. -- On Windows, when an application has an already-connected socket, it must be an object of type SOCKET. In this case, it is wrong to use _get_osfhandle. This does not constitute any ABI/API change for POSIX system. This is an API change for Windows, as assuan_fd_t on Windows is pointer type, but it's a fix from non-correctly-usable API. Signed-off-by: NIIBE Yutaka <[email protected]>
2022-03-31Fix internal socket API to be consistent for SOCKET.NIIBE Yutaka1-14/+23
* src/assuan-defs.h (_assuan_socket): Return value has type assuan_fd_t. (_assuan_connect): Second argument has type assuan_fd_t. [HAVE_W64_SYSTEM] (SOCKET2HANDLE): Revert the change before. * src/assuan-socket.c (_assuan_sock_new): No type coercion for _assuan_socket. (socks5_connect): No type coercion for _assuan_connect. (_assuan_sock_connect): Likewise. * src/assuan.h.in (struct assuan_system_hooks): Fix method signature of socket for return value type and of connect for the second argument. (__assuan_socket): Return value has type assuan_fd_t. (__assuan_connect): Second argument has type assuan_fd_t. (ASSUAN_SYSTEM_NPTH_IMPL): Fix for _assuan_npth_connect for its second argument. * src/system-w32.c (__assuan_socket): Return value has type assuan_fd_t. Use SOCKET2HANDLE for type coercion for socket. Use INVALID_SOCKET. (__assuan_connect): Second argument has type assuan_fd_t. Use HANDLE2SOCKET for type coercion for sock. * src/system.c (_assuan_socket): Return value has type assuan_fd_t. (_assuan_connect): Second argument has type assuan_fd_t. -- Note that this change does *NOT* constitute any ABI change, no API change, either. It is fix for internal consistency for socket. The change of SOCKET2HANDLE in the past for HAVE_W64_SYSTEM was done, because of internal use of 'int' which represents the type for socket. Instead of fixing that part of code for 'int', I touched another part to silence warnings. That's not correct fix, but a work around. This time, with the changes, whole parts are now consisitent. Fixes-commit: 6c736325c028647dc3283bf723e2e28199e7f45b Signed-off-by: NIIBE Yutaka <[email protected]>
2022-03-31Remove GNU Pth support.NIIBE Yutaka1-27/+0
* src/posix-sys-pth-impl.h: Remove. * src/w32-sys-pth-impl.h: Remove. * src/Makefile.am: Follow the change. * src/assuan.h.in (ASSUAN_SYSTEM_PTH_IMPL, ASSUAN_SYSTEM_PTH): Remove. * src/mkheader.c (write_special): Remove Pth support. -- GnuPG-bug-id: 5911 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-03-22Release 2.5.5.libassuan-2.5.5Werner Koch1-1/+1
2020-10-23Release 2.5.4libassuan-2.5.4Werner Koch1-1/+1
2019-11-27doc: Minor comment cleanup and beautification.Werner Koch1-42/+61
--
2019-02-11Release 2.5.3libassuan-2.5.3Werner Koch1-2/+2
2018-02-23Fix previous commit.NIIBE Yutaka1-2/+2
Signed-off-by: NIIBE Yutaka <[email protected]>
2017-12-07Fix regression in ASSUAN_SYSTEM_NPTH_IMPL.Werner Koch1-2/+2
* src/assuan.h.in (ASSUAN_SYSTEM_NPTH_IMPL): A void fucntion can't assign. -- Fixes-commit: a627350eed5dc32bac41195462f27dee1987b0f5 Signed-off-by: Werner Koch <[email protected]>
2017-12-07Release 2.5.0libassuan-2.5.0Werner Koch1-1/+1
Signed-off-by: Werner Koch <[email protected]>
2017-12-07Allow change of system hooks for assuan_sock_...NIIBE Yutaka1-2/+7
* src/assuan-socket.c (assuan_sock_set_system_hooks): New. * src/assuan.h.in (assuan_sock_set_system_hooks): New prototype. * src/libassuan.def: Add new function. * src/libassuan.vers: Add new function. -- Co-authored-by: [email protected] Signed-off-by: Werner Koch <[email protected]>
2017-12-06Use wrapped __assuan_usleep for _assuan_npth_usleep.NIIBE Yutaka1-1/+3
* src/assuan.h.in (_assuan_npth_usleep): Wrap __assuan_usleep. -- Assuan should support system hooks for nPth before npth_init. Before the call of npth_init, npth_unprotect and npth_protect do nothing, whiile npth_usleep may crash. No use of npth_usleep is better. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-11-30Wrap assuan_close for nPth.NIIBE Yutaka1-6/+10
* src/assuan.h.in (_assuan_npth_close): New. (_assuan_system_npth): Use _assuan_npth_close. -- In some situation, closesocket on Windows may block. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-11-15Add an SPDX tag to all core files.Werner Koch1-19/+20
--
2015-11-26Protect connect system hook against blocking (nPth).Werner Koch1-1/+6
* src/assuan.h.in (ASSUAN_SYSTEM_NPTH_IMPL): Add wrapper for connect. Signed-off-by: Werner Koch <[email protected]>
2015-10-26Support hostname based SOCKS5 connection.Werner Koch1-0/+12
* src/assuan.h.in (ASSUAN_SOCK_SOCKS): New. (ASSUAN_SOCK_TOR): New. (assuan_sock_connect_byname): New. * src/libassuan.def, src/libassuan.vers: Add that function. * src/assuan-socket.c (socks5_connect): Add args socksport, credentials, hostname, and hostport. Implement user/password authentication and domainname address type. Change callers accordingly. (_assuan_sock_connect_byname): New. (assuan_sock_connect_byname): New. * tests/socks5.c (main): Add options --byname, --user, and --pass. -- The assuan_sock_connect_byname may eventually be extended to work without Tor or SOCKS by using getaddrinfo. Or we move that all to libgpgrt (aka libgpg-error). Signed-off-by: Werner Koch <[email protected]>
2015-08-28Release 2.3.0libassuan-2.3.0Werner Koch1-1/+1
* configure.ac: Set LT version to C6/A6/R0. Signed-off-by: Werner Koch <[email protected]>
2015-06-30Add assuan_sock_set_flag and assuan_sock_get_flag.Werner Koch1-0/+2
* src/assuan-socket.c (_assuan_sock_set_flag): New. (assuan_sock_set_flag): New. (_assuan_sock_get_flag, assuan_sock_get_flag): New. * src/assuan.h.in (assuan_sock_set_flag): New. (assuan_sock_get_flag): New. * src/libassuan.def: Add them. * src/libassuan.vers: Add them. -- These new functions are intended for a Cygwin socket emulation. This commit merely introduces a generic framework. Signed-off-by: Werner Koch <[email protected]>
2014-11-28Implement socket file redirection.Werner Koch1-0/+2
* configure.ac (AC_CHECK_FUNC): Check for stat. * src/assuan-socket.c (SUN_LEN): Add. (eval_redirection): New. (_assuan_sock_connect) [!W32]: Implement socket file redirection. (_assuan_sock_set_sockaddr_un): New. (assuan_sock_set_sockaddr_un): New. -- This feature is useful to allow sockets with standard names even on file system which do not supports socket and to help with shared home directories. For example to use GnuPG 2.1 with shared home directories one will be abale to do: rm ~/.gnupg/S.gpg-agent || true printf "%%Assuan%%\nsocket=${HOME}/.gnupg/S.gpg-agent_${HOSTNAME}\n" \ > ~/.gnupg/S.gpg-agent Signed-off-by: Werner Koch <[email protected]>
2014-08-17Update copyright infoWerner Koch1-2/+2
--
2013-02-22Add assuan_check_version and ASSUAN_VERSION_NUMBER.Werner Koch1-1/+13
* src/assuan.c (assuan_check_version): New. (digitp, parse_version_number, parse_version_string) (compare_versions): New. Taken from libksba. * configure.ac (VERSION_NUMBER): New ac_subst. * src/Makefile.am (assuan.h): Pass VERSION and VERSION_NUMBER to mkheader. * src/assuan.h.in (ASSUAN_VERSION, ASSUAN_VERSION_NUMBER): New macros. (assuan_check_version): New prototype. * src/libassuan.def, src/libassuan.vers: Add assuan_check_version. * src/mkheader.c (write_special, main): Support version and version_number. * tests/version.c: New. * tests/Makefile.am (TESTS): Add version. -- All our other libs have a version number check, thus we should have one in Libassuan as well.
2012-01-24Fix npth port file handle use.Marcus Brinkmann1-7/+20
* assuan.h.in (ASSUAN_SYSTEM_NPTH_IMPL): Use npth_unprotect and npth_protect with actual assuan functions instead of npth wrappers. * libassuan.def: Add __assuan_read, __assuan_write, __assuan_sendmsg, __assuan_recvmsg, __assuan_waitpid exports. * system-w32.c (__assuan_read, __assuan_write, __assuan_sendmsg, __assuan_recvmsg, __assuan_waitpid): Make non-static.
2012-01-03Make assuan portable to NPTH.Marcus Brinkmann1-0/+31
2011-12-20Release version 2.0.3.libassuan-2.0.3Werner Koch1-2/+2
* configure.ac: Bump LT version to C3/A3/R0.
2011-08-10Add new flag ASSUAN_FORCE_CLOSE.Werner Koch1-4/+6
2011-03-09Added assuan_socket_connect_fd() to attach an existing socket file ↵[email protected]1-0/+4
descriptor to a context.
2011-02-28Pass only the command name to the pre_cmd_notify() callback to keep ABI ↵Ben Kibbey1-10/+1
compatibility.
2011-02-24assuan_register_pre_cmd_notify().Ben Kibbey1-0/+11
2011-02-02Fix C++ users.Marcus Brinkmann1-1/+1
2011-02-02 Marcus Brinkmann <[email protected]> * assuan.h.in: Replace namespace by _namespace.
2011-02-02Fix C++ users.Marcus Brinkmann1-1/+1
2011-02-02 Marcus Brinkmann <[email protected]> * assuan.h.in: Replace namespace by _namespace.
2011-02-02Extend system hooks table by socket and connect functions.Marcus Brinkmann1-2/+7
2011-02-02 Marcus Brinkmann <[email protected]> * assuan-defs.h (_assuan_socket, _assuan_connect): New prototypes. * assuan.h.in (ASSUAN_SYSTEM_HOOKS_VERSION): Bumped to 2. (struct assuan_system_hooks): Add socket and connect members. (__assuan_socket, __assuan_connect): New prototypes. (_ASSUAN_SYSTEM_PTH_IMPL): Add socket and connect members. * assuan-socket-connect.c (assuan_socket_connect): Call _assuan_socket and _assuan_connect instead _assuan_sock_new and _assuan_sock_connect. (libassuan.def, libassuan.vers): Add __assuan_socket and __assuan_connect. * system.c (_assuan_system_hooks_copy): Initialize destination from system hooks, so we don't get any NULL pointers if there is a version mismatch. Support version 2 of the system hook structure. (_assuan_socket, _assuan_connect): New functions. * system-posix.c (__assuan_socket, __assuan_connect): New functions. (_assuan_system_hooks): Add __assuan_socketm, __assuan_connect. * system-w32.c (__assuan_socket, __assuan_connect): New functions. (_assuan_system_hooks): Add __assuan_socketm, __assuan_connect. * system-w32ce.c (__assuan_socket, __assuan_connect): New functions. (_assuan_system_hooks): Add __assuan_socketm, __assuan_connect.
2010-11-01Changes to allow building the CE version with MSC.Werner Koch1-2/+2
2010-09-01Add a no_logging flag.Werner Koch1-0/+2
2010-08-19Prepare for a gpg-error changeWerner Koch1-1/+1
2010-08-11Add ASSUAN_CONVEY_COMMENTS flag.Werner Koch1-0/+3
2010-04-06Removed sysdep stuff from assuan.h.Werner Koch1-154/+5
fixed a problem for W32CE and Pth.
2010-03-22Changed the implementation of CreatePipe under W32CE.Werner Koch1-8/+4
Reorganized the source.
2010-03-11Cleaned up the loggingWerner Koch1-0/+1
2010-02-24A couple of changes to eventually fully support W32ce.Werner Koch1-0/+11
2010-01-28Cleanups for W32CE.Werner Koch1-2/+7
Implement getenv replacement for W32CE.
2009-12-14Return and parse comment lines with the assuan_client_ functions.Werner Koch1-0/+1
2009-12-08Another one.Marcus Brinkmann1-1/+1
2009-12-082009-12-08 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-1/+1
* assuan.h (struct assuan_system_hooks): Don't use "namespace" as argument name in declaration (C++ keyword).
2009-12-08doc/Marcus Brinkmann1-0/+1
2009-12-08 Marcus Brinkmann <[email protected]> * assuan.texi (Contexts): Document ASSUAN_SPAWN_DETACHED. src/ 2009-12-08 Marcus Brinkmann <[email protected]> * assuan.h (ASSUAN_SPAWN_DETACHED): New macro. * assuan-pipe-connect.c (pipe_connect): Calculate spawn_flags from flags.
2009-12-082009-12-08 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-1/+4
* assuan_fd_from_posix_fd (assuan_fd_from_posix_fd): Handle invalid fd early.
2009-12-082009-12-08 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-0/+10
* assuan-socket.c (get_nonce): Cast buffer to unsigned. (_assuan_sock_connect) [HAVE_W32_SYSTEM]: Drop ctx argument from read_port_and_nonce invocation. * system.c (assuan_fdopen) [HAVE_W32_SYSTEM]: Fix typo in variable name. (__assuan_spawn) [HAVE_W32_SYSTEM]: Fix types of fd and fdp. Use ASSUAN_INVALID_FD. Add missing context argument to _assuan_free, and fix call to _assuan_w32_strerror. Set errno on error. (__assuan_socketpair) [HAVE_W32_STRERROR]: Fix type of filedes argument. * assuan-pipe-connect.c (pipe_connect, assuan_pipe_connect, socketpair_connect) [HAVE_W32_SYSTEM]: Fix type of fd_child_list. * assuan-defs.h (_assuan_socketpair): Likewise for prototype. * assuan.h (assuan_fd_from_posix_fd): New static inline function.
2009-12-02src/Marcus Brinkmann1-0/+20
2009-12-02 Marcus Brinkmann <[email protected]> * Makefile.am (common_sources): Remove assuan-client.c. * assuan-client.c: File removed. * assuan.h (ASSUAN_RESPONSE_ERROR, ASSUAN_RESPONSE_OK) (ASSUAN_RESPONSE_STATUS, ASSUAN_RESPONSE_INQUIRE) (ASSUAN_RESPONSE_STATUS): New macros. (assuan_response_t): New type. (assuan_client_read_response, assuan_client_parse_response): New prototypes. * libassuan.def, libassuan.vers: Add assuan_client_read_response, assuan_client_parse_response. * assuan-client.c (xtoi_1, xtoi_2, assuan_transact) (_assuan_read_from_server): Moved to ... * client.c: ... here, with updates to use new functions and types. Include <stdlib.h>. (assuan_client_read_response, assuan_client_parse_response): New functions. * assuan-defs.h (_assuan_read_from_server): Use assuan_response_t. * assuan-pipe-connect.c (initial_handshake): Use assuan_response_t and ASSUAN_RESPONSE_OK. * assuan-socket-connect.c (assuan_socket_connect): Likewise.
2009-11-272009-11-27 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-0/+3
* assuan.h (assuan_set_assuan_log_stream): Add prototype. * libassuan.def, libassuan.vers: Add back assuan_set_assuan_log_stream. * assuan-logging.c (assuan_set_assuan_log_stream): Add back. * context.c (assuan_get_pointer): Don't output debug info here. (assuan_get_peercred, assuan_get_pid): But do here. * system.c: Improve debug output. * assuan-defs.h (struct assuan_context_s): Rename pipe_mode to max_accepts. * assuan-listen.c (assuan_accept): Rework max accepts logic. * assuan-socket-server.c (assuan_init_socket_server), assuan-socket-connect.c (assuan_socket_connect), assuan-pipe-server.c (assuan_init_pipe_server), assuan-pipe-connect.c (socketpair_connect): Add debug output, set max_accepts instead of pipe_mode.