strongswan.git
2 years agotesting: Converted af-alg to systemd
Andreas Steffen [Wed, 18 Oct 2017 09:45:14 +0000 (11:45 +0200)]
testing: Converted af-alg to systemd

2 years agotesting: Enable systemd
Andreas Steffen [Tue, 17 Oct 2017 09:52:08 +0000 (11:52 +0200)]
testing: Enable systemd

2 years agotesting: Updated some descriptions
Andreas Steffen [Fri, 1 Sep 2017 16:14:04 +0000 (18:14 +0200)]
testing: Updated some descriptions

2 years agolibtpmtss: Added missing argument in hasher_from_signature_scheme()
Andreas Steffen [Fri, 10 Nov 2017 10:47:27 +0000 (11:47 +0100)]
libtpmtss: Added missing argument in hasher_from_signature_scheme()

2 years agocharon-tkm: Unlink PID file after deinit
Tobias Brunner [Tue, 7 Nov 2017 09:44:22 +0000 (10:44 +0100)]
charon-tkm: Unlink PID file after deinit

Same change as for charon in the previous commit.

References #2460.

2 years agocharon: Unlink PID file after daemon deinit (i.e. after unloading plugins etc.)
Tobias Brunner [Tue, 7 Nov 2017 09:30:05 +0000 (10:30 +0100)]
charon: Unlink PID file after daemon deinit (i.e. after unloading plugins etc.)

Make sure, though, that we only remove the file if we actually
created it (e.g. not for --help or --version).  And do so before
deinitializing libstrongswan due to leak detective.

Fixes #2460.

2 years agounit-tests: Rename targets for libstrongswan and kernel-netlink
Thomas Egerer [Wed, 8 Nov 2017 17:16:52 +0000 (18:16 +0100)]
unit-tests: Rename targets for libstrongswan and kernel-netlink

libstrongswan and kernel-netlink are the only two components which do
not adhere to the naming scheme used for all other tests. If the tests
are run by an external application this imposes problems due to clashing
names.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2 years agoMerge branch 'rsassa-pss'
Tobias Brunner [Wed, 8 Nov 2017 15:48:37 +0000 (16:48 +0100)]
Merge branch 'rsassa-pss'

This adds support for RSASSA-PSS signatures in IKEv2 digital signature
authentication (RFC 7427), certificates and CRLs etc., and when signing
credentials via pki tool.  For interoperability with older versions, the
default is to use classic PKCS#1 signatures.  To use PSS padding either enable
rsa_pss via strongswan.conf or explicitly use it either via ike:rsa/pss...
auth token or the --rsa-padding option of the pki tool.

References #2427.

2 years agoauth-cfg: Add RSA/PSS schemes for pubkey and rsa if enabled in strongswan.conf
Tobias Brunner [Tue, 31 Oct 2017 13:20:28 +0000 (14:20 +0100)]
auth-cfg: Add RSA/PSS schemes for pubkey and rsa if enabled in strongswan.conf

Also document the rsa/pss prefix.

2 years agopki: Enable PSS padding if enabled in strongswan.conf
Tobias Brunner [Mon, 30 Oct 2017 16:54:44 +0000 (17:54 +0100)]
pki: Enable PSS padding if enabled in strongswan.conf

2 years agopki: Optionally generate RSA/PSS signatures
Tobias Brunner [Mon, 30 Oct 2017 14:10:46 +0000 (15:10 +0100)]
pki: Optionally generate RSA/PSS signatures

2 years agopki: Indent usage lines properly automatically
Tobias Brunner [Mon, 30 Oct 2017 13:55:44 +0000 (14:55 +0100)]
pki: Indent usage lines properly automatically

2 years agoTreat RSASSA-PSS keys like rsaEncryption RSA keys
Tobias Brunner [Fri, 27 Oct 2017 13:09:46 +0000 (15:09 +0200)]
Treat RSASSA-PSS keys like rsaEncryption RSA keys

In theory we should treat any parameters and the identifier itself as
restriction to only use the key to create signatures accordingly (e.g.
only use RSA with PSS padding or even use specific hash algorithms).
But that's currently tricky as we'd have to store and pass this information
along with our private keys (i.e. use PKCS#8 to store them and change the
builder calls to pass along the identifier and parameters). That would
require quite some work.

