Support hostname based SOCKS5 connection.
* 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 <wk@gnupg.org>