Use BIO_CLOSE when importing PEM private key with OpenSSL

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Stop using obsolete vpninfo->cert_type in GnuTLS code

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Stop using obsolete vpninfo->cert_type in OpenSSL code

This wants cleaning up a little but that can come in separate commits.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Remove cert_type field from struct openconnect_info

We stopped actually using this a long time ago (4.00, June 2012).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Clean up OpenSSL key loading

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Merge branch 'hotp-java-v1' of git://github.com/cernekee/openconnect
Fix DeviceIoControl() calls to make NDIS6 TAP-Windows driver happy

All calls appear to need both input and output buffers.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Use inet_pton() to provide inet_aton() functionality

This is cleaner and simpler than the original compat code, and avoids
the strange issues that Nikos was reporting on his Windows 7
installation with inet_addr() not working correctly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Check to avoid calling iconv_close(-1) in openconnect_vpninfo_free

Signed-off-by: Chad Catlett <chad@catlett.info>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
use windows types and return codes for socket errors

That is, use SOCKET instead of int for cmd_pipe, and return INVALID
socket for cmd_pipe.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
use recv() and closesocket() on the cmd_fd on windows

[dwmw2: Reduce #ifdefs by using recv() everywhere, not just on Windows]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
use CreateProcess instead of system to run scripts.

That prevents the pop up of terminal windows.

[dwmw2: Use -ETIMEDOUT instead of -ETIME which doesn't seem to be present in
        my Fedora 20 MinGW setup. Do not prepend 'cscript' to vpnc_script
        string now that we invoke it that way unconditionally.]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
define _GNU_SOURCE to get asprintf's definition in mingw32

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Stop internal_parse_url() mangling its input

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Stop openconnect_set_proxy_auth() mangling its input.

Even though it immediately frees it. We're going to change that...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
mention openconnect-gui

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Remove _BSD_SOURCE for Linux builds

It was apparently only there for strcasecmp(), and we include strings.h
so should get that without a macro anyway. Since glibc 2.20 we now get
warnings tha _BSD_SOURCE is deprecated.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
do not take ownership of any of the provided strings

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Bump library soname and add 'const' to lots of char * arguments

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>