]> www.infradead.org Git - users/dwmw2/openconnect.git/log
users/dwmw2/openconnect.git
11 years agoSet SO_SNDBUF on DTLS socket and handle -EAGAIN on it
David Woodhouse [Thu, 3 Oct 2013 13:18:10 +0000 (06:18 -0700)]
Set SO_SNDBUF on DTLS socket and handle -EAGAIN on it

The UDP would otherwise get a huge backlog of queued packets, and VoIP
over the VPN would become unusable.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix outdated autohate files in release tarballs
David Woodhouse [Fri, 20 Sep 2013 05:41:57 +0000 (00:41 -0500)]
Fix outdated autohate files in release tarballs

Remove --copy and add --force. We'll end up with symlinks to the original
libtool/automake files which will thus remain up to date, and shouldn't
get old files in release tarballs any more.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoInclude string.h where needed
David Woodhouse [Thu, 19 Sep 2013 18:30:03 +0000 (13:30 -0500)]
Include string.h where needed

This fixes the Solaris build; reported by "Rodney".

Also clean up #includes in compat.c; there's no need for them to be
hidden within the various ifdef blocks. Leave <sys/time.h> where it was,
just in case it's problematic on some platform. The rest are already
included unconditionally in other files, so should be fine.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Thu, 19 Sep 2013 18:25:00 +0000 (13:25 -0500)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAppend vpninfo->urlpath to <group-access>
Murilo Opsfelder Araujo [Thu, 12 Sep 2013 17:53:54 +0000 (14:53 -0300)]
Append vpninfo->urlpath to <group-access>

Some ASA gateways may need the relative path specified in <group-access> XML
entry so it makes sense to verify if it exists and append it.

Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.vnet.ibm.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 5.01 v5.01
David Woodhouse [Sat, 1 Jun 2013 20:21:19 +0000 (21:21 +0100)]
Tag version 5.01

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUse GnuTLS 3.1.12 for Android build
David Woodhouse [Sat, 1 Jun 2013 20:18:51 +0000 (21:18 +0100)]
Use GnuTLS 3.1.12 for Android build

We don't need to build from git any more; there's been a release with the
Android CA support.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix cipher in AES256-SHA
David Woodhouse [Fri, 31 May 2013 21:05:42 +0000 (22:05 +0100)]
Fix cipher in AES256-SHA

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix --no-xmlpost
David Woodhouse [Fri, 31 May 2013 21:04:48 +0000 (22:04 +0100)]
Fix --no-xmlpost

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix typo in warning message
David Woodhouse [Fri, 31 May 2013 15:04:03 +0000 (16:04 +0100)]
Fix typo in warning message

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoCheck for broken OpenSSL versions at configure time
David Woodhouse [Fri, 31 May 2013 13:54:46 +0000 (14:54 +0100)]
Check for broken OpenSSL versions at configure time

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix shadow 'ret' variable declaration in parse_xml_response()
David Woodhouse [Fri, 31 May 2013 13:20:19 +0000 (14:20 +0100)]
Fix shadow 'ret' variable declaration in parse_xml_response()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd /etc/ssl/ca-bundle.pem to list of potential system CA trust files
David Woodhouse [Fri, 31 May 2013 13:18:36 +0000 (14:18 +0100)]
Add /etc/ssl/ca-bundle.pem to list of potential system CA trust files

Reported by Jörg Mayer on openSUSE 12.1

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUse gnutls_pubkey_verify_data2() only if we have gnutls_pk_to_sign()
David Woodhouse [Fri, 31 May 2013 13:12:59 +0000 (14:12 +0100)]
Use gnutls_pubkey_verify_data2() only if we have gnutls_pk_to_sign()

We need gnutls_pk_to_sign(), and gnutls_pubkey_verify_data() wasn't
deprecated until that arrived. So it's the correct thing to check for,
instead of just checking for gnutls_pubkey_verify_data2() itself.

Thanks to Jörg Mayer for reporting the build failure on openSUSE 12.1
with GnuTLS 3.0.3.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoDrop xmlpost argument to handle_auth_form()
David Woodhouse [Fri, 31 May 2013 13:06:04 +0000 (14:06 +0100)]
Drop xmlpost argument to handle_auth_form()

