]> www.infradead.org Git - users/dwmw2/openconnect.git/log
users/dwmw2/openconnect.git
7 years agoAdd test case for non-ASCII password on PKCS#12 keys
David Woodhouse [Thu, 25 May 2017 20:16:54 +0000 (21:16 +0100)]
Add test case for non-ASCII password on PKCS#12 keys

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoFix charset handling for --key-password on command line
David Woodhouse [Thu, 25 May 2017 20:15:27 +0000 (21:15 +0100)]
Fix charset handling for --key-password on command line

It was always converting to UTF-8 for input from the terminal; there
was a plausible reason for using the legacy charset as-is but it's
better to be consistent.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoFix build breakage in OpenSSL ESP
David Woodhouse [Thu, 25 May 2017 14:21:56 +0000 (15:21 +0100)]
Fix build breakage in OpenSSL ESP

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agostore length of ESP encryption and HMAC keys so that they can be manipulated separate...
Daniel Lenski [Mon, 15 May 2017 04:22:06 +0000 (21:22 -0700)]
store length of ESP encryption and HMAC keys so that they can be manipulated separately for both Juniper and GP

David Woodhouse wrote:
> Daniel Lenski wrote:
>> -       unsigned char secrets[0x40];
>> +       unsigned char secrets[0x40]; /* Encryption key bytes, then HMAC key bytes */
>
> You're allowed to object to that horridness and split it into two
> separate fields for the encryption and HMAC keys, instead of just
> documenting it.
>
> In fact, one might argue that would be the better approach...

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoadded news entry for RFC7469 key PIN support
Nikos Mavrogiannopoulos [Sun, 23 Apr 2017 17:17:13 +0000 (19:17 +0200)]
added news entry for RFC7469 key PIN support

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agotests: serverhash: added newline to usage
Nikos Mavrogiannopoulos [Sun, 5 Mar 2017 11:18:19 +0000 (12:18 +0100)]
tests: serverhash: added newline to usage

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoSwitched the default output for key PIN to be the RFC7469 key PIN
Nikos Mavrogiannopoulos [Sun, 5 Mar 2017 10:51:54 +0000 (11:51 +0100)]
Switched the default output for key PIN to be the RFC7469 key PIN

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoAdded support for RFC7469 key PIN
Nikos Mavrogiannopoulos [Sun, 5 Mar 2017 10:43:15 +0000 (11:43 +0100)]
Added support for RFC7469 key PIN

That allows the hash provided to the client to be the RFC7469 key PIN.
That is, a base64 encoding of the public key sha256 hash instead of the hex
equivalent. That reduces the number of characters that need to be typed.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoStore only the SHA1 and SHA256 of the public key internally
Nikos Mavrogiannopoulos [Sun, 5 Mar 2017 10:37:24 +0000 (11:37 +0100)]
Store only the SHA1 and SHA256 of the public key internally

This will allow switching to other representation formats for output
or input of public key PIN. For example to the RFC7469 key PIN.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoImport translations from GNOME
David Woodhouse [Sun, 14 May 2017 23:48:42 +0000 (00:48 +0100)]
Import translations from GNOME

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoadd oncp_bye() to logout the Juniper session
Daniel Lenski [Sun, 8 Jan 2017 20:27:54 +0000 (12:27 -0800)]
add oncp_bye() to logout the Juniper session

The nc protocol lacked a .vpn_close_session function; without logout, the
VPN cookie remains active and can be used to restart the session, which is a
security hazard—especially when passing around OpenConnect logs on the
mailing list for development and troubleshooting.

Juniper logout is straightforward: GET /dana-na/auth/logout.cgi (with the
appropriate DSID cookie set).

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agolist supported protocols in --version or --help output, using API functions
Daniel Lenski [Wed, 19 Apr 2017 20:12:49 +0000 (13:12 -0700)]
list supported protocols in --version or --help output, using API functions

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoenumerate supported VPN protocols via openconnect_get_supported_protocols()
Daniel Lenski [Wed, 19 Apr 2017 20:12:48 +0000 (13:12 -0700)]
enumerate supported VPN protocols via openconnect_get_supported_protocols()

