Commit Graph

11967 Commits

Author SHA1 Message Date
Tobias Brunner 5ef630189a Merge branch 'iv-gen'
Modularizes the generation of initialization vectors, which allows to use
different methods depending on the algorithms.  For instance for AES-GCM
sequential IVs are now used instead of the earlier random IVs, which are
still used for other algorithms e.g. AES-CBC.
2013-10-11 15:55:49 +02:00
Tobias Brunner 0c6f6c4e34 iv_gen: Mask sequential IVs with a random salt
This makes it harder to attack a HA setup, even if the sequence numbers were
not fully in sync.
2013-10-11 15:55:40 +02:00
Tobias Brunner e8229ad558 iv_gen: Provide external sequence number (IKE, ESP)
This prevents duplicate sequential IVs in case of a HA failover.
2013-10-11 15:55:40 +02:00
Tobias Brunner d74c254dfd ipsec: Use IV generator to encrypt ESP messages 2013-10-11 15:55:40 +02:00
Tobias Brunner b5010707a0 ikev2: Use IV generator to encrypt encrypted payload 2013-10-11 15:55:40 +02:00
Tobias Brunner 50bd28d549 iv_gen: aead_t implementations provide an IV generator 2013-10-11 15:55:40 +02:00
Tobias Brunner b3e1eb2afe iv_gen: Add IV generator that allocates IVs sequentially 2013-10-11 15:55:40 +02:00
Tobias Brunner 53d1f2dbfd iv_gen: Add IV generator that allocates IVs randomly
Uses RNG_WEAK as the code currently does elsewhere to allocate IVs.
2013-10-11 15:55:40 +02:00
Tobias Brunner 403057aa5a crypto: Add generic interface for IV generators 2013-10-11 15:55:40 +02:00
Tobias Brunner b38f7f703b apidoc: Move mac_prf to prf Doxygen group 2013-10-11 15:55:40 +02:00
Tobias Brunner af22622a9d Merge branch 'radius-unity'
Adds support for Cisco Unity specific RADIUS attributes.

References #383.
2013-10-11 15:52:36 +02:00
Tobias Brunner feb3c4ff22 eap-radius: Forward RAT_FRAMED_IP_NETMASK as INTERNAL_IP4_NETMASK 2013-10-11 15:52:22 +02:00
Tobias Brunner 1a809e46f8 eap-radius: Forward UNITY_SPLIT_INCLUDE or UNITY_LOCAL_LAN attributes
Depending on the value of the CVPN3000-IPSec-Split-Tunneling-Policy(55)
radius attribute, the subnets in the CVPN3000-IPSec-Split-Tunnel-List(27)
attribute are sent in either a UNITY_SPLIT_INCLUDE (if the value is 1)
or a UNITY_LOCAL_LAN (if the value is 2).

So if the following attributes would be configured for a RADIUS user

  CVPN3000-IPSec-Split-Tunnel-List := "10.0.1.0/255.255.255.0,10.0.2.0/255.255.255.0"
  CVPN3000-IPSec-Split-Tunneling-Policy := 1

A UNITY_SPLIT_INCLUDE configuration payload containing these two subnets
would be sent to the client during the ModeCfg exchange.
2013-10-11 15:52:22 +02:00
Tobias Brunner 66229619cf eap-radius: Forward UNITY_DEF_DOMAIN and UNITY_SPLITDNS_NAME attributes
The contents of the CVPN3000-IPSec-Default-Domain(28) and
CVPN3000-IPSec-Split-DNS-Names(29) radius attributes are forwarded in
the corresponding Unity configuration attributes.
2013-10-11 15:52:22 +02:00
Tobias Brunner 121c64f0d5 Merge branch 'dnscert'
The new dnscert plugin adds support for authentication via CERT resource
records that are protected with DNSSEC.
2013-10-11 15:49:24 +02:00
Tobias Brunner ca28e13fe8 testing: Add ikev2/net2net-dnscert scenario 2013-10-11 15:45:42 +02:00
Tobias Brunner a4d6a5a359 testing: Provide moon's and sun's certificate as CERT RR 2013-10-11 15:45:42 +02:00
Tobias Brunner 99a89ea7f4 testing: Enable dnscert plugin 2013-10-11 15:45:42 +02:00
Tobias Brunner 42525d1142 testing: Load testing.conf.local from the same directory as testing.conf 2013-10-11 15:45:42 +02:00
Ruslan N. Marchenko b638c131de dnscert: Add DNS CERT support for pubkey authentication
Add DNSSEC protected CERT RR delivered certificate authentication.
The new dnscert plugin is based on the ipseckey plugin and relies on the
existing PEM decoder as well as x509 and PGP parsers.  As such the plugin
expects PEM encoded PKIX(x509) or PGP(GPG) certificate payloads.

The plugin is targeted to improve interoperability with Racoon, which
supports this type of authentication, ignoring in-stream certificates
and using only DNS provided certificates for FQDN IDs.
2013-10-11 15:45:42 +02:00
Tobias Brunner 8ac54970f5 ipseckey: Properly handle failure to create a certificate
Also, try the next key (if available) if parsing an IPSECKEY failed.
2013-10-11 15:45:41 +02:00
Tobias Brunner e8130a9498 ipseckey: Refactor creation of certificate enumerator
Reduces nesting and fixes a memory leak (rrsig_enum).
2013-10-11 15:45:41 +02:00
Tobias Brunner de5ea570f1 ipseckey: Depend on plugin features to create public key and certificate objects 2013-10-11 15:45:41 +02:00
Tobias Brunner 6ecf1aab35 unbound: Add support for DLV (DNSSEC Lookaside Validation)
Fixes #392.
2013-10-11 15:45:25 +02:00
Tobias Brunner 1ff63f153e Merge branch 'fwmarks'
Allows setting a mark on outbound packets and the routing rule
installed by charon.  With those settings it is possible to setup
tunnels with kernel-libipsec where the remote peer is part of the remote
traffic selector.