It's in vpninfo now anyway so doesn't need to be passed separately.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoHandle <client-cert-request> in aggregate auth mode
David Woodhouse [Fri, 31 May 2013 13:04:37 +0000 (14:04 +0100)]
Handle <client-cert-request> in aggregate auth mode

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoDrop X-Aggregate-Auth: header in fallback mode
David Woodhouse [Thu, 30 May 2013 20:17:15 +0000 (21:17 +0100)]
Drop X-Aggregate-Auth: header in fallback mode

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoEnable AES256 for GnuTLS DTLS
David Woodhouse [Thu, 30 May 2013 14:41:45 +0000 (15:41 +0100)]
Enable AES256 for GnuTLS DTLS

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd --dump-http-traffic option
David Woodhouse [Thu, 30 May 2013 14:31:58 +0000 (15:31 +0100)]
Add --dump-http-traffic option

I'm tired of manually doing this and asking people to apply a patch before
re-testing.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoBe a little more lenient about XML errors
David Woodhouse [Thu, 30 May 2013 14:27:12 +0000 (15:27 +0100)]
Be a little more lenient about XML errors

Server admins have been observed to put bare ampersands into strings,
which libxml wants to treat as entities.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoWhen falling back to non-xmlpost, revert to original URL
David Woodhouse [Thu, 30 May 2013 12:40:52 +0000 (13:40 +0100)]
When falling back to non-xmlpost, revert to original URL

If the XML POST attempt ended up being redirected, we don't want to stay
at that location when we fall back to the old method. We want to start
again from scratch.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd missing newline on error message
David Woodhouse [Thu, 30 May 2013 12:30:07 +0000 (13:30 +0100)]
Add missing newline on error message

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd --no-xmlpost option to fall back to old behaviour
David Woodhouse [Thu, 30 May 2013 11:24:37 +0000 (12:24 +0100)]
Add --no-xmlpost option to fall back to old behaviour

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImprove changelog consistency
David Woodhouse [Thu, 30 May 2013 14:36:18 +0000 (15:36 +0100)]
Improve changelog consistency

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoClose https connection when falling back to non-xmlpost mode
David Woodhouse [Fri, 24 May 2013 22:42:14 +0000 (23:42 +0100)]
Close https connection when falling back to non-xmlpost mode

Some servers will continue to respond with a redirect, even redirecting a
request back to the *same* URL that was requested, unless we close the
connection and try again.

Red Hat bug #964650.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate changelog
David Woodhouse [Wed, 22 May 2013 11:20:22 +0000 (12:20 +0100)]
Update changelog

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoOn failure to send HTTP request to an existing session, retry
David Woodhouse [Wed, 22 May 2013 11:07:02 +0000 (12:07 +0100)]
On failure to send HTTP request to an existing session, retry

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoClose HTTPS socket after various errors
David Woodhouse [Tue, 21 May 2013 07:45:50 +0000 (08:45 +0100)]
Close HTTPS socket after various errors

This avoids leaving the socket in an unknown state. We were attempting to
send a request with a stale or out-of-sync socket, and that would make
the *next* request fail too, when it should have opened a new connection
for itself.

We should also make do_https_request() notice that and actually retry for
itself when it fails to even *send* the request, if it was re-using an
already open socket. But currently it doesn't *know* if it's re-using a
socket so that'll require a little more work.