2 years agoopenssl: Add support for signature schemes with parameters
Tobias Brunner [Fri, 27 Oct 2017 12:29:50 +0000 (14:29 +0200)]
openssl: Add support for signature schemes with parameters

2 years agopki: Properly forward digest to attribute certificate builder
Tobias Brunner [Fri, 27 Oct 2017 11:49:29 +0000 (13:49 +0200)]
pki: Properly forward digest to attribute certificate builder

2 years agox509: Add support for signature schemes with parameters
Tobias Brunner [Fri, 27 Oct 2017 09:18:35 +0000 (11:18 +0200)]
x509: Add support for signature schemes with parameters

Also adds support for specifying the hash algorithm for attribute
certificate signatures.

2 years agobuilder: Add builder option to pass signature scheme and params
Tobias Brunner [Fri, 27 Oct 2017 09:06:14 +0000 (11:06 +0200)]
builder: Add builder option to pass signature scheme and params

2 years agoikev2: Use helpers to build signature auth data
Tobias Brunner [Tue, 24 Oct 2017 11:49:14 +0000 (13:49 +0200)]
ikev2: Use helpers to build signature auth data

2 years agosignature-params: Add helpers to parse/build ASN.1 algorithmIdentifier for signature...
Tobias Brunner [Tue, 24 Oct 2017 11:45:31 +0000 (13:45 +0200)]
signature-params: Add helpers to parse/build ASN.1 algorithmIdentifier for signature schemes

2 years agoikev2: Enumerate RSA/PSS schemes and use them if enabled
Tobias Brunner [Mon, 16 Oct 2017 16:09:38 +0000 (18:09 +0200)]
ikev2: Enumerate RSA/PSS schemes and use them if enabled

2 years agoikev2: Support signing with RSASSA-PSS via RFC 7427 signature auth
Tobias Brunner [Mon, 2 Oct 2017 14:21:13 +0000 (16:21 +0200)]
ikev2: Support signing with RSASSA-PSS via RFC 7427 signature auth

2 years agosignature-params: Use helper to build MGF1 algorithmIdentifier
Tobias Brunner [Mon, 2 Oct 2017 14:10:40 +0000 (16:10 +0200)]
signature-params: Use helper to build MGF1 algorithmIdentifier

2 years agoasn1: Add helper function to create algorithmIdentifier with parameters
Tobias Brunner [Mon, 2 Oct 2017 14:08:46 +0000 (16:08 +0200)]
asn1: Add helper function to create algorithmIdentifier with parameters

2 years agoikev2: Verify RSASSA-PSS signatures via RFC 7427 signature auth
Tobias Brunner [Mon, 2 Oct 2017 13:57:17 +0000 (15:57 +0200)]
ikev2: Verify RSASSA-PSS signatures via RFC 7427 signature auth

2 years agokeymat_v2: Pass/receive signature schemes as signature_param_t objects
Tobias Brunner [Mon, 16 Oct 2017 14:41:55 +0000 (16:41 +0200)]
keymat_v2: Pass/receive signature schemes as signature_param_t objects

2 years agoauth-cfg: Parse rsa/pss auth tokens
Tobias Brunner [Fri, 13 Oct 2017 13:32:29 +0000 (15:32 +0200)]
auth-cfg: Parse rsa/pss auth tokens

2 years agoauth-cfg: Store signature schemes as signature_params_t objects
Tobias Brunner [Fri, 13 Oct 2017 13:02:02 +0000 (15:02 +0200)]
auth-cfg: Store signature schemes as signature_params_t objects

Due to circular references the hasher_from_signature_scheme() helper
does not take a signature_params_t object.

2 years agocertificate: Return signature scheme and parameters from issued_by() method
Tobias Brunner [Fri, 13 Oct 2017 12:33:43 +0000 (14:33 +0200)]
certificate: Return signature scheme and parameters from issued_by() method

This also required some include restructuring (avoid including library.h
in headers) to avoid unresolvable circular dependencies.

2 years agosignature-params: Add helper struct for signature scheme and parameters
Tobias Brunner [Tue, 10 Oct 2017 13:52:19 +0000 (15:52 +0200)]
signature-params: Add helper struct for signature scheme and parameters

2 years agoandroid: Add support for creating RSASSA-PSS signatures via JNI
Tobias Brunner [Tue, 26 Sep 2017 16:35:59 +0000 (18:35 +0200)]
android: Add support for creating RSASSA-PSS signatures via JNI

