aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
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]>
2015-08-07Wipe the context before releasing as an extra safeguard.Werner Koch2-1/+15
* src/assuan-defs.h (wipememory2, wipememory): New. Taken from GnuPG. * src/assuan.c (assuan_release): Wipe the context. -- The assuan context has buffers which may carry senitive information. These buffers could be wiped out with each flush but that is too expensive. Thus we only wipe them when freeing the context. Signed-off-by: Werner Koch <[email protected]>
2015-06-30Add assuan_sock_set_flag and assuan_sock_get_flag.Werner Koch4-8/+63
* 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]>
2015-06-26Return GPG_ERR_SOURCE_ASSUAN on errors with no CTX.Werner Koch1-1/+1
* src/assuan-defs.h (_assuan_error): Use error source Assuan if no CTX is given. Signed-off-by: Werner Koch <[email protected]>
2015-06-26Do not segv if NULL is passed for CTX in sendfd and receivefd.Werner Koch2-2/+8
* src/assuan-buffer.c (assuan_sendfd): Check that CTX is not NULL. (assuan_receivefd): Ditto. -- This change is to align the behaviour with that of assuan_send_data. Suggested-by: Andre Heinecke. Signed-off-by: Werner Koch <[email protected]>
2015-01-30w32: Use -static-libgcc to avoid linking to libgcc_s_sjlj-1.dll.Werner Koch1-0/+4
* src/Makefile.am (extra_ltoptions): New. (libassuan_la_LDFLAGS): Use it. -- Since gcc 4.8 there is a regression in that plain C programs may link to libgcc_s.a which has a dependency on libgcc_s_sjlj.dll. This is for example triggered by using long long arithmetic on a 32 bit Windows (e.g symbol __udivdi3). This patch does not change anything right now but we add it anyway in case long long will ever be used. Signed-off-by: Werner Koch <[email protected]>
2015-01-28Require the use of automake 1.14Werner Koch1-1/+1
* configure.ac (AM_INIT_AUTOMAKE): Add serial-tests. * src/Makefile.am (INCLUDES): Rename to AM_CPPFLAGS and remove the nonexistent ../include/.
2015-01-28w32: Fix assuan_connect_fdWerner Koch1-10/+21
* src/assuan-socket-connect.c (assuan_socket_connect_fd): Map fd to assuan_fd_t. -- This function is actually not used by GnuPG. The function should have taken an assuan_fd but given that it did not we use our usual mapping from Windows libc fds to an assuan fd. Signed-off-by: Werner Koch <[email protected]>
2015-01-28Fix gcc warning about unused values.Werner Koch1-23/+24
* src/debug.h: Remove traling ", 0" expression part where not useful. -- gcc 4.9 detected this. Probably taken from gpgme but used differently. Signed-off-by: Werner Koch <[email protected]>
2015-01-27Fix WSAEADDRINUSE EADDRINUSE mismatch.Werner Koch2-3/+5
* src/w32-sock-nonce.inc.h (EADDRINUSE): Avoid redefining. * src/assuan-socket.c (_assuan_sock_bind): Set error to EADDRINUSE. -- With the latest mingw-w64 EADDRINUSE is defined but to a different value than WSAEADDRINUSE. We need to use EADDRINUSE becuase that is what applications expect. Signed-off-by: Werner Koch <[email protected]>
2015-01-27Comment updatesWerner Koch1-14/+16
--
2014-11-28Do not allow LFs in the redirected name.Werner Koch1-1/+8
* src/assuan-socket.c (eval_redirection): Stop parsing at the first LF. -- Avoiding LFs in file names is better for logging.
2014-11-28Implement socket file redirection.Werner Koch5-22/+244
* 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-11-07w32: Remove I/O delays due to our 100ms delay after an EAGAIN.Werner Koch2-0/+46
* src/system-w32.c (__assuan_read): Retry using select. Map WSAECONNRESET to EPIPE. (__assuan_write): Retry using select. * src/assuan-buffer.c (readline) [W32]: Return EOF instead of EPIPE.
2014-08-17Release 2.1.2.libassuan-2.1.2Werner Koch1-1/+1
* configure.ac: Set LT version to C4/A4/R2.
2014-08-17Update copyright infoWerner Koch2-4/+4
--
2014-08-17Fix possible segv in a call to _assuan_debug.Werner Koch1-1/+1
* src/context.c (assuan_set_error): Do not pass NULL for %s in the trace function. -- This likely fixes GnuPG-bug-id: 1659
2014-06-30Avoid a vasprintf call if tracing has not been enabled.Werner Koch1-12/+16
* src/debug.c (_assuan_debug): Check wether CAT want to be logged.
2014-04-16Fix NULL deref when tracing is enabled and malloc fails.Werner Koch2-7/+12
* src/debug.h (TRACE_ERR): Check CTX before a deref. * src/assuan-defs.h (_assuan_error): Turn into an inline function and check CTX before a deref. -- Found by Hans-Christoph Steiner with cppcheck.
2013-06-19Changes to support W64.Werner Koch2-8/+11
* configure.ac (have_dosish_system): Set for W64. * src/assuan-defs.h (SOCKET2HANDLE, HANDLE2SOCKET): Add versions for W64. * src/assuan-handler.c (assuan_command_parse_fd) [W64]: Use strtoull to parse an FD. -- Note that these changes are not complete but merely sufficient to allow building of GpgEX.
2013-02-22Add assuan_check_version and ASSUAN_VERSION_NUMBER.Werner Koch6-22/+144
* 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.
2013-02-22w32: Fix header inclusion order for newer toolchain.Werner Koch1-13/+12
* src/system-w32.c: Do not include windows.h here. -- winsock2.h must now be included before windows.h. This is already properly handled by assuan-defs.h.
2013-02-22Beautify the BUILD_TIMESTAMP and put it into the binary.Werner Koch1-1/+3
* configure.ac (BUILD_TIMESTAMP): Use an ISO date string on all platforms and ac_define it. * src/sysutils.c (_assuan_sysutils_blurb): But revision and build date into the binary. -- An ISO date is for sure better than the old C standard time format. An almost all platforms this should work. We don't print the seconds to be compatible with the way we did in on Windows. However we print in UTC.
2013-02-22w32ce: Adjust to changed API and make it build again.Werner Koch1-22/+22
* src/system-w32ce.c (__assuan_write, __assuan_recvmsg) (__assuan_sendmsg, __assuan_waitpid): Make functions global. * tests/ce-server.c: Fix syntax error (s/#else/#endif) -- This patch fixes some cruft which has accidentally been introduced over time. The code builds, but due to a lack of ready to use CE box, I was not able to test it.
2013-02-22Modernize release version management.Werner Koch1-3/+3
* configure.ac: Update to modern git version checking. Remove svn support. * src/versioninfo.rc.in: Update copyright years.
2013-02-07Make assuan_transact more robust against inquiry errors.Werner Koch1-10/+19
* src/client.c (assuan_transact): Send an CAN after an error return from the inquiry callback.
2012-11-26Check for getpeerucred().Ben Kibbey1-5/+21
* configure.ac: check for getpeerucred() which (Open)Solaris/SunOS uses. * src/assuan-socket-server.c (accept_connection_bottom): make use of getpeerucred().
2012-11-21Support LOCAL_PEEREID (NetBSD) and getpeereid() (FreeBSD)Ben Kibbey1-0/+21
* configure.ac: check for LOCAL_PEEREID and getpeereid(). * src/assuan-socket-server.c (accept_connection_bottom): make use of LOCAL_PEEREID and getpeereid(). -- For use with assuan_get_peercred(). Note that getpeereid() does not set the PID member. LOCAL_PEEREID is checked before getpeereid() since NetBSD has both of these. SO_PEERCRED is still checked first. [Second revision] This revision adds support for LOCAL_PEEREID which NetBSD uses. Its tested against NetBSD 6.0 and may work without problems with earlier versions. FreeBSD uses getpeereid() which does not have PID support. Recent OpenBSD versions do support SO_PEERCRED and old versions have getpeereid() but also may have LOCAL_PEEREID (not sure).
2012-06-05src/assuan-handler.c: add help strings for standard commands.W. Trevor King1-16/+66
Signed-off-by: W. Trevor King <[email protected]>
2012-01-25Make new functions also visible on non-W32.Werner Koch3-36/+41
* src/system-posix.c (__assuan_read, __assuan_write, __assuan_recvmsg) (__assuan_sendmsg, __assuan_waitpid): Make functions global. * src/libassuan.vers: Add above functions. * configure.ac: Set version to 2.1.0-git.
2012-01-24Fix npth port file handle use.Marcus Brinkmann3-12/+30
* 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-12-13Fix assuan_get_pid for pipe servers.Werner Koch1-19/+24
At some point in the past we introduced a regression in that the client of a pipe server received its own pid and not the pid of the server. * src/assuan-pipe-connect.c (struct at_pipe_fork) (struct at_socketpair_fork): Add PARENT_PID. (at_pipe_fork_cb, at_socketpair_fork): Use PARENT_PID instead of getpid. (pipe_connect, socketpair_connect): Set PARENT_PID.
2011-12-13vasprintf.c: Improve test code.Werner Koch1-4/+10
* src/vasprintf.c (checkit): Set flag for a test failure. (main): Return error on any failure.
2011-12-01Generate the ChangeLog from commit logs.Werner Koch1-0/+7
* build-aux/gitlog-to-changelog: New script. Taken from gnulib. * build-aux/git-log-fix: New file. * build-aux/git-log-footer: New file. * doc/HACKING: New file. * ChangeLog: New file. * Makefile.am (EXTRA_DIST): Add new files. (gen-ChangeLog): New. (dist-hook): Run gen-ChangeLog. * autogen.sh: Install commit-msg hook for git. Rename all ChangeLog files to ChangeLog-2011.
2011-08-10Add new flag ASSUAN_FORCE_CLOSE.Werner Koch5-11/+39
2011-04-11Add option --host to libassuan-config.Werner Koch3-24/+55
Also enhanced the m4 test marcos and removed some cruft.
2011-03-30Add a version string to the binary.Werner Koch2-7/+10
2011-03-28Include sys/select.h in a test utility.Werner Koch1-1/+2
This fixes bug#1328 (libassuan: ce-server fails to compile on Darwin due to missing include).
2011-03-09Replace strcasecmp by ascii_strcasecmp variant/Werner Koch2-30/+34
2011-03-09Added assuan_socket_connect_fd() to attach an existing socket file ↵[email protected]5-34/+76
descriptor to a context.
2011-03-09Let an existing command previously registered with assuan_register_command() ↵[email protected]2-5/+21
be updated with new values. This fixes overriding the HELP command for example.
2011-02-28Simplify libassuan.versWerner Koch2-7/+7