Fixes Debian bug #708928: http://bugs.debian.org/708928

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 5.00 v5.00
David Woodhouse [Wed, 15 May 2013 20:14:32 +0000 (21:14 +0100)]
Tag version 5.00

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Wed, 15 May 2013 20:12:08 +0000 (21:12 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Thu, 9 May 2013 14:29:39 +0000 (15:29 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoImport translations from GNOME
David Woodhouse [Mon, 25 Mar 2013 20:44:42 +0000 (20:44 +0000)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoandroid: Run autogen.sh if configure script is missing
Kevin Cernekee [Mon, 25 Mar 2013 01:14:06 +0000 (18:14 -0700)]
android: Run autogen.sh if configure script is missing

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoandroid: Add the correct toolchain directory to $PATH
Kevin Cernekee [Mon, 25 Mar 2013 01:14:05 +0000 (18:14 -0700)]
android: Add the correct toolchain directory to $PATH

On the 64-bit NDK, the toolchain binaries live under:

toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin

So hardcoding prebuilt/linux-x86/bin would cause build failures.

This probably affects the OSX NDK as well, but I didn't check whether my
fix works for that case.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoandroid: Override vpnc-script check in "configure"
Kevin Cernekee [Mon, 25 Mar 2013 01:14:04 +0000 (18:14 -0700)]
android: Override vpnc-script check in "configure"

If we're cross compiling for some other target, we don't particularly care
whether the build host has a valid vpnc-script installed locally.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoandroid: Hack around GnuTLS build breakage
Kevin Cernekee [Mon, 25 Mar 2013 01:14:03 +0000 (18:14 -0700)]
android: Hack around GnuTLS build breakage

GnuTLS wants to build e.g. src/tests.c and src/common.c into
gnutls-cli-debug, but these files do not compile unless DHE and ECDHE
are enabled.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoandroid: Remove dependency on files outside the openconnect repo
Kevin Cernekee [Mon, 25 Mar 2013 01:14:02 +0000 (18:14 -0700)]
android: Remove dependency on files outside the openconnect repo

The Android build tries to run "git clone --reference ../../../gnutls".
This only works if the user happens to have another copy of the gnutls
repo in the right place.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUpdate comments to reflect library API changes
Kevin Cernekee [Mon, 25 Mar 2013 01:14:01 +0000 (18:14 -0700)]
Update comments to reflect library API changes

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoRemove references to Android.mk
Kevin Cernekee [Mon, 25 Mar 2013 01:14:00 +0000 (18:14 -0700)]
Remove references to Android.mk

Android.mk no longer exists; the dangling references break "make dist".

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUpdate man page and changelog to reflect --token-* changes
Kevin Cernekee [Mon, 25 Mar 2013 01:13:59 +0000 (18:13 -0700)]
Update man page and changelog to reflect --token-* changes

Also, tweak the man page syntax so it is more consistent with how other
options are documented.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix token-related command line options
Kevin Cernekee [Mon, 25 Mar 2013 01:13:58 +0000 (18:13 -0700)]
Fix token-related command line options

Aliasing --stoken to --token-secret is not effective because token_mode
does not get set.  Might as well just drop --stoken.

For --token-mode, change "stoken" to "rsa" to make the UI more intuitive:
liboath provides TOTP token support, and libstoken provides RSA token
support.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoGet rid of LIBSTOKEN_HDR and LIBOATH_HDR
Kevin Cernekee [Mon, 25 Mar 2013 01:13:57 +0000 (18:13 -0700)]
Get rid of LIBSTOKEN_HDR and LIBOATH_HDR

Unlike libproxy, these two libraries have well-defined names for their
respective header files.  So include the headers by name, and use
HAVE_LIBSTOKEN / HAVE_LIBOATH for compile-time tests.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoTweak liboath ./configure help text for consistency
Kevin Cernekee [Mon, 25 Mar 2013 01:13:56 +0000 (18:13 -0700)]
Tweak liboath ./configure help text for consistency

Was:

  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR
                        (or the compiler's sysroot if not specified).
  --without-libproxy      Build without libproxy library [default=auto]
  --without-stoken        Build without libstoken library [default=auto]
  --without-liboath       Build without liboath library (default: test)

Now:

  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR
                        (or the compiler's sysroot if not specified).
  --without-libproxy      Build without libproxy library [default=auto]
  --without-stoken        Build without libstoken library [default=auto]
  --without-liboath       Build without liboath library [default=auto]

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoSort getopt_long optstring
Antonio Borneo [Sun, 24 Mar 2013 13:00:55 +0000 (21:00 +0800)]
Sort getopt_long optstring

Alphabetic order, uppercase first.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAdd "-m" to getopt_long() parser
Antonio Borneo [Sun, 24 Mar 2013 13:00:54 +0000 (21:00 +0800)]
Add "-m" to getopt_long() parser

Code exists to handle command line flag "-m" / "--mtu",
but "-m" flag doesn't work.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAdd TOTP (RFC6238) one-time password support
John Morrissey [Tue, 19 Mar 2013 03:53:09 +0000 (23:53 -0400)]
Add TOTP (RFC6238) one-time password support

Signed-off-by: John Morrissey <jwm@horde.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoImport translations from GNOME
David Woodhouse [Thu, 21 Mar 2013 12:33:17 +0000 (12:33 +0000)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAdd --without-libproxy and --without-stoken options to configure
Kevin Cernekee [Sat, 16 Mar 2013 16:49:02 +0000 (09:49 -0700)]
Add --without-libproxy and --without-stoken options to configure

"Automagic dependencies" can cause trouble for source-based distributions
like Gentoo [1], so we will provide a way to disable them.

As written, this does not honor --with-libproxy or --with-stoken.

[1] http://www.gentoo.org/proj/en/qa/automagic.xml

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
12 years agoImport translations from GNOME
David Woodhouse [Sat, 16 Mar 2013 15:21:55 +0000 (15:21 +0000)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoImport translations from GNOME
David Woodhouse [Thu, 14 Mar 2013 22:07:28 +0000 (22:07 +0000)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoDisable more GnuTLS bits
David Woodhouse [Wed, 13 Mar 2013 22:57:13 +0000 (22:57 +0000)]
Disable more GnuTLS bits

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix GMP configure rule for Android build
David Woodhouse [Wed, 13 Mar 2013 00:33:25 +0000 (00:33 +0000)]
Fix GMP configure rule for Android build

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoImport translations from GNOME
David Woodhouse [Wed, 13 Mar 2013 00:01:12 +0000 (00:01 +0000)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoCheck for __ANDROID__ not ANDROID
David Woodhouse [Mon, 11 Mar 2013 14:08:11 +0000 (14:08 +0000)]
Check for __ANDROID__ not ANDROID

The latter doesn't appear to be set by the NDK.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoEnable shared libopenconnect for Android build
David Woodhouse [Mon, 11 Mar 2013 14:02:01 +0000 (14:02 +0000)]
Enable shared libopenconnect for Android build

We'll definitely want to use it from Java code for the authentication stage.
Not entirely sure yet how we'll invoke the main loop — perhaps by executing
the openconnect executable, but we *could* also invoke the main loop directly
from a Java process too. That might simplify the issue of protecting the
network sockets.

This ends up pulling libxml into libopenconnect.so, so the openconnect
executable gets it from there. Which isn't an ideal setup for the general
case but it's fairly convenient on Android.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix Android builds for x86 and mips
David Woodhouse [Mon, 11 Mar 2013 14:01:45 +0000 (14:01 +0000)]
Fix Android builds for x86 and mips

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoClean up CSD invocation for XML POST
David Woodhouse [Sun, 10 Mar 2013 21:01:53 +0000 (21:01 +0000)]
Clean up CSD invocation for XML POST

We don't use a CSD trojan to download; we *require* a local wrapper.

Theoretically we ought to be able to invoke a 'real' Cisco hostscan
tool. We ought to fix the command line arguments for that but let's keep
it simple for now. Just keep the command line exactly the same as for
wrapping the trojan, with an empty string where the name of the
downloaded file would be.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix redirect to CSD stub URL
David Woodhouse [Sun, 10 Mar 2013 21:01:18 +0000 (21:01 +0000)]
Fix redirect to CSD stub URL

I reverted too much.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoCSD stub URL is optional
David Woodhouse [Sun, 10 Mar 2013 19:00:04 +0000 (19:00 +0000)]
CSD stub URL is optional

The recent change in commit b6ef1c86b6d29684e5a24b62e19827afafec13ed ('Fix
CSD trojan download') was wrong; for the XML POST case we don't necessarily
get handed a trojan to download. We're expected to have a local 'wrapper'
script which will act like a locally-installed 'hostscan'.

The wait URL *is* required though.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix check for CSD
David Woodhouse [Sun, 10 Mar 2013 11:57:03 +0000 (11:57 +0000)]
Fix check for CSD

Antonio Borneo pointed out that we were checking (A && B && B). The third
one should have been vpninfo->csd_stuburl, not vpninfo->csd_waiturl again.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agogitignore: add cscope.*
Antonio Borneo [Sun, 10 Mar 2013 11:06:16 +0000 (19:06 +0800)]
gitignore: add cscope.*

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agogitignore: add files from "make"
Antonio Borneo [Sun, 10 Mar 2013 11:06:15 +0000 (19:06 +0800)]
gitignore: add files from "make"

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agogitignore: add files from ./configure
Antonio Borneo [Sun, 10 Mar 2013 11:06:14 +0000 (19:06 +0800)]
gitignore: add files from ./configure

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agogitignore: add autogen's files
Antonio Borneo [Sun, 10 Mar 2013 11:06:13 +0000 (19:06 +0800)]
gitignore: add autogen's files

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUniform coding style: don't use C99 // comments
Antonio Borneo [Sun, 10 Mar 2013 11:06:10 +0000 (19:06 +0800)]
Uniform coding style: don't use C99 // comments

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUniform coding style: no {} for single statement
Antonio Borneo [Sun, 10 Mar 2013 11:06:09 +0000 (19:06 +0800)]
Uniform coding style: no {} for single statement

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUniform coding style: conditional statement
Antonio Borneo [Sun, 10 Mar 2013 11:06:08 +0000 (19:06 +0800)]
Uniform coding style: conditional statement

Put single conditional statement in next line, not
with "if" or "else".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUniform coding style: space and tabs
Antonio Borneo [Sun, 10 Mar 2013 11:06:07 +0000 (19:06 +0800)]
Uniform coding style: space and tabs

This patch just play with space and tabs, so
git diff -w
does not report anything.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUniform coding style: #if defined()
Antonio Borneo [Sun, 10 Mar 2013 11:06:06 +0000 (19:06 +0800)]
Uniform coding style: #if defined()

Current code mixes "defined()" and "defined ()"
Use Linux kernel choice so I can reuse kernel checkpatch.
sed -i 's/defined (/defined(/g'

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoImport translations from GNOME
David Woodhouse [Sat, 9 Mar 2013 22:45:56 +0000 (22:45 +0000)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoDon't emit the login banner and/or message when -q is used
John Morrissey [Sat, 9 Mar 2013 22:00:15 +0000 (17:00 -0500)]
Don't emit the login banner and/or message when -q is used

Signed-off-by: John Morrissey <jwm@horde.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoReduce GnuTLS library size for Android build
David Woodhouse [Fri, 8 Mar 2013 23:49:33 +0000 (23:49 +0000)]
Reduce GnuTLS library size for Android build

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAdd missing newlines
David Woodhouse [Thu, 7 Mar 2013 17:38:09 +0000 (17:38 +0000)]
Add missing newlines

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix CSD trojan download
David Woodhouse [Thu, 7 Mar 2013 17:30:00 +0000 (17:30 +0000)]
Fix CSD trojan download

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAndroid: Build GnuTLS from git
David Woodhouse [Wed, 6 Mar 2013 21:48:21 +0000 (21:48 +0000)]
Android: Build GnuTLS from git

This is fairly icky; I don't know how we're supposed to get the pkgconfig
Libs.private in our build, so I'm overriding $(GNUTLS_LIBS) manually.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoStop using deprecated gnutls_x509_crt type
David Woodhouse [Wed, 6 Mar 2013 21:37:40 +0000 (21:37 +0000)]
Stop using deprecated gnutls_x509_crt type

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAvoid warning about verify_signed_data being unused
David Woodhouse [Wed, 6 Mar 2013 21:34:55 +0000 (21:34 +0000)]
Avoid warning about verify_signed_data being unused

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUse GNUTLS_CFLAGS when testing GnuTLS features too
David Woodhouse [Wed, 6 Mar 2013 21:13:33 +0000 (21:13 +0000)]
Use GNUTLS_CFLAGS when testing GnuTLS features too

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAttempt to build GnuTLS for Android
David Woodhouse [Wed, 6 Mar 2013 17:58:10 +0000 (17:58 +0000)]
Attempt to build GnuTLS for Android

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoRevamp Android build infrastructure
David Woodhouse [Wed, 6 Mar 2013 11:12:44 +0000 (11:12 +0000)]
Revamp Android build infrastructure

The existing setup would only build as part of a full AOSP build, not as
a standalone application with the NDK. Fix that...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoRemove unused variable 'ofs' in Android keystore_fetch()
David Woodhouse [Wed, 6 Mar 2013 11:12:01 +0000 (11:12 +0000)]
Remove unused variable 'ofs' in Android keystore_fetch()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoMake it easier to avoid the broken OpenSSL DTLS check
David Woodhouse [Wed, 6 Mar 2013 10:08:27 +0000 (10:08 +0000)]
Make it easier to avoid the broken OpenSSL DTLS check

Now you just have to define NO_BROKEN_DTLS_CHECK instead of editing the
source code to remove the check.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUse OPENSSL_CFLAGS when testing OpenSSL features too
David Woodhouse [Wed, 6 Mar 2013 10:05:22 +0000 (10:05 +0000)]
Use OPENSSL_CFLAGS when testing OpenSSL features too

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUpdate translations from GNOME
David Woodhouse [Mon, 4 Mar 2013 21:03:40 +0000 (21:03 +0000)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agohttp: Don't leak the webvpn cookie in XML POST mode
Kevin Cernekee [Mon, 4 Mar 2013 02:20:51 +0000 (18:20 -0800)]
http: Don't leak the webvpn cookie in XML POST mode

XML POST mode introduces a new header in the <auth> response.  Squash it
so that people don't inadvertently post logs containing webvpn cookies.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoDestroy vpninfo->https_cred on failing to create it
David Woodhouse [Mon, 4 Mar 2013 00:45:21 +0000 (00:45 +0000)]
Destroy vpninfo->https_cred on failing to create it

If something like certificate setup went wrong, we'd return failure but
*not* destroy the gnutls_certificate_credentials_t that we were
attempting to set up. So a subsequent retry would see that it already
exists, assume it's *fine* and just go ahead and use it. Don't do that.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoHandle redirects in attempting simple auth GET too
David Woodhouse [Mon, 4 Mar 2013 00:28:08 +0000 (00:28 +0000)]
Handle redirects in attempting simple auth GET too

If the XML POST fails and we try a GET, we need to handle redirects for
that too. So re-use the same loop. Except the bit about not allowing local
redirects. Why do we do that for the XML POST case anyway?

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoDon't attempt to parse empty response from server
David Woodhouse [Mon, 4 Mar 2013 00:25:03 +0000 (00:25 +0000)]
Don't attempt to parse empty response from server

I couldn't trigger this until I hacked up stuff elsewhere to return
artificial failures, but still...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix Android build with NDK
David Woodhouse [Sun, 3 Mar 2013 01:28:07 +0000 (01:28 +0000)]
Fix Android build with NDK

The NDK doesn't include keystore.h but that only has a few error numbers
so we can define those locally.

We also can't call socket_local_client() but that's only a simple socket()
and connect() call on a Unix socket anyway.

Also make keystore_strerror() return a const char *.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoCheck for __android_log_vprint in liblog.
Nikos Mavrogiannopoulos [Fri, 1 Mar 2013 23:14:19 +0000 (00:14 +0100)]
Check for __android_log_vprint in liblog.

Normally we'd use Android.mk but you can also build for Android using
Cerbero and the autohate build system instead.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUpdate translations from GNOME
David Woodhouse [Mon, 25 Feb 2013 11:56:03 +0000 (11:56 +0000)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix hostname canonicalisation to stop breaking certifcate checks
David Woodhouse [Fri, 22 Feb 2013 12:42:07 +0000 (12:42 +0000)]
Fix hostname canonicalisation to stop breaking certifcate checks

Commit b0b4b34f ('Canonicalise hostname during authentication if necessary')
replaces the hostname with a bare IP address if necessary, so that
reconnecting is guaranteed to get the *same* host from a round-robin and
comparing the SSL cert with its previous SHA1 fingerprint (which is how we
do it for two-stage connection for example from NetworkManager) is
guaranteed to work.

However, this breaks certificate auth when invoked in one-stage mode from
the command line to authenticate *and* actually make the connection. When
vpninfo->hostname is replaced with a bare IP address, that might not
actually be what's listed in the certificate's Subject or Altname fields.
So users have reported a certificate validation failure on *reconnecting*
to the server which was acceptable the first time round when we looked it
up by name.

So, don't actually replace vpninfo->hostname at all. Introduce a new field
vpninfo->unique_hostname which is returned by openconnect_get_hostname(),
and leave vpninfo->hostname as it was.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoLink directly to Nikos' server web site
David Woodhouse [Wed, 20 Feb 2013 19:33:00 +0000 (19:33 +0000)]
Link directly to Nikos' server web site

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUpdate changelog
David Woodhouse [Mon, 18 Feb 2013 01:07:41 +0000 (01:07 +0000)]
Update changelog

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix abuse of gnutls_realloc() causing memory leaks
David Woodhouse [Mon, 18 Feb 2013 01:04:44 +0000 (01:04 +0000)]
Fix abuse of gnutls_realloc() causing memory leaks

We need to free the original pointer, if gnutls_realloc() returns NULL.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix abuse of realloc() causing memory leaks
David Woodhouse [Mon, 18 Feb 2013 00:31:57 +0000 (00:31 +0000)]
Fix abuse of realloc() causing memory leaks

Implement a helper which actually *does* free the original pointer on
allocation failure, as I evidently always expected it to.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700805

Reported by: Niels Thykier <niels@thykier.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix GnuTLS 2.x build failure
David Woodhouse [Sun, 17 Feb 2013 22:18:01 +0000 (22:18 +0000)]
Fix GnuTLS 2.x build failure

We can move the algo calculation into a verify_signed_data() function. This
would have been a cleaner way to do it in the first place anyway.

Reported-by: Mike Miller <mtmiller@ieee.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoauth: stoken: Fix handling of "Next TOKENCODE" prompt
Kevin Cernekee [Sun, 17 Feb 2013 00:18:07 +0000 (16:18 -0800)]
auth: stoken: Fix handling of "Next TOKENCODE" prompt

This needs to allow for input elements named "answer" instead of
"password", and it needs to check form->message instead of the label
attribute for the "Next TOKENCODE" prompt.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agohttp: Fix redirect handling in auth form loop
Kevin Cernekee [Sun, 17 Feb 2013 00:18:06 +0000 (16:18 -0800)]
http: Fix redirect handling in auth form loop

The gateway may ask the user to fill out different forms that live at
different URLs, e.g.

    GET /+webvpn+/index.html
    (returns <form method="post" action="/+webvpn+/index.html"> and
     username/password form elements)
    POST /+webvpn+/index.html
    (returns <form method="post" action="/+webvpn+/login/challenge.html">
     and challenge/response form elements)
    POST /+webvpn+/login/challenge.html
    (returns <auth> node with valid cookie)

The refactored openconnect_obtain_cookie() loop tried to post the
challenge/response data to index.html, preventing successful login.  This
patch changes the logic so that it will honor the new "action" attribute
if present.

This probably does not affect XML POST mode, because XML POST <form> tags
do not seem to use attributes.

Reported-by: Fabian Jäger <fabian.jaeger@chungwasoft.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoauth: Implement special handling of password fields on XML POST
Kevin Cernekee [Sun, 17 Feb 2013 00:18:05 +0000 (16:18 -0800)]
auth: Implement special handling of password fields on XML POST

The Cisco AnyConnect client exhibits some quirky behavior on fields
with certain names:

For "answer", "whichpin", and "new_password", the field is renamed to
"password" in the submission.

For "verify_pin" and "verify_password", the field is omitted entirely.
One might expect the client to perform a comparison to see if the first
password/PIN field matches the verify_* field, but in my testing, I didn't
actually see it doing so.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>