aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-12-13Release 2.5.2libassuan-2.5.2Werner Koch2-3/+3
* configure.ac: Bump LT version to C8/A8/R2. Signed-off-by: Werner Koch <[email protected]>
2018-11-14libassuan.vers: Remove duplicates.NIIBE Yutaka1-2/+0
Signed-off-by: NIIBE Yutaka <[email protected]>
2018-11-14server: Don't call _assuan_waitpid on server side.NIIBE Yutaka2-7/+6
* src/server.c (_assuan_server_finish): Never call waitpid here. * src/assuan-socket-server.c (accept_connection_bottom): Indentation. -- The waitpid/wait only makes sense by parent catching its child process. Since the commit 93595de1ede96dedfcaa93c7442536a2cde0b6ef (for version 0.6.5, in 2004-04-21), CTX->PID on server side has client PID. In the commit cb53f862ff2a864da822d1c16d3df6a02157608b (2009-11-19), call of _assuan_waitpid was introduced in assuan_server_finish, but this call always fails because the process is not a child process of server. (If we could catch exit of non-child process, it might cause a dead lock, since client does call waitpid too.) The indentation fix is to show the place where PID is assigned. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-11-08socket: Use union for sockaddr access.NIIBE Yutaka1-15/+21
* src/assuan-socket.c (socks5_connect, use_socks): Use union to access, instead of using cast to the pointer. -- In some machine like 32-bit ARM, alignment requirement of struct sockaddr and struct sockaddr_in (or struct sockaddr_in6) is different. Although it is completely valid to use the value of the address by cast here, because the object should be allocated by struct sockaddr_in or struct sockaddr_in6 to be referred by struct sockaddr *. But compiler doesn't assume such a usage, thus, emits warnings. The API with struct sockaddr * is a bit difficult thing. I examined GNU C library for the implementation of the connect function, it uses transparent union, the GCC feature. It would be too much, if we do same thing here. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-11-02build: Update gpg-error.m4 and libassuan.m4.NIIBE Yutaka1-0/+1
* m4/gpg-error.m4: Update to 2018-11-02. * src/libassuan.m4: Add AC_MSG_NOTICE. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-29build: Update gpg-error.m4 and libassuan.m4.NIIBE Yutaka1-9/+9
* m4/gpg-error.m4: Update to 2018-10-26. * src/libassuan.m4: Follow the change of gpgrt-config. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-26libassuan.m4: Better backward compatibility support.NIIBE Yutaka1-3/+15
* m4/gpg-error.m4: Update. * src/libassuan.m4: Don't assume libassuan-config is newer. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-26build: Fix libassuan.m4.NIIBE Yutaka1-1/+1
* src/libassuan.m4: Use AC_PATH_PROG to detect libassuan-config. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-26build: Fix previous commit.NIIBE Yutaka1-0/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-26build: Improve libassuan.m4.NIIBE Yutaka1-4/+4
* src/libassuan.m4: Don't try gpgrt-config when LIBASSUAN_CONFIG set. Fall back to detecting libassuan-config, when gpgrt-config doesn't work well. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-25build: Fix previous commit.NIIBE Yutaka1-1/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-25build: Relax requirements.NIIBE Yutaka1-4/+10
* m4/gpg-error.m4: Update from libgpg-error 1.33. * src/libassuan.m4: Don't require AM_PATH_GPG_ERROR. Only when gpgrt-config is available and works well, use it. * configure.ac (AM_PATH_GPG_ERROR): No requirement any more. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-25build: Use LIBASSUAN_CONFIG_LIBS (instead of LIB).NIIBE Yutaka2-3/+3
* configure.ac (LIBASSUAN_CONFIG_LIBS): Rename from *_LIB. (LIBASSUAN_CONFIG_EXTRA_LIBS): Remove. * src/libassuan-config.in: Follow the change. * src/libassuan.pc.in: Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-24build: Fix libassuan.pc.NIIBE Yutaka1-1/+1
* src/libassuan.pc.in: Fix typo. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-24build: Fix previous commit.NIIBE Yutaka1-2/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-24build: Compatibility to pkg-config.NIIBE Yutaka1-0/+10
* src/libassuan-config.in: Support --variable and --modversion. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-24build: Make libassuan.m4 use gpg-error-config.NIIBE Yutaka1-10/+10
* src/libassuan.m4: Use gpg-error-config. -- The option --with-libassuan-prefix let it use libassuan-config. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-10-24build: Provide libassuan.pc, generated by configure.NIIBE Yutaka3-5/+21
* configure.ac (PACKAGE, VERSION): Remove. Generate src/libassuan.pc. * src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New. (assuan.h): Use PACKAGE_VERSION and VERSION_NUMBER vars. * src/libassuan-config.in: Use @PACKAGE_VERSION@. * src/libassuan.pc.in: New. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-02-26Silence two minor warning on Windows.NIIBE Yutaka2-4/+2
* src/assuan-defs.h [HAVE_W64_SYSTEM] (SOCKET2HANDLE): Care for size of integer. * src/stpcpy.c: No K&R anymore. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-02-23Fix previous commit.NIIBE Yutaka1-2/+2
Signed-off-by: NIIBE Yutaka <[email protected]>
2018-02-20Better credential support for other OSes.NIIBE Yutaka1-33/+63
* configure.ac (HAVE_UCRED_H, HAVE_SYS_UCRED_H): Check these headers unconditionally. (HAVE_SO_PEERCRED, HAVE_LOCAL_PEEREID): Remove. (HAVE_STRUCT_SOCKPEERCRED_PID): New. (HAVE_GETPEEREID): New. * src/assuan-socket-server.c (accept_connection_bottom): Add support for OpenBSD, macOS, and FreeBSD. -- Code in gpg-agent/command-ssh.c are integrated. 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 Koch3-3/+3
Signed-off-by: Werner Koch <[email protected]>
2017-12-07Allow change of system hooks for assuan_sock_...NIIBE Yutaka4-2/+16
* 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 special check version request \001\001Werner Koch2-1/+3
* src/assuan.c (assuan_check_version): Handle version "\001\001" * tests/version.c (main): Print extended version info. Signed-off-by: Werner Koch <[email protected]>
2017-11-15Add an SPDX tag to all core files.Werner Koch54-580/+631
--
2017-11-15Fix last commit.Werner Koch1-2/+2
* src/system-posix.c (__assuan_usleep): Its ysec and usecs -- Copy+Paste without even compiling was pretty dumb. Signed-off-by: Werner Koch <[email protected]>
2017-11-15Fix the nanosleep case of __assuan_usleep.Werner Koch2-3/+7
* src/system-posix.c (__assuan_usleep): Handle full seconds. -- This function would have failed for any value >= 1000000 because the nsec field is limited to 999999999 and the function fails for larger values. Signed-off-by: Werner Koch <[email protected]>
2017-09-06Define INADDR_LOOPBACK if not defined.NIIBE Yutaka1-0/+5
* src/assuan-socket.c (INADDR_LOOPBACK): Define. -- INADDR_LOOPBACK is not defined in some systems. When defined, its byte-order is not clearly defined in any specifications. So, best portable way is not to use the macro INADDR_LOOPBACK at all but use 0x7f000001 directly. Nevertheless, for systems which use libassuan, it's host byte-order. So, adding the definition works. GnuPG-bug-id: 2447 Suggested-by: Peter Dyballa Signed-off-by: NIIBE Yutaka <[email protected]>
2017-05-31Use gpgrt_free to release memory allocated by gpgrt_asprintf.NIIBE Yutaka2-6/+6
* src/assuan-logging.c (_assuan_log_control_channel): Use gpgrt_free. * src/debug.c (_assuan_debug, _assuan_debug_add, _assuan_debug_end): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-09-04EPROTO portability fix.Ben Kibbey1-2/+2
* src/assuan-socket.c(socks5_connect): Return EPROTONOSUPPORT rather than EPROTO. -- OpenBSD, and maybe other systems, doesn't define EPROTO. Signed-off-by: Ben Kibbey <[email protected]>
2016-07-13Allow socket redirection with assuan_socket_connect.Werner Koch1-7/+5
* src/assuan-socket-connect.c (assuan_socket_connect): Use set_socketaddr function. -- GnuPG-bug-id: 2253 Signed-off-by: Werner Koch <[email protected]>
2016-07-13Speedup closing fds before an exec.Werner Koch1-0/+40
* src/system-posix.c [__linux__]: Include dirent.h. (get_max_fds) [__linux__]: Return the actual used highest fd. -- This is the same code as introduced with the GnuPG commit 512c56af43027149e8beacf259746b8d7bf9b1a2 Signed-off-by: Werner Koch <[email protected]>
2016-06-25Fix minor memory leaksWerner Koch3-6/+9
* src/assuan-pipe-connect.c (socketpair_connect): Always free CHILD_FDS. * src/assuan-uds.c (uds_sendfd): Clear CONTROL_U to silence Valgrind. * tests/fdpassing.c (main): Free FNAME. * src/assuan-handler.c (dispatch_command): Remove dead assignment. Signed-off-by: Werner Koch <[email protected]>
2016-01-15Improve getting of max. number of open fds.Werner Koch3-32/+74
* configure.ac (AC_CHECK_FUNCS): Add getrlimit. * src/assuan-pipe-connect.c (MAX_OPEN_FDS): Remove non-used macro. * src/system.c (MAX_OPEN_FDS): Remove non-used macro. * src/system-posix.c: Include stdint.h, sys/time.h, sys/resource.h. (MAX_OPEN_FDS): Remove non-used macro. (get_max_fds): New. Taken from gnupg/common/exechelp-posix.c. (__assuan_spawn): Use it here. -- This is related to GnuPG-bug-id: 2071 Changing of get_max_fds from LPGLv3+ to LGPLv2+ approved by me as sole author or that code. Signed-off-by: Werner Koch <[email protected]>
2015-12-01Fix typos found by codespell.Justus Winter6-6/+6
-- Signed-off-by: Justus Winter <[email protected]>
2015-11-27New feature to test for SOCKS5 proxy availability.Werner Koch1-4/+24
* src/assuan-socket.c (socks5_connect): Add special treatment for empty hostnames. (_assuan_sock_connect_byname): Add feature to test for proxy availibility. * tests/socks5.c (main): Add option --have-proxy. Signed-off-by: Werner Koch <[email protected]>
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-11-26Do not use size_t with _assuan_read.Werner Koch1-1/+1
* src/assuan-socket.c (do_readn): Use ssize_t for N.
2015-11-21Also try port 9150 in Tor mode.Werner Koch1-0/+10
* src/assuan-socket.c (TOR_PORT2): New. (_assuan_sock_wsa2errno): Map WSAECONNREFUSED. (socks5_connect): Fall back to TOR_PORT2. Signed-off-by: Werner Koch <[email protected]>
2015-11-21Fix windows build with mingw-w64 2.0.xAndre Heinecke1-0/+24
* src/assuan-socket.c: Add errno values not defined by mingw-w64 2.0
2015-11-03w32: Use assuan_fd_t with the new socket functions.Werner Koch1-5/+6
* src/assuan-socket.c (socks5_connect): Use assuan_fd_t instead of int. (_assuan_sock_connect): Ditto. (_assuan_sock_connect_byname): Ditto. Signed-off-by: Werner Koch <[email protected]>
2015-11-03Use asprintf function from libgpg-error.Werner Koch4-228/+11
* configure.ac: Require libgpg-error 1.17. (vasprintf): Remove ac_replace. * src/assuan-defs.h [!HAVE_VASPRINTF]: Remove replace wrapper. * src/assuan-logging.c (_assuan_log_control_channel): (_assuan_log_control_channel): s/asprintf/gpgrt_asprintf/. * src/debug.c (_assuan_debug): s/vasprintf/gpgrt_vasprintf/. (_assuan_debug_begin): Ditto. (_assuan_debug_add): Ditto. s/asprintf/gpgrt_asprintf/. -- We plan to move more code into libgpg-error/gpgrt anyway thus this is a good start which also fixes this bug: GnuPG-bug-id: 1477 Signed-off-by: Werner Koch <[email protected]>
2015-10-26Support hostname based SOCKS5 connection.Werner Koch4-15/+176
* 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-10-18Support SOCKS5 for assuan_sock_connect.Werner Koch1-8/+232
* src/assuan-socket.c: Include netinet/in.h and arpa/inet.h. (SOCKS_PORT, TOR_PORT): New constants. (tor_mode): New variable. (_assuan_sock_set_flag): Add flags "tor-mode" and "socks". (_assuan_sock_get_flag): Ditto. (do_readn, do_writen): Always build. (socks5_connect): New. (use_socks): New. (_assuan_sock_connect): Divert to socks5_connect if requested. * tests/socks5.c: New. * configure.ac (AH_TOP): Define GPGRT_ENABLE_ES_MACROS. (AC_CHECK_FUNC): Check for getaddrinfo. * tests/Makefile.am (testtools): New. Add socks5. (AM_LDFLAGS): Add -no-install for easier debugging. -- A future extension might be a new assuan_sock_direct_connect call takes the hostname as a string and returns a new socket. This allows the proxy to do the resolving. However, in the long term these socket wrapper should be moved to libgpgrt (aka libgpg-error). Signed-off-by: Werner Koch <[email protected]>
2015-08-28Release 2.3.0libassuan-2.3.0Werner Koch2-2/+2
* configure.ac: Set LT version to C6/A6/R0. Signed-off-by: Werner Koch <[email protected]>
2015-08-28Support Cygwin local sockets.Werner Koch1-57/+284
* src/assuan-socket.c (cygwin_fdtable, cygwin_fdtable_cs): New. (is_cygwin_fd, insert_cygwin_fd, delete_cygwin_fd): New. (assuan_sock_init) [W32]: Init the CS. (assuan_sock_deinit) [W32]: Deinit the CS. (read_port_and_nonce): Add arg cygwin and detect Cygwin socket files. (_assuan_sock_set_flag): Add "cygwin" flag. (_assuan_sock_get_flag): Ditto. (do_readn, do_writen): New. (_assuan_sock_bind): Create a Cygwin socket file depending on a socket flag. (_assuan_sock_connect): Handle the cygwin socket protocol. (_assuan_sock_check_nonce): Ditto. -- This code has not been tested. Signed-off-by: Werner Koch <[email protected]>
2015-08-28Read up remaining lines in assuan_inquire after reaching MAXLENWerner Koch1-9/+17
* src/assuan-inquire.c (assuan_inquire): Clear return args on error. Read up remaining lines after MAXLEN has been hit. -- If we would stop immediately at MAXLEN, as we did, the client would continue to send data which the server may consider as new Assuan commands. Signed-off-by: Werner Koch <[email protected]>