2 years agounit-tests: Add RSA-PSS signature tests with specific salts
Tobias Brunner [Tue, 26 Sep 2017 14:46:42 +0000 (16:46 +0200)]
unit-tests: Add RSA-PSS signature tests with specific salts

2 years agogcrypt: Add support for static salts when signing with RSA-PSS
Tobias Brunner [Tue, 26 Sep 2017 14:44:44 +0000 (16:44 +0200)]
gcrypt: Add support for static salts when signing with RSA-PSS

2 years agogmp: Add support for static salts when signing with RSA-PSS
Tobias Brunner [Tue, 26 Sep 2017 14:44:02 +0000 (16:44 +0200)]
gmp: Add support for static salts when signing with RSA-PSS

2 years agosignature-params: Optionally pass a specific salt value when signing
Tobias Brunner [Tue, 26 Sep 2017 13:02:04 +0000 (15:02 +0200)]
signature-params: Optionally pass a specific salt value when signing

2 years agounit-tests: Warn if we skip RSA tests due to dependencies
Tobias Brunner [Tue, 26 Sep 2017 12:57:40 +0000 (14:57 +0200)]
unit-tests: Warn if we skip RSA tests due to dependencies

2 years agounit-tests: Add ability to issue a warning message for a test case
Tobias Brunner [Tue, 26 Sep 2017 12:55:14 +0000 (14:55 +0200)]
unit-tests: Add ability to issue a warning message for a test case

This way we can warn if we e.g. skipped actually doing something due to
dependencies (otherwise the test case would just appear to have succeeded).

2 years agomgf1: Add support for SHA-224/384 based MGF1
Tobias Brunner [Mon, 25 Sep 2017 16:17:54 +0000 (18:17 +0200)]
mgf1: Add support for SHA-224/384 based MGF1

2 years agoxof: Add identifiers for MGF1 XOFs based on SHA-224/384
Tobias Brunner [Mon, 25 Sep 2017 16:15:35 +0000 (18:15 +0200)]
xof: Add identifiers for MGF1 XOFs based on SHA-224/384

2 years agogmp: Use helper to determine XOF type
Tobias Brunner [Mon, 25 Sep 2017 16:07:58 +0000 (18:07 +0200)]
gmp: Use helper to determine XOF type

2 years agoxof: Add helper to determine MGF1 XOF type from hash algorithm
Tobias Brunner [Mon, 25 Sep 2017 16:06:40 +0000 (18:06 +0200)]
xof: Add helper to determine MGF1 XOF type from hash algorithm

2 years agogcrypt: Add support for RSA-PSS signatures
Tobias Brunner [Mon, 25 Sep 2017 12:50:20 +0000 (14:50 +0200)]
gcrypt: Add support for RSA-PSS signatures