Add two new public functions:

* int openconnect_get_supported_protocols(struct oc_vpn_proto **protos)

  Fetches a list of protocols supported by the client.  Each supported
  protocol has a short name (as accepted by the --protocol command-line
  option), pretty name, longer description, and list of flags.

  The return value of the function is the number of protocols supported (or
  negative if an error occurred).

  The flags indicate features that are meaningful for this protocol, to be
  used by tools like the Networkmanager configuration UI. Current flags:

    * OC_PROTO_PROXY: can connect via HTTP or SOCKS proxy
    * OC_PROTO_CSD: supports verification of the client via CSD trojan
    * OC_PROTO_AUTH_CERT: supports authentication by client certificate
    * OC_PROTO_AUTH_OTP: supports authentication by OATH HOTP/TOTP token
    * OC_PROTO_AUTH_STOKEN: supports authentication by RSA SecurID token (stoken)

* void openconnect_free_supported_protocols(struct oc_vpn_proto *protos)

  Frees the list of protocols fetched by openconnect_get_supported_protocols()

The description of the "anyconnect" protocol matches the IETF draft
standard for openconnect VPN (https://tools.ietf.org/html/draft-mavrogiannopoulos-openconnect-00).

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoDo not drop vpn connection if packet arrived is larger than MTU
Nikolay Martynov [Fri, 12 May 2017 23:57:29 +0000 (19:57 -0400)]
Do not drop vpn connection if packet arrived is larger than MTU

Sometimes server sends us packets that are larger than negotiated MTU.
Current implementation bails out in this case.
This patch makes openconnect to reserve space and handle incoming packets
that have size up to 16384 (to match CSTP).

This improves connection stability.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoDo not try to establish DTLS on reconnect if it wasn't established before
Nikolay Martynov [Thu, 11 May 2017 03:02:59 +0000 (23:02 -0400)]
Do not try to establish DTLS on reconnect if it wasn't established before

Currently when TCP SSL fails reconnect attempt happens. This attempts tries to establish DTLS connection regadless if it existed before. Code ends up in infinite loop doing that.
This changes fixes this by disabling DTLS at startup if DTLS connection cannot be established.
Also change ESP handling code to not reenable DTLS on ESP close.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoDo not leak memory when tun was not created yet
Nikolay Martynov [Thu, 11 May 2017 03:02:58 +0000 (23:02 -0400)]
Do not leak memory when tun was not created yet

Packets pulled off incoming queue should be freed

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoFix build with LibreSSL 2.5.1 and higher.
Piotr Kubaj [Fri, 12 May 2017 13:24:37 +0000 (14:24 +0100)]
Fix build with LibreSSL 2.5.1 and higher.

We don't actually care if we use the read or write state; we're only
calculating the cipher/protocol overheads which are the same in both
directions.

In LibreSSL they were all removed in
https://github.com/libressl-portable/openbsd/commit/122ecd906da7
and the read side was restored in
https://github.com/libressl-portable/openbsd/commit/0d7a7d5f5a44
so just use that.

Signed-off-by: Piotr Kubaj <pkubaj@anongoth.pl>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoNUL-terminate gai->value for OPT_RESOLVE, fix out-of-bound read
Youfu Zhang [Tue, 2 May 2017 05:31:35 +0000 (13:31 +0800)]
NUL-terminate gai->value for OPT_RESOLVE, fix out-of-bound read

Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoRely on SoftHSM being installed correctly with a p11-kit .module file
David Woodhouse [Wed, 14 Dec 2016 20:30:47 +0000 (20:30 +0000)]
Rely on SoftHSM being installed correctly with a p11-kit .module file

I don't actually remember why I added my own; it *ought* to be installed
correctly by the distribution's packaging of SoftHSM.

There was a brief discussion about my hard-coded version being
Fedora-specific, followed by a suggestion that I could pick up the
proper path from and existing module file, followed by the realisation
that said existing module file would suffice anyway. So just require it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoAdd support for Google Authenticator 2fa on Juniper VPN
Janne Juntunen [Tue, 29 Nov 2016 22:37:22 +0000 (22:37 +0000)]
Add support for Google Authenticator 2fa on Juniper VPN

We resently changed our Juniper VPN from SMS 2fa to use Google
Authenticator instead. Before it worked perfectly with "openconnect
--juniper" switch, but after the change all we got was:

Unknown form ID 'frmTotpToken'
and a dump of the form.

I spent some time debugging the issue, and managed to write a very
simple fix for it.

Signed-off-by: Janne Juntunen <janne.juntunen@hermanit.fi>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agotests: avoid using eval with variable assignments
Mike Miller [Wed, 14 Dec 2016 18:02:13 +0000 (10:02 -0800)]
tests: avoid using eval with variable assignments

For shell portability, avoid using eval with variable assignments to set
openconnect's environment. Shell implementations vary on whether
variable assignments in front of eval are marked as environment
variables or just treated as ordinary shell assignments.

Every call to $OPENCONNECT already has LD_PRELOAD=libsocket_wrapper.so
in front of it, so the "eval LD_PRELOAD=libsocket_wrapper.so" was
redundant anyway.

Signed-off-by: Mike Miller <mtmiller@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoTag version 7.08 v7.08
David Woodhouse [Tue, 13 Dec 2016 12:31:37 +0000 (12:31 +0000)]
Tag version 7.08

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoResync translations with sources
David Woodhouse [Tue, 13 Dec 2016 12:06:01 +0000 (12:06 +0000)]
Resync translations with sources

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoUpdate translations from GNOME
David Woodhouse [Tue, 13 Dec 2016 12:05:46 +0000 (12:05 +0000)]
Update translations from GNOME

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoIPv6 packet size field doesn't include header size, take this into account
Nikolay Martynov [Thu, 17 Nov 2016 03:26:17 +0000 (22:26 -0500)]
IPv6 packet size field doesn't include header size, take this into account

IPv6 packet's 'length' field contains length of payload excluding headers.
Header's length (40) needs to be added to that to get complete packet length.
This patch seems to be fixing random VPN drops.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoCorrectly handle IPv4 route specified as either 10.1.2.0/255.255.255.0 or 10.1.2...
Dan Lenski [Sun, 16 Oct 2016 01:56:30 +0000 (18:56 -0700)]
Correctly handle IPv4 route specified as either 10.1.2.0/255.255.255.0 or 10.1.2.0/24

The existing process_split_xxclude() only handles IPv4 routes
formatted as "10.1.2.0/255.255.255.0", not those formatted as
"10.1.2.0/24".

It's possible to unambiguously distinguish the two and handle the
latter case correctly, because no IPv4 netmask address can possibly
have a decimal integer value <= 32.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoUnset got_cancel_cmd after reacting to it, as is already done for got_pause_cmd
Daniel Lenski [Sat, 15 Oct 2016 01:46:34 +0000 (18:46 -0700)]
Unset got_cancel_cmd after reacting to it, as is already done for got_pause_cmd

Per David Woodhouse (http://lists.infradead.org/pipermail/openconnect-devel/2016-October/004034.html):

> I think it's probably OK to set vpninfo->got_cancel_cmd=0 in the mainloop
> right before calling proto->vpn_close_session.  If we get cancelled
> *again* then we'll give up on that too.

Without this fix, do_https_request() can't be used to close the
session — it interrupts itself as soon as it sees that got_cancel_cmd is
set.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoMake buf_append_urlencoded() percent-encode fewer characters.
Daniel Lenski [Sun, 16 Oct 2016 19:37:58 +0000 (12:37 -0700)]
Make buf_append_urlencoded() percent-encode fewer characters.

Per RFC 3986, the characters '-', '_', '.', '~' don't need to be
percent-encoded anywhere in a URL or query string.

Removed special case for ' ' → '+' to prevent incompatibility with ocserv:
http://lists.infradead.org/pipermail/openconnect-devel/2016-October/004042.html

/* else if (c==' ')
buf_append_bytes(buf, "+", 1); */

Signed-off-by: Dan Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoappend_opt() and buf_append_urlencoded() should take const char *
Daniel Lenski [Sat, 15 Oct 2016 01:46:32 +0000 (18:46 -0700)]
append_opt() and buf_append_urlencoded() should take const char *

Fixes -Wcast-qual warnings.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoStop using deprecated LZ4 functions
David Woodhouse [Tue, 13 Dec 2016 11:36:15 +0000 (11:36 +0000)]
Stop using deprecated LZ4 functions

../cstp.c:865:3: warning: ‘LZ4_compress_limitedOutput’ is deprecated: use LZ4_compress_default() instead [-Wdeprecated-declarations]
   ret = LZ4_compress_default((void*)this->data, (void*)vpninfo->deflate_pkt->data,
   ^~~

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoChangelog entry for SHA256 hashes
David Woodhouse [Tue, 13 Dec 2016 11:10:52 +0000 (11:10 +0000)]
Changelog entry for SHA256 hashes

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agotests: added check for operation under different --servercert parameters
Nikos Mavrogiannopoulos [Tue, 6 Dec 2016 12:00:27 +0000 (13:00 +0100)]
tests: added check for operation under different --servercert parameters

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoIntroduced buf_append_hex()
Nikos Mavrogiannopoulos [Tue, 22 Nov 2016 12:40:57 +0000 (13:40 +0100)]
Introduced buf_append_hex()

That is being used by openconnect_bin2hex() for hex-encoding.

[dwmw2: Clean up buf error handling in openconnect_bin2hex()]

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoopenconnect_check_peer_cert_hash: allow partial server hash matches
Nikos Mavrogiannopoulos [Tue, 1 Nov 2016 08:32:31 +0000 (09:32 +0100)]
openconnect_check_peer_cert_hash: allow partial server hash matches

That is allow the user specifying a small part of the hash (e.g., 'sha256:6429')
in order to be able to connect. This is to ease test connections, when copy-paste
is not possible.

[dwmw2: Fix man page to say 'at least 4 characters' not 'more than']

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoIntroduce SHA2-256 as a peer certificate hash and make it the default
Nikos Mavrogiannopoulos [Tue, 1 Nov 2016 08:23:48 +0000 (09:23 +0100)]
Introduce SHA2-256 as a peer certificate hash and make it the default

That is, generate and print a SHA256 hash by default, while also
accept the old 'sha1:' type of certificate hashes.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoAdd TPM documentation
David Woodhouse [Sat, 5 Nov 2016 04:34:21 +0000 (22:34 -0600)]
Add TPM documentation

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoCalculate MTU for PSK-NEGOTIATE
David Woodhouse [Tue, 4 Oct 2016 09:22:29 +0000 (10:22 +0100)]
Calculate MTU for PSK-NEGOTIATE

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAllow DTLS version negotiation with PSK-NEGOTIATE and OpenSSL 1.0.2
David Woodhouse [Tue, 4 Oct 2016 22:52:31 +0000 (23:52 +0100)]
Allow DTLS version negotiation with PSK-NEGOTIATE and OpenSSL 1.0.2

We can use DTLS_client_method() here too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoDon't resume OpenSSL DTLS session for PSK-NEGOTIATE
David Woodhouse [Tue, 4 Oct 2016 22:26:33 +0000 (23:26 +0100)]
Don't resume OpenSSL DTLS session for PSK-NEGOTIATE

Now that we are using a custom extension instead of the session-id
hack, we no longer need to pretend to resume a session. It was causing
a session-id of 32 zeroes to be included in the ClientHello. With
OpenSSL 1.1+, that was causing fragmentation which ocserv couldn't
cope with.

Perhaps ocserv *should* have coped with that fragmentation, and perhaps
we should increase our initial idea of the MTU to avoid the fragmentation.
But certainly we shouldn't be including an all-zero session-id for
resumption either.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoEnable DHE ciphers for Cisco DTLS
David Woodhouse [Mon, 3 Oct 2016 20:49:27 +0000 (21:49 +0100)]
Enable DHE ciphers for Cisco DTLS

Tested-by: Peter Brant <peter.brant@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate translations from GNOME
David Woodhouse [Tue, 27 Sep 2016 07:10:40 +0000 (08:10 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate translations from GNOME
David Woodhouse [Sun, 25 Sep 2016 22:14:54 +0000 (23:14 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoRemove unused LIBS/CFLAGS manipulation in configure.ac
David Woodhouse [Sun, 25 Sep 2016 19:34:00 +0000 (20:34 +0100)]
Remove unused LIBS/CFLAGS manipulation in configure.ac

I removed everything from the middle of this section; it can die now.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix openssl dependency in openssl.pc
David Woodhouse [Sun, 25 Sep 2016 19:32:17 +0000 (20:32 +0100)]
Fix openssl dependency in openssl.pc

When we discover a native system OpenSSL without pkg-config, don't
require openssl in openconnect.pc; instead add $OPENSSL_LIBS to
Libs.private. Only when we found it automatically though; when we
use --with-openssl=/where/I/built/openssl then we build statically
anyway so there's no need.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix pcsclite dependency in openconnect.pc
David Woodhouse [Sun, 25 Sep 2016 19:12:13 +0000 (20:12 +0100)]
Fix pcsclite dependency in openconnect.pc

On Windows and OSX, the PCSC support is provided by the system and not
a separate installation of libpcsclite. So don't require the pcsclite
package in the openconnect.pc file; instead add the appropriate thing
to Libs.private.

Reported-by: Björn Ketelaars <bjorn.ketelaars@hydroxide.nl>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSmall error in openconnect.8
Björn Ketelaars [Sun, 25 Sep 2016 15:02:59 +0000 (17:02 +0200)]
Small error in openconnect.8

openconnect.8 discusses 'basemtu' as option. Unfortunately this option is not
recognized. A quick glance in the source learned that 'base-mtu' should be
used.

Signed-off-by: Björn Ketelaars <bjorn.ketelaars@hydroxide.nl>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate translations from GNOME
David Woodhouse [Sat, 24 Sep 2016 20:59:29 +0000 (21:59 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate changelog
David Woodhouse [Sat, 24 Sep 2016 00:06:52 +0000 (01:06 +0100)]
Update changelog

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoIncrease oNCP configuration buffer size
David Woodhouse [Fri, 23 Sep 2016 23:33:06 +0000 (00:33 +0100)]
Increase oNCP configuration buffer size

We've seen 'KMP message 301 from server too large (10596 bytes)'
in the wild. Bump it up for now, but this really wants to be
dynamically handled.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd TUNIDX for Windows vpnc-script
David Woodhouse [Fri, 23 Sep 2016 23:09:07 +0000 (00:09 +0100)]
Add TUNIDX for Windows vpnc-script

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoBetter attempt at handling TAP-Windows tun setup
David Woodhouse [Fri, 23 Sep 2016 20:35:32 +0000 (21:35 +0100)]
Better attempt at handling TAP-Windows tun setup

Just set the network and mask to all zeros. It means it'll do proxy ARP
for *everything* and we can configure them all as on-link routes.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd GNUTLS_NO_EXTENSIONS to DTLS setup
David Woodhouse [Fri, 23 Sep 2016 14:35:28 +0000 (15:35 +0100)]
Add GNUTLS_NO_EXTENSIONS to DTLS setup

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoRemember the X-CSTP-Base-MTU: value that the server sends back
David Woodhouse [Fri, 23 Sep 2016 14:32:44 +0000 (15:32 +0100)]
Remember the X-CSTP-Base-MTU: value that the server sends back

We'll want this, for calculating DTLS MTU with PSK-NEGOTIATE.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoLimit netmask on Windows TAP setup to 255.255.255.254
David Woodhouse [Fri, 23 Sep 2016 14:29:25 +0000 (15:29 +0100)]
Limit netmask on Windows TAP setup to 255.255.255.254

This makes a start on the problems with point-to-point configurations,
discussed in https://github.com/openconnect/openconnect-gui/issues/132

Some work is required in vpnc-script-win.js to make the routing do
anything useful, but at least it's not now *impossible* to persuade
it to pass any traffic.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAttempt to re-open CONIN$ if stdin has been redirected on Windows
David Woodhouse [Fri, 23 Sep 2016 13:56:17 +0000 (14:56 +0100)]
Attempt to re-open CONIN$ if stdin has been redirected on Windows

This should hopefully fix the problem with --passwd-on-stdin, described
in https://github.com/openconnect/openconnect-gui/issues/101

It doesn't actually work for me in wine, as I get 'Access Denied' when
trying to use ReadConsoleW() on the resulting handle. But wine is strange,
and this at least shouldn't make things any *worse*.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd session resume check for GnuTLS too
David Woodhouse [Fri, 23 Sep 2016 11:33:13 +0000 (12:33 +0100)]
Add session resume check for GnuTLS too

It's actually doing nothing here; no existing version of GnuTLS would
have let the session get established since we do not install any
credentials which would permit any key exchange. But it wasn't
*explicitly* prevented. And now it is.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoExplicitly disallow non-resumed sessions for legacy DTLS establishment
David Woodhouse [Fri, 23 Sep 2016 11:24:35 +0000 (12:24 +0100)]
Explicitly disallow non-resumed sessions for legacy DTLS establishment

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate translations from GNOME
David Woodhouse [Fri, 23 Sep 2016 10:21:25 +0000 (11:21 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd DTLS files back to translation
David Woodhouse [Fri, 23 Sep 2016 10:19:08 +0000 (11:19 +0100)]
Add DTLS files back to translation

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix 'make install' from clean too.
David Woodhouse [Thu, 22 Sep 2016 20:43:49 +0000 (21:43 +0100)]
Fix 'make install' from clean too.

Recursive Make still Considered Harmful.

cf. https://github.com/Homebrew/homebrew-core/pull/5029

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate changelog
David Woodhouse [Thu, 22 Sep 2016 14:08:19 +0000 (15:08 +0100)]
Update changelog

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd Content-Length header to mimic official pulse client
Jon DeVree [Tue, 20 Sep 2016 01:00:18 +0000 (21:00 -0400)]
Add Content-Length header to mimic official pulse client

The official pulse client sends in a fixed "Content-Length: 256" header
with these two HTTP requests. Some versions of the VPN server will
reject requests with an HTTP 400 error if they do not have this header.

Signed-off-by: Jon DeVree <nuxi@vault24.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix IPv6 setup on Solaris
David Woodhouse [Thu, 22 Sep 2016 13:57:56 +0000 (14:57 +0100)]
Fix IPv6 setup on Solaris

Commit a5dd38ec8 ("Assign Address-IP6 field to netmask instead of address")
caused us to sometimes neglect to plumb the tun interface for IPv6.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoEnable DTLS protocol negotiation
Nikos Mavrogiannopoulos [Wed, 27 Jul 2016 09:58:11 +0000 (11:58 +0200)]
Enable DTLS protocol negotiation

The new negotiation is as follows: If the client's X-DTLS-CipherSuite
contains the "PSK-NEGOTIATE" keyword, the server will reply with
"X-DTLS-CipherSuite: PSK-NEGOTIATE" and will enable DTLS-PSK negotiation on the
DTLS channel.

That change utilizes the value provided by sever's X-DTLS-App-ID header
and sets that value to a TLS extension on client hello. The
extension used is defined on (draft-mavrogiannopoulos-app-id).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoEnable DSA-SHA1 in ocserv config
David Woodhouse [Mon, 19 Sep 2016 13:24:08 +0000 (14:24 +0100)]
Enable DSA-SHA1 in ocserv config

Now the DSA test works again for OpenSSL even with TLSv1.2

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate CONFIG_STATUS_DEPENDENCIES
David Woodhouse [Mon, 19 Sep 2016 13:23:44 +0000 (14:23 +0100)]
Update CONFIG_STATUS_DEPENDENCIES

We want to rebuild when config files change

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoChange DSA test key to 1024 bits
David Woodhouse [Mon, 19 Sep 2016 13:01:32 +0000 (14:01 +0100)]
Change DSA test key to 1024 bits

Support for larger keys is undefined in TLS.

Of course, this doesn't actually work *either*, as ocserv still refuses
to accept them, but at least it's not the client's fault now.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate test suite
David Woodhouse [Wed, 14 Sep 2016 19:22:52 +0000 (20:22 +0100)]
Update test suite

Disable DSA tests for OpenSSL too. It seems that ocserv stops accepting DSA
certs when you use TLSv1.2.

Stop expecting CentOS7/GnuTLS to fail the auth-pkcs11 test. It doesn't seem
to.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoDTLS MTU detection fixes
David Woodhouse [Wed, 14 Sep 2016 16:22:45 +0000 (17:22 +0100)]
DTLS MTU detection fixes

Most importantly, in some circumstances it was setting the "detected"
MTU to the value of the first *failing* packet size, not the last
working one. But also fix up various other issues too, and optimise it
for the common case where the negotiated MTU *is* actually working.

There are still issues with the way we choose the next candidate address,
and it might never reach the actual best MTU. But it's better than it was.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSupport --key-password for GnuTLS PKCS#11 PIN
David Woodhouse [Tue, 13 Sep 2016 21:50:44 +0000 (22:50 +0100)]
Support --key-password for GnuTLS PKCS#11 PIN

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSingle pipeline for creating openconnect.8.inc
David Woodhouse [Tue, 13 Sep 2016 21:13:01 +0000 (22:13 +0100)]
Single pipeline for creating openconnect.8.inc

There were race conditiona here with the temporary files, which were fairly
gratuitous — we can just write directly to $@.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate translations from GNOME
David Woodhouse [Tue, 13 Sep 2016 20:38:22 +0000 (21:38 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate changelog
David Woodhouse [Tue, 13 Sep 2016 20:31:33 +0000 (21:31 +0100)]
Update changelog

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSet SSL_OP_TLSEXT_PADDING to work around F5 firewall bugs
David Woodhouse [Tue, 13 Sep 2016 20:14:02 +0000 (21:14 +0100)]
Set SSL_OP_TLSEXT_PADDING to work around F5 firewall bugs

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAllow OpenSSL to use TLSv1.2
David Woodhouse [Tue, 13 Sep 2016 19:57:20 +0000 (20:57 +0100)]
Allow OpenSSL to use TLSv1.2

We've been allowing GnuTLS to negotiate higher protocols than TLSv1.0 for
a while; make OpenSSL do the same.

The Cisco ASA is still stuck at TLSv1.0 but ocserv isn't. Not sure about
Juniper, offhand.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoReport actual DTLS cipher for OpenSSL
David Woodhouse [Tue, 13 Sep 2016 19:46:48 +0000 (20:46 +0100)]
Report actual DTLS cipher for OpenSSL

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix serverhash build with local OpenSSL
David Woodhouse [Mon, 12 Sep 2016 20:12:28 +0000 (21:12 +0100)]
Fix serverhash build with local OpenSSL

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix Windows build of serverhash
David Woodhouse [Mon, 12 Sep 2016 12:16:03 +0000 (13:16 +0100)]
Fix Windows build of serverhash

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd openconnect_init_ssl() in serverhash.c
David Woodhouse [Mon, 12 Sep 2016 11:54:39 +0000 (12:54 +0100)]
Add openconnect_init_ssl() in serverhash.c

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix build from clean
David Woodhouse [Mon, 12 Sep 2016 11:31:43 +0000 (12:31 +0100)]
Fix build from clean

We now need libopenconnect to be built before we recurse into tests/ even
for building.

Recursive Make Considered Harmful.

If the directory handling in tests/ wasn't already so baroque, I might
take a look at fixing that. But a task for another day, methinks...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoKill DTLS_FREE macro
David Woodhouse [Mon, 12 Sep 2016 10:55:26 +0000 (11:55 +0100)]
Kill DTLS_FREE macro

This can move to the library-specific *-dtls.c files too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAdd serverhash test tool
David Woodhouse [Mon, 12 Sep 2016 10:17:08 +0000 (11:17 +0100)]
Add serverhash test tool

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoReinstate 'make check' warning for OpenSSL builds
David Woodhouse [Sat, 10 Sep 2016 20:14:54 +0000 (21:14 +0100)]
Reinstate 'make check' warning for OpenSSL builds

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSplit crypto library parts out from dtls.c to {gnutls,openssl}-dtls.c
David Woodhouse [Sat, 10 Sep 2016 20:12:02 +0000 (21:12 +0100)]
Split crypto library parts out from dtls.c to {gnutls,openssl}-dtls.c

There are still some #ifdefs but it's a lot nicer now.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoRemove bad-random test stuff
David Woodhouse [Sat, 10 Sep 2016 19:55:53 +0000 (20:55 +0100)]
Remove bad-random test stuff

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSimplify DTLS conditionals
David Woodhouse [Sat, 10 Sep 2016 19:54:36 +0000 (20:54 +0100)]
Simplify DTLS conditionals

These can look like ESP now too

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoSimplify ESP conditionals
David Woodhouse [Sat, 10 Sep 2016 18:58:56 +0000 (19:58 +0100)]
Simplify ESP conditionals

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoRevamp GnuTLS/OpenSSL detection
David Woodhouse [Sat, 10 Sep 2016 17:09:54 +0000 (18:09 +0100)]
Revamp GnuTLS/OpenSSL detection

Clean this up somewhat, and remove the support for building with both at
once. There's no point in that any more — GnuTLS has had DTLS support for
ages, and we've have PKCS#11 support with OpenSSL for ages. So just pick
one and use it; don't mix and match.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoExtended MTU discovery to work even when compiled with openssl
Nikos Mavrogiannopoulos [Thu, 8 Sep 2016 14:46:30 +0000 (16:46 +0200)]
Extended MTU discovery to work even when compiled with openssl

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoCI cleanups
David Woodhouse [Fri, 9 Sep 2016 15:02:53 +0000 (16:02 +0100)]
CI cleanups

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix Windows inet_pton() build warning
David Woodhouse [Thu, 8 Sep 2016 23:29:41 +0000 (00:29 +0100)]
Fix Windows inet_pton() build warning

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoEnable CentOS CI builds
David Woodhouse [Thu, 8 Sep 2016 23:14:37 +0000 (00:14 +0100)]
Enable CentOS CI builds

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoAllow explicit disabling of DSA tests
David Woodhouse [Thu, 8 Sep 2016 23:13:41 +0000 (00:13 +0100)]
Allow explicit disabling of DSA tests

On CentOS7, ocserv doesn't work even when the client does.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix configure reporting of Yubikey support
David Woodhouse [Thu, 8 Sep 2016 23:13:24 +0000 (00:13 +0100)]
Fix configure reporting of Yubikey support

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoRemove unused variable from bad_dtls_test.c
David Woodhouse [Thu, 8 Sep 2016 23:12:25 +0000 (00:12 +0100)]
Remove unused variable from bad_dtls_test.c

Not entirely sure why only the MinGW build told me about this.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoEscape 'PKCS#11 support' in configure summary
David Woodhouse [Thu, 8 Sep 2016 20:08:23 +0000 (21:08 +0100)]
Escape 'PKCS#11 support' in configure summary

Otherwise, autoconf 2.63 on CentOS6 complains:

/usr/bin/m4:configure.ac:1088: ERROR: end of file in argument list
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: autom4te failed with exit status: 1

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoFix 'Got no issuer from PKCS#11' message
David Woodhouse [Thu, 8 Sep 2016 17:27:34 +0000 (18:27 +0100)]
Fix 'Got no issuer from PKCS#11' message

Make it a PRG_TRACE message, and translate it.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoUpdate translations from GNOME
David Woodhouse [Thu, 8 Sep 2016 11:53:12 +0000 (12:53 +0100)]
Update translations from GNOME

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoCall SSL_CTX_check_private_key() to validate cert+key match
David Woodhouse [Wed, 7 Sep 2016 19:35:15 +0000 (20:35 +0100)]
Call SSL_CTX_check_private_key() to validate cert+key match

OpenSSL does this for you... *only* if the key types match. But load a
cert for an EC key, and a non-matching RSA or DSA key to go with it,
and it won't tell you. It'll just silently fail to do any authentication
on the wire.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoKill --no-cert-check
David Woodhouse [Wed, 7 Sep 2016 14:15:34 +0000 (15:15 +0100)]
Kill --no-cert-check

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