Fix crash on invocation with --token-mode but no --token-secret

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Fix incorrect return value of inet_aton() shim

inet_aton() returns nonzero if the address is valid, zero if not.

This bug caused INTERNAL_IP4_NETMASK not getting set and all split
routes was considered invalid under Windows.

Signed-off-by: Joe Hu <i@sapika.ch>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
GNUism in www/Makefile

To quote my make(1), "Using $< in a non-suffix rule context is a
GNUmake idiom" - this lets OpenConnect build with standard BSD make
again.

I don't have a checkout handy so apologies for the non-git diff,
I thought it was simple enough this wouldn't be a big problem :)

Signed-off-by: Stuart Henderson <sthen@openbsd.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Slightly optimise Proxy-Authenticate: header parsing

Bail out once we found a match; don't keep going.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Improve reporting when GSSAPI auth requested but not compiled in

If distributions build without GSSAPI support and people would have needed
it, let them have a clear indication that they *could* have had it, so
they don't just assume it wasn't supported.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Fix off-by-one in xmlnode_msg() handling of error messages

There was an off-by-one which meant instead of just replacing the '%s' when
inserting a parameter, it would also replace the character *after* it in
the format string.

This bug was introduced in v3.13 by commit d126095d ("Refactor
xmlnode_msg() not to use server-provided string as asprintf() format.")

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Solaris 10 *still* doesn't have 'grep -q'

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

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Avoid retrying without XML POST when we didn't even manage to connect

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Fix openconnect_base64_decode() to return the buffer

Taking a (void **) in which to return the buffer causes complaints about
type-punning pointers in some call sites. Swap the arguments round to return
the buffer instead, and take an (int *) pointer into which we can place the
length (or error) that was previously the return value.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cosmetic fix in cleanup_ntlm_auth()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Honour Proxy-Connection: close during authentication

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Fix potential memory leak on GSSAPI failure

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Improve GSSAPI error reporting

We should loop individually for the generic and mechanism error codes, not
have one loop for both. And we should ideally pass the mechanism OID in,
where it's known. So do that too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Don't force a reconnect if GSSAPI fails without trying

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Use RegQueryValueEx() instead of RegGetValue() to support 32-bit Windows XP

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Resync translations with sources

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Sort openconnect.pot by file to avoid spurious changes

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