For salt lengths other than 20 this requires 0bd8137e68c2 ("cipher:
Add option to specify salt length for PSS verification."), which was
included in libgcrypt 1.7.0 (for Ubuntu requires 17.04).  As that makes
it pretty much useless for us (SHA-1 is a MUST NOT), we require that version
to even provide the feature.

2 years agogcrypt: Register supported RSA signature/verification schemes
Tobias Brunner [Mon, 25 Sep 2017 12:30:45 +0000 (14:30 +0200)]
gcrypt: Register supported RSA signature/verification schemes

2 years agoconfigure: Enable mgf1 plugin if gmp plugin is enabled
Tobias Brunner [Sat, 23 Sep 2017 14:32:03 +0000 (16:32 +0200)]
configure: Enable mgf1 plugin if gmp plugin is enabled

2 years agogmp: Add support for RSASSA-PSS signature verification
Tobias Brunner [Sat, 23 Sep 2017 14:25:20 +0000 (16:25 +0200)]
gmp: Add support for RSASSA-PSS signature verification

2 years agogmp: Add support for RSASSA-PSS signature creation
Tobias Brunner [Sat, 23 Sep 2017 13:33:11 +0000 (15:33 +0200)]
gmp: Add support for RSASSA-PSS signature creation

2 years agounit-tests: Add FIPS 186-4 RSASSA-PSS test vectors
Tobias Brunner [Sat, 23 Sep 2017 11:36:32 +0000 (13:36 +0200)]
unit-tests: Add FIPS 186-4 RSASSA-PSS test vectors

Since not all implementations allow setting a specific salt value when
generating signatures (e.g. OpenSSL doesn't), we are often limited to
only using the test vectors with salt length of 0.

We also exclude test vectors with SHA-1, SHA-224 and SHA-384.

2 years agounit-tests: Create and verify some RSA PSS signatures
Tobias Brunner [Sat, 23 Sep 2017 08:49:09 +0000 (10:49 +0200)]
unit-tests: Create and verify some RSA PSS signatures

2 years agoopenssl: Add support for verifying RSASSA-PSS signatures
Tobias Brunner [Sat, 23 Sep 2017 08:39:14 +0000 (10:39 +0200)]
openssl: Add support for verifying RSASSA-PSS signatures

2 years agoopenssl: Add support for creating RSASSA-PSS signatures
Tobias Brunner [Sat, 23 Sep 2017 08:01:57 +0000 (10:01 +0200)]
openssl: Add support for creating RSASSA-PSS signatures

2 years agoopenssl: Add helper to determine EVP_MD from hash_algorithm_t
Tobias Brunner [Sat, 23 Sep 2017 08:12:36 +0000 (10:12 +0200)]
openssl: Add helper to determine EVP_MD from hash_algorithm_t

2 years agounit-tests: Add FIPS 186-4 RSA test vectors
Tobias Brunner [Fri, 22 Sep 2017 17:37:54 +0000 (19:37 +0200)]
unit-tests: Add FIPS 186-4 RSA test vectors

Excluding SHA-224 and the stuff from FIPS 186-2 (SHA-1, 1024 bit keys).

2 years agogcrypt: Determine missing RSA private key parameters
Tobias Brunner [Fri, 22 Sep 2017 17:10:39 +0000 (19:10 +0200)]
gcrypt: Determine missing RSA private key parameters

We only need n, e, and d.  The primes p and q and the coefficient
for the Chinese remainder algorithm can be determined from these.

2 years agogmp: Determine missing RSA private key parameters
Tobias Brunner [Fri, 22 Sep 2017 15:49:00 +0000 (17:49 +0200)]
gmp: Determine missing RSA private key parameters

We only need n, e, and d.  The parameters for the Chinese remainder
algorithm and even p and q can be determined from these.

2 years agoopenssl: Add functions to determine missing RSA private key parameters
Tobias Brunner [Fri, 22 Sep 2017 13:47:11 +0000 (15:47 +0200)]
openssl: Add functions to determine missing RSA private key parameters

We only need n, e, and d.  The parameters for the Chinese remainder
algorithm and even p and q can be determined from these.

2 years agosignature-params: Add functions to parse/build ASN.1 RSASSA-PSS params
Tobias Brunner [Wed, 20 Sep 2017 13:21:51 +0000 (15:21 +0200)]
signature-params: Add functions to parse/build ASN.1 RSASSA-PSS params

2 years agohasher: Add function to determine length of hashes
Tobias Brunner [Fri, 22 Sep 2017 07:46:14 +0000 (09:46 +0200)]
hasher: Add function to determine length of hashes

2 years agoasn1: Add function to generate an ASN.1 integer from an uint64_t
Tobias Brunner [Wed, 20 Sep 2017 13:00:42 +0000 (15:00 +0200)]
asn1: Add function to generate an ASN.1 integer from an uint64_t

2 years agoasn1: Add OID for MGF1
Tobias Brunner [Tue, 19 Sep 2017 16:45:49 +0000 (18:45 +0200)]
asn1: Add OID for MGF1

2 years agosignature-params: Add struct for RSASSA-PSS parameters
Tobias Brunner [Tue, 19 Sep 2017 16:21:37 +0000 (18:21 +0200)]
signature-params: Add struct for RSASSA-PSS parameters

2 years agoprivate-key: Add optional parameters argument to sign() method
Tobias Brunner [Tue, 19 Sep 2017 15:26:58 +0000 (17:26 +0200)]
private-key: Add optional parameters argument to sign() method

2 years agopublic-key: Add optional parameters argument to verify() method
Tobias Brunner [Tue, 19 Sep 2017 15:15:18 +0000 (17:15 +0200)]
public-key: Add optional parameters argument to verify() method

2 years agopublic-key: Add RSASSA-PSS signature scheme identifier
Tobias Brunner [Tue, 19 Sep 2017 11:40:48 +0000 (13:40 +0200)]
public-key: Add RSASSA-PSS signature scheme identifier

2 years agoasn1: Add OID for RSASSA-PSS
Tobias Brunner [Tue, 19 Sep 2017 10:10:36 +0000 (12:10 +0200)]
asn1: Add OID for RSASSA-PSS

2 years agoikev2: Don't use SHA-1 for RFC 7427 signature authentication
Tobias Brunner [Tue, 19 Sep 2017 09:10:09 +0000 (11:10 +0200)]
ikev2: Don't use SHA-1 for RFC 7427 signature authentication

RFC 8247 demoted it to MUST NOT.

References #2427.

2 years agoproposal: Remove MODP-1024 from default IKE proposal
Tobias Brunner [Tue, 19 Sep 2017 09:04:37 +0000 (11:04 +0200)]
proposal: Remove MODP-1024 from default IKE proposal

RFC 8247 demoted it to SHOULD NOT. This might break connections with
Windows clients unless they are configured to use a stronger group or
matching weak proposals are configured explicitly on the server.

References #2427.

2 years agoproposal: Remove MD5 from default IKE proposal
Tobias Brunner [Tue, 19 Sep 2017 09:01:04 +0000 (11:01 +0200)]
proposal: Remove MD5 from default IKE proposal

RFC 8247 demoted MD5 to MUST NOT.

References #2427.

2 years agoproposal: Remove deprecated algorithms from default ESP and AH proposals
Tobias Brunner [Mon, 23 Oct 2017 13:33:02 +0000 (15:33 +0200)]
proposal: Remove deprecated algorithms from default ESP and AH proposals

This removes algorithms that were deprecated by RFC 8221 (3DES, BF, MD5)
from the default proposals for ESP and AH.

References #8247.

2 years agoconfigure: Fix check for libtpmtss to build it only when needed
Martin Willi [Tue, 17 Oct 2017 12:04:27 +0000 (14:04 +0200)]
configure: Fix check for libtpmtss to build it only when needed

Testing for x$tpm always yields true, hence libtpmtss is built even if it
is unneeded. Properly test against xtrue as we do in all other tests.

2 years agopool: Destroy enumerator before deleting existing pool
Tobias Brunner [Mon, 6 Nov 2017 09:29:56 +0000 (10:29 +0100)]
pool: Destroy enumerator before deleting existing pool

The MySQL client doesn't like overlapping queries on the same
connection, so we make sure to destroy the enumerator used to check for
an existing pool before deleting it when --replace is used.

2 years agokernel-pfkey: Support anti-replay windows > 2k
Tobias Brunner [Tue, 7 Nov 2017 13:26:14 +0000 (14:26 +0100)]
kernel-pfkey: Support anti-replay windows > 2k

FreeBSD 11.1 supports a new extension to configure larger anti-replay
windows, now configured as number of packets.

Fixes #2461.

2 years agokernel-pfkey: Don't include keys in SADB_UPDATE message to update IPs on FreeBSD
Tobias Brunner [Fri, 3 Nov 2017 08:37:44 +0000 (09:37 +0100)]
kernel-pfkey: Don't include keys in SADB_UPDATE message to update IPs on FreeBSD

The FreeBSD kernel explicitly rejects messages containing keys for mature SAs.

Fixes #2457.

2 years agoMerge branch 'vici-counters'
Tobias Brunner [Wed, 8 Nov 2017 15:28:49 +0000 (16:28 +0100)]
Merge branch 'vici-counters'

Refactors the IKE event counters feature of the stroke plugin into a separate
plugin, which allows to publish the numbers also via vici/swanctl.

2 years agoswanctl: Add --counters command
Tobias Brunner [Thu, 24 Aug 2017 15:44:45 +0000 (17:44 +0200)]
swanctl: Add --counters command

2 years agovici: Add 'get|reset-counters' commands
Tobias Brunner [Thu, 24 Aug 2017 15:41:37 +0000 (17:41 +0200)]
vici: Add 'get|reset-counters' commands

2 years agocounters: Move IKE event counter collection from stroke to a separate plugin
Tobias Brunner [Thu, 24 Aug 2017 15:02:37 +0000 (17:02 +0200)]
counters: Move IKE event counter collection from stroke to a separate plugin

2 years agosystime-fix: Add timeout option to stop waiting for valid system time
Tobias Brunner [Tue, 26 Sep 2017 08:32:04 +0000 (10:32 +0200)]
systime-fix: Add timeout option to stop waiting for valid system time

A certificate check is forced once the timeout is reached even if the
system time appears to be invalid.

2 years agoandroid: Add log message if failed to retrieve user certificate encoding
Tobias Brunner [Fri, 22 Sep 2017 06:41:10 +0000 (08:41 +0200)]
android: Add log message if failed to retrieve user certificate encoding

2 years agotesting: Fix output matching of lease time in ipsec pool utility
Tobias Brunner [Thu, 2 Nov 2017 10:32:52 +0000 (11:32 +0100)]
testing: Fix output matching of lease time in ipsec pool utility

2 years agoshunt-mananger: Make outbound FWD shunt policies optional
Tobias Brunner [Wed, 25 Oct 2017 11:24:01 +0000 (13:24 +0200)]
shunt-mananger: Make outbound FWD shunt policies optional

2 years agoike: Do not send initial contact only for UNIQUE_NEVER
Thomas Egerer [Wed, 25 Oct 2017 08:45:02 +0000 (10:45 +0200)]
ike: Do not send initial contact only for UNIQUE_NEVER

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2 years agopkcs11: Call C_Finalize() to cancel jobs waiting in C_WaitForSlotEvent()
Tobias Brunner [Fri, 6 Oct 2017 12:51:37 +0000 (14:51 +0200)]
pkcs11: Call C_Finalize() to cancel jobs waiting in C_WaitForSlotEvent()

This is not ideal as the call to C_Finalize() should be the last one via
the PKCS#11 API.  Since the order in which jobs are canceled is undefined
we can't be sure there is no other thread still using the library (it could
even be the canceled job that still handles a previous slot event).
According to PKCS#11 the behavior of C_Finalize() is undefined while other
threads still make calls over the API.

However, canceling the thread, as done previously, could also be problematic
as PKCS#11 libraries could hold locks while in the C_WaitForSlotEvent() call,
which might not get released properly when the thread is just canceled,
and which then might cause later calls to other API functions to block.

Fixes #2437.

2 years agopool: Make pool timeout configurable in other units than hours
Tobias Brunner [Thu, 17 Aug 2017 13:21:19 +0000 (15:21 +0200)]
pool: Make pool timeout configurable in other units than hours

2 years agoutils: Add helper function to parse time spans from strings
Tobias Brunner [Thu, 17 Aug 2017 13:04:14 +0000 (15:04 +0200)]
utils: Add helper function to parse time spans from strings

2 years agoasn1: Add additional OIDs seen in certificate DNs
Tobias Brunner [Wed, 18 Oct 2017 14:44:04 +0000 (16:44 +0200)]
asn1: Add additional OIDs seen in certificate DNs

2 years agoscripts: Add -d option to oid2der to decode DER encoded OIDs
Tobias Brunner [Wed, 18 Oct 2017 14:28:04 +0000 (16:28 +0200)]
scripts: Add -d option to oid2der to decode DER encoded OIDs

2 years agoman: Fix documentation of inbound mark behavior in ipsec.conf(5)
Tobias Brunner [Wed, 23 Aug 2017 09:41:50 +0000 (11:41 +0200)]
man: Fix documentation of inbound mark behavior in ipsec.conf(5)

2 years agovici: Make setting mark on inbound SA configurable
Tobias Brunner [Wed, 23 Aug 2017 09:25:52 +0000 (11:25 +0200)]
vici: Make setting mark on inbound SA configurable

2 years agochild-cfg: Optionally set mark on inbound SA
Tobias Brunner [Wed, 23 Aug 2017 09:22:50 +0000 (11:22 +0200)]
child-cfg: Optionally set mark on inbound SA

2 years agoeap-radius: Optionally send Class attributes in RADIUS accounting messages
Tobias Brunner [Mon, 23 Oct 2017 10:08:17 +0000 (12:08 +0200)]
eap-radius: Optionally send Class attributes in RADIUS accounting messages

If enabled, add the RADIUS Class attributes received in Access-Accept messages
to RADIUS accounting messages as suggested by RFC 2865 section 5.25.

Fixes #2451.

2 years agoikev2: Abort make-before-break reauth if we don't find children to recreate
Tobias Brunner [Tue, 26 Sep 2017 09:31:15 +0000 (11:31 +0200)]
ikev2: Abort make-before-break reauth if we don't find children to recreate

We do something similar in reestablish() for break-before-make reauth.
If we don't abort we'd be sending an IKE_AUTH without any TS payloads.

References #2430.

2 years agoopenssl: Also load EC keys from an ENGINE
Tobias Brunner [Wed, 6 Sep 2017 08:41:37 +0000 (10:41 +0200)]
openssl: Also load EC keys from an ENGINE

2 years agolibcharon: Added Cisco FlexVPN Supported VID
Andreas Steffen [Fri, 27 Oct 2017 18:14:43 +0000 (20:14 +0200)]
libcharon: Added Cisco FlexVPN Supported VID

2 years agounit-tests: Fix "using integer constants in boolean context" warning
Tobias Brunner [Mon, 23 Oct 2017 12:38:00 +0000 (14:38 +0200)]
unit-tests: Fix "using integer constants in boolean context" warning

This warning has been seen in GCC 7.x with -Wall, however, because == has
higher precedence than ?: the code was actually not correct.

2 years agostreams: Remove registered systemd stream service
Tobias Brunner [Wed, 18 Oct 2017 07:25:15 +0000 (09:25 +0200)]
streams: Remove registered systemd stream service

Fixes: 59db98fb941c ("stream: Add basic stream service for systemd sockets")

2 years agostreams: Named systemd sockets are only supported since systemd v227
Tobias Brunner [Thu, 12 Oct 2017 16:40:15 +0000 (18:40 +0200)]
streams: Named systemd sockets are only supported since systemd v227

2 years agostarter: Add the correct keywords header file to EXTRA_DIST
Tobias Brunner [Wed, 11 Oct 2017 16:10:46 +0000 (18:10 +0200)]
starter: Add the correct keywords header file to EXTRA_DIST

The fix for gperf in 0ae19f0ced8d added the generated header to
EXTRA_DIST but that's already added to the distribution because it is
contained in *_SOURCES, what was not added, though, was the .h.in file.

Also fixes the reference to the header file in the .c rule here and for
stroke in out-of-tree builds.

Fixes: 0ae19f0ced8d ("configure: Fix gperf length parameter determination")

2 years agowatcher: Don't notify watcher if removed FD was not found
Tobias Brunner [Thu, 7 Sep 2017 07:51:49 +0000 (09:51 +0200)]
watcher: Don't notify watcher if removed FD was not found

This can happen if a stream is used blocking exclusively (the FD is
never registered with watcher, but is removed in the stream's destructor
just in case it ever was - doing this conditionally would require an
additional flag in streams).  There may be no thread reading from
the read end of the notify pipe (e.g. in starter), causing the write
to the notify pipe to block after it's full.  Anyway, doing a relatively
expensive FD update is unnecessary if there were no changes.

Fixes #1453.

2 years agostream: Add basic stream service for systemd sockets
aszlig [Wed, 30 Aug 2017 00:36:34 +0000 (02:36 +0200)]
stream: Add basic stream service for systemd sockets

This allows systemd socket activation by passing URIs such as systemd://foo
to plugins such as VICI.

For example setting charon.plugins.vici.socket = systemd://vici, a
systemd socket file descriptor with the name "vici" will be picked up.

So these would be the corresponding unit options:

  [Socket]
  FileDescriptorName=vici
  Service=strongswan.service

  ListenStream=/run/charon.vici

The implementation currently is very basic and right now only the first
file descriptor for a particular identifier is picked up if there are
multiple socket units with the same FileDescriptorName.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Closes strongswan/strongswan#79.

2 years agostarter: Don't define any hard-coded proposal strings
Tobias Brunner [Wed, 30 Aug 2017 13:15:31 +0000 (15:15 +0200)]
starter: Don't define any hard-coded proposal strings

Just rely on the default proposals by charon if nothing is defined. The
hard-coded IKE proposal used curve25519, which depends on an optional
plugin (while enabled by default it might still not be loaded, or, like
on Debian, shipped in an optional package). With charon's default
proposal only loaded algorithms are proposed for IKE avoiding this issue.

2 years agoconfigure: Also check for libcrypto on Windows
Tobias Brunner [Wed, 30 Aug 2017 10:30:02 +0000 (12:30 +0200)]
configure: Also check for libcrypto on Windows

With OpenSSL 1.1.0 the library is now named libcrypto too on Windows.
Check for libeay32 first so we don't link against the build environment's
version of OpenSSL instead of the native one that might be available.