platform/upstream/openconnect.git
11 years agoTag version 4.07 v4.07
David Woodhouse [Fri, 31 Aug 2012 12:29:57 +0000 (13:29 +0100)]
Tag version 4.07

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate changelog
David Woodhouse [Fri, 31 Aug 2012 12:25:06 +0000 (13:25 +0100)]
Update changelog

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd missing : to getopt string for -p which takes a parameter.
Stuart Henderson [Thu, 30 Aug 2012 13:15:05 +0000 (14:15 +0100)]
Add missing : to getopt string for -p which takes a parameter.

Print an error rather than trying to strdup(NULL) if the parameter
is not specified.

Signed-off-by: Stuart Henderson <sthen@openbsd.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Mon, 20 Aug 2012 10:37:52 +0000 (11:37 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate translations from Transifex
David Woodhouse [Mon, 20 Aug 2012 10:14:23 +0000 (11:14 +0100)]
Update translations from Transifex

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoHandle CSTP rekey when stalled
David Woodhouse [Fri, 3 Aug 2012 22:26:52 +0000 (23:26 +0100)]
Handle CSTP rekey when stalled

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix CSTP write stall handling
David Woodhouse [Fri, 3 Aug 2012 09:11:54 +0000 (10:11 +0100)]
Fix CSTP write stall handling

We were handling the -EAGAIN case as a hard error and tearing down the
connection. Instead, we should just wait for the socket to become writeable.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Thu, 2 Aug 2012 21:08:12 +0000 (22:08 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.06 v4.06
David Woodhouse [Mon, 23 Jul 2012 13:14:06 +0000 (14:14 +0100)]
Tag version 4.06

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoCheck for system CA certificate file for GnuTLS
Mike Miller [Thu, 19 Jul 2012 05:10:42 +0000 (01:10 -0400)]
Check for system CA certificate file for GnuTLS

Look in certain well-known system paths for the default file to give to
gnutls_certificate_set_x509_trust_file() if required.  Auto-detection is
inspired by the GnuTLS configure script.

Signed-off-by: Mike Miller <mtmiller@ieee.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix strict-aliasing warning with DTLS local port handling
David Woodhouse [Mon, 16 Jul 2012 20:20:45 +0000 (21:20 +0100)]
Fix strict-aliasing warning with DTLS local port handling

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImprove error reporting for vpnc-script
David Woodhouse [Mon, 16 Jul 2012 19:19:44 +0000 (20:19 +0100)]
Improve error reporting for vpnc-script

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoHandle PKCS#11 tokens which don't list keys before login
David Woodhouse [Sun, 15 Jul 2012 19:25:44 +0000 (20:25 +0100)]
Handle PKCS#11 tokens which don't list keys before login

If the user passed only one URL for both key+cert, and the cert was found,
then at least *try* looking for the key in the same token before giving up.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.05 v4.05
David Woodhouse [Thu, 12 Jul 2012 13:57:01 +0000 (14:57 +0100)]
Tag version 4.05

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUse correct XML tag for CSD script on Mac
David Woodhouse [Thu, 12 Jul 2012 12:12:50 +0000 (13:12 +0100)]
Use correct XML tag for CSD script on Mac

Other operating systems still get the Linux version, and will need a
wrapper or something to make it cope.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRemove CSD script when done with it
David Woodhouse [Thu, 12 Jul 2012 12:05:33 +0000 (13:05 +0100)]
Remove CSD script when done with it

We still don't remove it if the user hits Ctrl-C when we're logging in.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoOnly setuid() for CSD if a user was specified.
David Woodhouse [Thu, 12 Jul 2012 11:56:54 +0000 (12:56 +0100)]
Only setuid() for CSD if a user was specified.

Otherwise it'll be setuid(0) which will (mostly) be a no-op for root, or
fail for non-root users.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRemove -vpnclient arg from CSD invocation
David Woodhouse [Thu, 12 Jul 2012 11:53:33 +0000 (12:53 +0100)]
Remove -vpnclient arg from CSD invocation

It never made any sense, and doesn't seem to be necessary.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Wed, 11 Jul 2012 21:42:29 +0000 (22:42 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRemove obsolete --key-type option from usage help text
David Woodhouse [Wed, 11 Jul 2012 21:40:17 +0000 (22:40 +0100)]
Remove obsolete --key-type option from usage help text

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix endless loop when multiple PKCS#11 tokens need PINs
David Woodhouse [Wed, 11 Jul 2012 17:13:34 +0000 (18:13 +0100)]
Fix endless loop when multiple PKCS#11 tokens need PINs

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUse P11_KIT_URI_FOR_ANY to preserve all attributes in PKCS#11 URIs
David Woodhouse [Wed, 11 Jul 2012 16:58:32 +0000 (17:58 +0100)]
Use P11_KIT_URI_FOR_ANY to preserve all attributes in PKCS#11 URIs

Otherwise we were losing the attributes which specified a token... which is
a pain when the token doesn't list private keys until you're logged in. In
that case you do *have* to specify the token otherwise the object will never
be found.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoDon't forget key password on reconnect / change hosts in GUI.
David Woodhouse [Tue, 10 Jul 2012 14:30:26 +0000 (15:30 +0100)]
Don't forget key password on reconnect / change hosts in GUI.

As part of the password handling cleanup, we were clearing the stored
->cert_password after using it. This means we have to retain the https_ctx
or https_cred structure for the whole lifetime of the vpninfo, even across
reconnects. Fix openconnect_reset_ssl() accordingly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agomainloop.c - malloc without a prototype
Stuart Henderson [Sun, 8 Jul 2012 15:23:05 +0000 (17:23 +0200)]
mainloop.c - malloc without a prototype

I noticed a little problem building OpenConnect against gnutls 3;
mainloop.c uses malloc() in queue_new_packet(), somewhere in the chain
of openssl headers stdlib.h gets pulled in so it works ok there, but
this isn't the case with a gnutls build.

Signed-off-by: Stuart Henderson <sthen@openbsd.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate translations from Transifex
David Woodhouse [Sun, 8 Jul 2012 19:42:07 +0000 (20:42 +0100)]
Update translations from Transifex

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix 'make update-translations' not to remove file headers
David Woodhouse [Sun, 8 Jul 2012 19:38:34 +0000 (20:38 +0100)]
Fix 'make update-translations' not to remove file headers

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.04 v4.04
David Woodhouse [Thu, 5 Jul 2012 10:14:27 +0000 (11:14 +0100)]
Tag version 4.04

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoStrip out full header when comparing po files
David Woodhouse [Thu, 5 Jul 2012 10:03:37 +0000 (11:03 +0100)]
Strip out full header when comparing po files

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix spelling error in --pid-file help text
David Woodhouse [Thu, 5 Jul 2012 08:50:09 +0000 (09:50 +0100)]
Fix spelling error in --pid-file help text

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Thu, 5 Jul 2012 08:40:36 +0000 (09:40 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix GnuTLS password handling for PKCS#8 files
David Woodhouse [Mon, 2 Jul 2012 23:41:38 +0000 (00:41 +0100)]
Fix GnuTLS password handling for PKCS#8 files

When we have no preconfigured password for a PKCS#8 file, we were getting
the wrong error and were aborting instead of asking for a password.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.03 v4.03
David Woodhouse [Mon, 2 Jul 2012 10:25:55 +0000 (11:25 +0100)]
Tag version 4.03

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix --no-proxy option
Tiago Vignatti [Sun, 1 Jul 2012 23:03:23 +0000 (02:03 +0300)]
Fix --no-proxy option

A missing break in the case statement meant that --no-proxy would not disable
the proxy at all; it would actually have the same effect as --libproxy.

This bug has been present since the --no-proxy option was first added in
v2.20 (commit 9c6d3f1b). Although it was falling through to the --script
option then.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate changelog
David Woodhouse [Sun, 1 Jul 2012 21:23:01 +0000 (22:23 +0100)]
Update changelog

It looks like the problematic server wasn't really objecting to SSLv3; it
was the lack of 3DES cipher. It wouldn't accept AES which was the only
thing that GnuTLS was offering.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSeparate requested from received MTU settings
David Woodhouse [Sat, 30 Jun 2012 00:41:59 +0000 (01:41 +0100)]
Separate requested from received MTU settings

This fixes a bug where an MTU requested with the --mtu option will actually
be set as the interface MTU even if the server replies with a smaller value.

It also fixes reconnect behaviour, by not treating the MTU response from
the server on the original connection into an override for the reconnect.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix GnuTLS DTLS MTU for GnuTLS 3.0.21 and above
David Woodhouse [Fri, 29 Jun 2012 23:55:06 +0000 (00:55 +0100)]
Fix GnuTLS DTLS MTU for GnuTLS 3.0.21 and above

The fix in 4.01 (commit c218e2ac) was relying on buggy behaviour of
GnuTLS. It shouldn't have been sufficient just to pass it the *data* MTU
plus 13 and rely on the fact that GnuTLS will happily send packets
larger than that. In fixing GnuTLS MTU handling and adding the new
gnutls_dtls_set_data_mtu() function in 3.0.21, I have broken my own
code. And it serves me right.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdvertise TLS1.0 not SSL3.0 in GnuTLS ClientHello
David Woodhouse [Fri, 29 Jun 2012 20:17:47 +0000 (21:17 +0100)]
Advertise TLS1.0 not SSL3.0 in GnuTLS ClientHello

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRemove hard-coded table of ciphers for PEM decryption
David Woodhouse [Fri, 29 Jun 2012 11:52:41 +0000 (12:52 +0100)]
Remove hard-coded table of ciphers for PEM decryption

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImprove cipher coverage of OpenSSL encrypted PEM support for GnuTLS
David Woodhouse [Thu, 28 Jun 2012 23:58:34 +0000 (00:58 +0100)]
Improve cipher coverage of OpenSSL encrypted PEM support for GnuTLS

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.02 v4.02
David Woodhouse [Thu, 28 Jun 2012 14:52:51 +0000 (15:52 +0100)]
Tag version 4.02

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix build failure on systems without GnuTLS v3
David Woodhouse [Thu, 28 Jun 2012 13:04:36 +0000 (14:04 +0100)]
Fix build failure on systems without GnuTLS v3

Oops. Including header files which are only available in GnuTLS v3 is
probably not cunning, if we're building with OpenSSL or with GnuTLS v2.

Pointed out by Stuart Henderson (thanks).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.01 v4.01
David Woodhouse [Thu, 28 Jun 2012 11:46:40 +0000 (12:46 +0100)]
Tag version 4.01

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix DTLS MTU for GnuTLS
David Woodhouse [Wed, 27 Jun 2012 22:20:40 +0000 (23:20 +0100)]
Fix DTLS MTU for GnuTLS

GnuTLS defaults to an MTU of 1200 (less the 13-byte overhead), and will
truncate data packets accordingly. We *really* don't want that...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix SEGV on cstp_reconnect() without deflate
David Woodhouse [Wed, 27 Jun 2012 18:58:55 +0000 (19:58 +0100)]
Fix SEGV on cstp_reconnect() without deflate

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoClean up Transifex import some more
David Woodhouse [Tue, 26 Jun 2012 14:41:16 +0000 (15:41 +0100)]
Clean up Transifex import some more

Don't let local msgmerge use fuzzy translations either, don't care about
Translation-Team: changing, and use 'diff' so we actually see the changes
(since more often than not they're false positives, so it eases debugging).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix build on systems without O_CLOEXEC
David Woodhouse [Mon, 25 Jun 2012 20:13:35 +0000 (22:13 +0200)]
Fix build on systems without O_CLOEXEC

Reported by Ryan Steinmetz <zi@freebsd.org>

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd source port option for DTLS
Steven Ihde [Sun, 24 Jun 2012 03:49:32 +0000 (20:49 -0700)]
Add source port option for DTLS

Signed-off-by: Steven Ihde <sihde@hamachi.us>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate translations from Transifex
David Woodhouse [Sat, 23 Jun 2012 16:15:07 +0000 (18:15 +0200)]
Update translations from Transifex

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTransifex import: Reduce churn, and don't forget to add new translations
David Woodhouse [Sat, 23 Jun 2012 15:20:42 +0000 (17:20 +0200)]
Transifex import: Reduce churn, and don't forget to add new translations

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport translations from GNOME
David Woodhouse [Fri, 22 Jun 2012 14:17:40 +0000 (15:17 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRebuild openconnect.8 if necessary before openconnect.8.inc
David Woodhouse [Fri, 22 Jun 2012 09:56:37 +0000 (10:56 +0100)]
Rebuild openconnect.8 if necessary before openconnect.8.inc

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoPrint correct error when /dev/net/tun open fails
David Woodhouse [Fri, 22 Jun 2012 09:03:01 +0000 (10:03 +0100)]
Print correct error when /dev/net/tun open fails

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoDon't require zlib in pkgconfig if it was found without it
David Woodhouse [Thu, 21 Jun 2012 16:04:23 +0000 (17:04 +0100)]
Don't require zlib in pkgconfig if it was found without it

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 4.00 v4.00
David Woodhouse [Wed, 20 Jun 2012 17:01:21 +0000 (18:01 +0100)]
Tag version 4.00

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate translations from Transifex
David Woodhouse [Wed, 20 Jun 2012 13:59:25 +0000 (14:59 +0100)]
Update translations from Transifex

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRun msgmerge after importing translations from Transifex
David Woodhouse [Wed, 20 Jun 2012 13:47:41 +0000 (14:47 +0100)]
Run msgmerge after importing translations from Transifex

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd translations that GNOME NetworkManager-openconnect has, that we don't
David Woodhouse [Wed, 20 Jun 2012 12:55:30 +0000 (13:55 +0100)]
Add translations that GNOME NetworkManager-openconnect has, that we don't

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix typo in error message
David Woodhouse [Wed, 20 Jun 2012 12:34:19 +0000 (13:34 +0100)]
Fix typo in error message

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSupport old-style OpenSSL encrypted PEM keys
David Woodhouse [Tue, 19 Jun 2012 16:42:22 +0000 (17:42 +0100)]
Support old-style OpenSSL encrypted PEM keys

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix memory leaks in text-mode process_form_opts
David Woodhouse [Tue, 19 Jun 2012 16:34:41 +0000 (17:34 +0100)]
Fix memory leaks in text-mode process_form_opts

The caller probably won't free the returned answers if we return error,
so do it locally.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoNUL-terminate blobs from Andoird keystore
David Woodhouse [Tue, 19 Jun 2012 12:37:38 +0000 (13:37 +0100)]
NUL-terminate blobs from Andoird keystore

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix PKCS#11 cleanup when no SSL certificate is set
David Woodhouse [Mon, 18 Jun 2012 19:06:36 +0000 (20:06 +0100)]
Fix PKCS#11 cleanup when no SSL certificate is set

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd Android keystore support for --cafile
David Woodhouse [Sun, 17 Jun 2012 22:42:53 +0000 (23:42 +0100)]
Add Android keystore support for --cafile

Based on a patch from Vilmos Nebehaj <v.nebehaj@gmail.com>

Signed-off-by: Vilmos Nebehaj <v.nebehaj@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd missing includes and libs to Android.mk
David Woodhouse [Sun, 17 Jun 2012 22:40:41 +0000 (23:40 +0100)]
Add missing includes and libs to Android.mk

I probably shouldn't need to add libc, but it shouldn't hurt either, and I
*do* need it. Otherwise I think my screwed up local build system is using
the wrong one. One day I'll actually get AOSP or Cyanogen to build properly
and I won't have to suffer with this cobbled-together pile of crap that I'm
using...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSwitch from Android's keystore_get() to our own keystore_fetch()
David Woodhouse [Sun, 17 Jun 2012 21:02:16 +0000 (22:02 +0100)]
Switch from Android's keystore_get() to our own keystore_fetch()

This gives proper error handling which Android's lacks.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix double-free of BIO in loading cert from keystore
David Woodhouse [Sun, 17 Jun 2012 20:58:02 +0000 (21:58 +0100)]
Fix double-free of BIO in loading cert from keystore

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix fake Android keystore_get() to return -1 on failure
David Woodhouse [Sun, 17 Jun 2012 01:37:42 +0000 (02:37 +0100)]
Fix fake Android keystore_get() to return -1 on failure

Harmless in this case, but it doesn't hurt to be consistent with Android.
At least, with what Android does when it's *not* buggy... :)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix Android keystore support for older keystore_get.h
David Woodhouse [Sun, 17 Jun 2012 01:33:43 +0000 (02:33 +0100)]
Fix Android keystore support for older keystore_get.h

This is an "inline" function, in the header file. So it's about the build
environment you use for building openconnect, not the runtime environment.

It was fixed by the following commit in android/frameworks/base:

commit c741a2fe41ea33fc386a4d5b932cc081aa92a18c
Author: Chia-chi Yeh <chiachi@android.com>
Date:   Thu Sep 30 15:17:58 2010 +0800

    KeyStore: Fix the return value when send() or recv() has an error.

    Change-Id: I20a63c76bd29b1a9f8959a6c4fe5a5b8a9a971b4

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd trousers to list of optional build deps
David Woodhouse [Fri, 15 Jun 2012 14:06:31 +0000 (15:06 +0100)]
Add trousers to list of optional build deps

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd gnutls.h to noinst_HEADERS
David Woodhouse [Fri, 15 Jun 2012 13:55:56 +0000 (14:55 +0100)]
Add gnutls.h to noinst_HEADERS

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRemove POTFILES.in from po/ EXTRA_DIST
David Woodhouse [Fri, 15 Jun 2012 13:49:06 +0000 (14:49 +0100)]
Remove POTFILES.in from po/ EXTRA_DIST

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAutomatically keep Android.mk in sync with source lists from Makefile.am
David Woodhouse [Fri, 15 Jun 2012 13:48:04 +0000 (14:48 +0100)]
Automatically keep Android.mk in sync with source lists from Makefile.am

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoOpenSSL: Fix recognition of repeated 'wrong passphrase' errors
David Woodhouse [Fri, 15 Jun 2012 13:26:26 +0000 (14:26 +0100)]
OpenSSL: Fix recognition of repeated 'wrong passphrase' errors

Without it, we were getting the wrong error if the passphrase was wrong
a second time, and not correctly staying in the retry loop:

Enter PEM pass phrase:
140379913099200:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:536:
Loading private key failed (wrong passphrase?)
Enter PEM pass phrase:
140379913099200:error:23077074:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 cipherfinal error:p12_decr.c:97:
Loading private key failed (see above errors)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd Android keystore support
David Woodhouse [Fri, 15 Jun 2012 13:03:03 +0000 (14:03 +0100)]
Add Android keystore support

Based on a patch from Vilmos Nebehaj <v.nebehaj@gmail.com>

Signed-off-by: Vilmos Nebehaj <v.nebehaj@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix Android build
David Woodhouse [Fri, 15 Jun 2012 12:45:13 +0000 (13:45 +0100)]
Fix Android build

Well, almost. My local NDK setup still fails to link because libicuuc.so
needs libgabi++.so, and even with that it has undefined references to
mbstowcs and wcstombs. But that's probably a local issue.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix build for OpenSSL without DTLS
David Woodhouse [Fri, 15 Jun 2012 12:43:36 +0000 (13:43 +0100)]
Fix build for OpenSSL without DTLS

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoClean up feature/index web pages a little
David Woodhouse [Fri, 15 Jun 2012 09:58:40 +0000 (10:58 +0100)]
Clean up feature/index web pages a little

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoRemove separate POTFILES list and build potfile from real sources lists
David Woodhouse [Fri, 15 Jun 2012 09:29:46 +0000 (10:29 +0100)]
Remove separate POTFILES list and build potfile from real sources lists

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoAdd gnutls_tpm.c to POTFILES
David Woodhouse [Fri, 15 Jun 2012 00:03:30 +0000 (01:03 +0100)]
Add gnutls_tpm.c to POTFILES

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoDon't repack extra_certs[] when matching key; just cope with it being sparse
David Woodhouse [Thu, 14 Jun 2012 23:56:31 +0000 (00:56 +0100)]
Don't repack extra_certs[] when matching key; just cope with it being sparse

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoClean up GnuTLS load_certificate() and improve comments
David Woodhouse [Thu, 14 Jun 2012 23:39:42 +0000 (00:39 +0100)]
Clean up GnuTLS load_certificate() and improve comments

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUnify assign_privkey() function for GnuTLS 2 and 3
David Woodhouse [Thu, 14 Jun 2012 22:59:46 +0000 (23:59 +0100)]
Unify assign_privkey() function for GnuTLS 2 and 3

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoMove setting of vpninfo->my_p11key to somewhere tidier
David Woodhouse [Thu, 14 Jun 2012 22:51:08 +0000 (23:51 +0100)]
Move setting of vpninfo->my_p11key to somewhere tidier

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSplit assign_privkey_gtls2() to separate function
David Woodhouse [Thu, 14 Jun 2012 22:38:29 +0000 (23:38 +0100)]
Split assign_privkey_gtls2() to separate function

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSplit assign_privkey_gtls3() to separate function
David Woodhouse [Thu, 14 Jun 2012 22:07:49 +0000 (23:07 +0100)]
Split assign_privkey_gtls3() to separate function

Another step towards a cleaner load_certificate() for GnuTLS.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoMove TPM code out into gnutls_tpm.c
David Woodhouse [Thu, 14 Jun 2012 21:48:38 +0000 (22:48 +0100)]
Move TPM code out into gnutls_tpm.c

Slightly reduce the #ifdef hell in gnutls.c

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoClean up handling of gnutls_pkcs12.c
David Woodhouse [Thu, 14 Jun 2012 21:22:05 +0000 (22:22 +0100)]
Clean up handling of gnutls_pkcs12.c

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix BER encoding of hash in sign_dummy_data()
David Woodhouse [Thu, 14 Jun 2012 21:10:16 +0000 (22:10 +0100)]
Fix BER encoding of hash in sign_dummy_data()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoCope with lack of gnutls_certificate_set_key() in GnuTLS 2.12
David Woodhouse [Thu, 14 Jun 2012 16:02:18 +0000 (17:02 +0100)]
Cope with lack of gnutls_certificate_set_key() in GnuTLS 2.12

We *can* use arbitrary privkeys, by using the cert_callback to provide
them on demand.

And even without gnutls_privkey_import_ext() to give us a constructed
privkey that represents the TPM key, we can cope by registering a
sign_callback on the TLS session.

This means that we can support the TPM, and also fix the lack of extra
supporting certs and expiry check when using PKCS#11 certs with GnuTLS 2.12.

It also means my code is an even bigger mess of #ifdefs than it was before.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix memory leak of TPM key password
David Woodhouse [Thu, 14 Jun 2012 15:00:03 +0000 (16:00 +0100)]
Fix memory leak of TPM key password

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix wording of comment about string handling
David Woodhouse [Thu, 14 Jun 2012 07:45:16 +0000 (08:45 +0100)]
Fix wording of comment about string handling

The library *will* free them later. Honest! If we say "should", someone
might get confused and think we're saying the *caller* needs to do it.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoDocument SHA1 buffer requirements more clearly
David Woodhouse [Thu, 14 Jun 2012 07:34:11 +0000 (08:34 +0100)]
Document SHA1 buffer requirements more clearly

There's an inconsistency here; openconnect_set_xmlsha1() takes a redundant
'len' arg which serves no purpose except to check that the caller knows
how big a SHA1 is. If it's not 41, we bail.

Next time the soname is getting bumped, I'll add a similar redundant
check to openconnect_get_cert_sha1() too. I should have done that when
it was first converted from an internal function to a public-facing one
in commit 20840ab0. But I didn't, and it's not worth bumping the soname
again right now *just* for that.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix Solaris build, again
David Woodhouse [Thu, 14 Jun 2012 01:14:05 +0000 (02:14 +0100)]
Fix Solaris build, again

I really ought to script a check for this.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix GnuTLS 2.12 library still referencing OpenSSL ERR_print_errors_cb()
David Woodhouse [Wed, 13 Jun 2012 23:55:54 +0000 (00:55 +0100)]
Fix GnuTLS 2.12 library still referencing OpenSSL ERR_print_errors_cb()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoTag version 3.99 v3.99
David Woodhouse [Wed, 13 Jun 2012 22:55:17 +0000 (23:55 +0100)]
Tag version 3.99

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoMake 'make tag' work out of source tree
David Woodhouse [Wed, 13 Jun 2012 22:55:03 +0000 (23:55 +0100)]
Make 'make tag' work out of source tree

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years ago$CISCO_SPLIT_DNS is separated by commas in vpnc, not spaces
David Woodhouse [Wed, 13 Jun 2012 22:32:53 +0000 (23:32 +0100)]
$CISCO_SPLIT_DNS is separated by commas in vpnc, not spaces

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoLink libopenconnect to trousers, not openconnect
David Woodhouse [Wed, 13 Jun 2012 22:32:02 +0000 (23:32 +0100)]
Link libopenconnect to trousers, not openconnect

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoMove dtls1_stop_timer() declaration inside the OPENCONNECT_OPENSSL section
David Woodhouse [Wed, 13 Jun 2012 21:22:39 +0000 (22:22 +0100)]
Move dtls1_stop_timer() declaration inside the OPENCONNECT_OPENSSL section

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoUpdate translations from Transifex
David Woodhouse [Wed, 13 Jun 2012 20:43:20 +0000 (21:43 +0100)]
Update translations from Transifex

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