The following example settings in strongswan.conf show how this can be
configured:

charon {
    plugins {
        kernel-netlink {
            fwmark = !0x42
        }
        socket-default {
            fwmark = 0x42
        }
        kernel-libipsec {
            allow_peer_ts = yes
        }
    }
}

To make it work it is necessary to set

  net.ipv4.conf.all.rp_filter

appropriately, otherwise the kernel drops the packets.

References #380.
2013-10-11 15:33:06 +02:00
Tobias Brunner cd25d291f7 kernel-libipsec: Don't ignore policies of type != POLICY_IPSEC
This actually broke rekeying due to the DROP policies that are
temporarily added, which broke the refcount as the ignored policies
were not ignored in del_policy() (the type is not known there).
2013-10-11 15:32:44 +02:00
Tobias Brunner eeb34af069 kernel-libipsec: Add an option to allow remote TS to match the IKE peer
Setting the fwmark options for the kernel-netlink and socket-default
plugins allow this kind of setup.

It is probably required to set net.ipv4.conf.all.rp_filter to 2 to make
it work.
2013-10-11 15:32:44 +02:00
Tobias Brunner 80f8b3a6d8 socket-default: Allow setting firewall mark on outbound packets 2013-10-11 15:32:44 +02:00
Tobias Brunner 51fefe4606 kernel-netlink: Allow setting firewall marks on routing rule 2013-10-11 15:32:44 +02:00
Tobias Brunner 434e530f75 ipsec_types: Add utility function to parse mark_t from strings 2013-10-11 15:32:44 +02:00
Tobias Brunner 6d7710a744 Merge branch 'database-transactions'
This adds support for transactions to the database_t interface and the two
current implementations.

The pool utility is also moved to its own directory in src/.
2013-10-11 15:29:30 +02:00
Tobias Brunner bd085dd978 attr-sql: Use a serializable transaction when inserting identities 2013-10-11 15:29:10 +02:00
Tobias Brunner b283a6e9ef database: Add support for serializable transactions 2013-10-11 15:29:10 +02:00
Tobias Brunner e745f5f69f sql: Don't use MyISAM engine and set collation/charset for all tables
The MyISAM engine doesn't support transactions.
2013-10-11 15:16:05 +02:00
Tobias Brunner 03c801cb2b pool: Change transaction handling 2013-10-11 15:16:05 +02:00
Tobias Brunner ec6ad6b086 pool: Move the pool utility to its own directory in src 2013-10-11 15:16:05 +02:00
Tobias Brunner 5abe3c52d3 attr-sql: Handle concurrent insertion of identities
If the same identity is added concurrently by two threads (or by the
pool utility) INSERT might fail even though the SELECT was unsuccessful
before.

We are currently not able to lock the identities table in a portable way
(something like SELECT ... FOR UPDATE on MySQL).
2013-10-11 15:16:05 +02:00
Tobias Brunner 4b8b1354ce attr-sql: Don't use database transactions in create_attribute_enumerator
There could, of course, be race conditions when enumerating the attributes,
but those probably don't matter (e.g. missing an attribute that was
concurrently added).

Transactions are more intended to revert multiple changes if anything
fails in the process.
2013-10-11 15:16:05 +02:00
Tobias Brunner fad11d602d sqlite: Implement transaction handling 2013-10-11 15:16:05 +02:00
Tobias Brunner f3cb889c9b mysql: Implement transaction handling 2013-10-11 15:16:04 +02:00
Tobias Brunner 947b76cda8 database: Add interface to handle transactions 2013-10-11 15:16:04 +02:00
Tobias Brunner 5f6a40827e mysql: Ensure connections are properly released in multi-threaded environments 2013-10-11 15:16:04 +02:00
Tobias Brunner ec91f15e3b crypto-factory: Try next available RNG implementation if constructor fails 2013-10-11 15:13:25 +02:00
Tobias Brunner 2e22333fbc crypto-factory: Order entries by algorithm identifier and (optionally) speed 2013-10-11 15:13:25 +02:00
Tobias Brunner e2c9a03d15 Remove HASH_PREFERRED, usages are replaced with HASH_SHA1, which is required for IKEv2 anyway 2013-10-11 15:13:25 +02:00
Tobias Brunner 3473cbab9c vstr: Forward actual field width
fmt_field_width is a flag that indicates if a field width
is defined in obj_field_width.
2013-10-11 15:12:16 +02:00
Martin Willi fc566632da unit-tests: support testing when leak-detective has not been enabled 2013-10-11 15:12:16 +02:00
Martin Willi 390d2b50b3 NEWS: Updates for the ah, libipsec-usestats and printf-hook merges 2013-10-11 11:42:13 +02:00
Martin Willi 5900d6d469 Merge branch 'printf-hook'
Adds a custom printf hook implementation as a fallback if neither the glibc
style hooks nor vstr is available. This can avoid the Vstr dependency on some
systems at the cost of slower and less complete printf functions.
2013-10-11 11:12:38 +02:00
Martin Willi 795cbb98c6 printf-hook-builtin: Print NaN/Infinity floating point values as such 2013-10-11 11:06:09 +02:00