Commit Graph

10808 Commits

Author SHA1 Message Date
Tobias Brunner e8526ae991 Removed unused variable 'id' 2013-03-19 16:37:40 +01:00
Tobias Brunner 5e551da16b Properly cleanup libmysql
Seems to work correctly with recent MySQL versions.
2013-03-19 16:33:07 +01:00
Tobias Brunner 2ac772a5d0 Use proper address family when adding multiple addresses to SQL pool 2013-03-19 16:33:07 +01:00
Tobias Brunner fe62707209 Ignore SQL-based IP address pools if their address family does not match 2013-03-19 16:33:07 +01:00
Tobias Brunner 1b33e6c4ca charon-nm: Add dependencies to CERT_DECODE and PRIVKEY plugin features
This ensures the NM-specific credential set is unloaded before any
implementation of certificate/key objects, which causes a segmentation
fault during shutdown.
2013-03-19 16:25:26 +01:00
Tobias Brunner 3651c8dcd5 charon-nm: Prevent NM from changing the default route
This is not required as we install our own (narrow) route(s) in our own
routing table. This should allow split tunneling if configured on the
gateway.
2013-03-19 16:25:26 +01:00
Tobias Brunner 9cf09ecad7 charon-nm: Use VIP (if any) as local address
NM will install this address on the provided device.
2013-03-19 16:25:26 +01:00
Tobias Brunner c15eea7306 charon-nm: Pass a dummy TUN device to NetworkManager
NetworkManager modifies the addresses etc. on this interface so using
"lo" is not optimal. With the dummy interface NM is free to do its
thing.
2013-03-19 16:25:26 +01:00
Tobias Brunner b7645a5d30 charon-nm: Fix NM plugin utility macros 2013-03-19 16:25:26 +01:00
Tobias Brunner e7017a6bb9 Ignore 'compile' script which is generated by AM_PROG_CC_C_O 2013-03-19 16:19:11 +01:00
Tobias Brunner 68bfee4bc4 Avoid returning COOKIEs right after system boot
When the monotonic timer is initialized to 0 right after the system is
booted the daemon responded with COOKIES for COOKIE_CALMDOWN_DELAY (10s).

Since the COOKIE verification code actually produces an overflow for
COOKIE_LIFETIME (10s) it wouldn't even accept properly returned COOKIEs.

Checking for last_cookie makes sense anyway as that condition must only
apply if we actually sent a COOKIE before.
2013-03-19 16:19:11 +01:00
Martin Willi 2071dd63d6 Fix scheduling of heartbeat sending in HA plugin
e0efd7c1 switches to automated job rescheduling for HA heartbeat. However,
send_status() is initially called directly, which will not reschedule the job
as required.
2013-03-19 15:48:27 +01:00
Martin Willi 5cf3afd1fa Fix compiler warning in HA plugin 2013-03-19 15:48:27 +01:00
Tobias Brunner 7f0f185bed Merge branch 'tkm'
This adds charon-tkm a special build of the charon IKEv2 daemon that delegates
security critical operations to a separate process (TKM = Trusted Key Manager).
2013-03-19 15:25:38 +01:00
Adrian-Ken Rueegsegger 7cc6fa1a98 Various stylistic fixes 2013-03-19 15:24:36 +01:00
Reto Buerki db50a35ad8 Add NEWS about TKM separation 2013-03-19 15:24:36 +01:00
Adrian-Ken Rueegsegger c57b7a66c3 Use network byte order for ESA SPIs 2013-03-19 15:23:51 +01:00
Adrian-Ken Rueegsegger e2928a3e8c Provide MODP-2048 through TKM DH plugin 2013-03-19 15:23:51 +01:00
Adrian-Ken Rueegsegger 7f21523abd Add charon-tkm API documentation 2013-03-19 15:23:51 +01:00
Reto Buerki 0063e03325 Do not hardwire keys to KEY_RSA
Make the TKM private and public keys more easily extendable by
determining the associated key type dynamically.
2013-03-19 15:23:51 +01:00
Reto Buerki 38c1fd3cb1 Provide TKM credential encoder
The TKM credential encoder creates fingerprints of type
KEYID_PUBKEY_INFO_SHA1 and KEYID_PUBKEY_SHA1 using
CRED_PART_RSA_PUB_ASN1_DER.

This makes the pkcs1 plugin unnecessary.
2013-03-19 15:23:51 +01:00
Reto Buerki 1b22565ba5 Switch to openssl plugin 2013-03-19 15:23:51 +01:00
Reto Buerki 8484f2bc5c Implement multiple-clients integration test
Two transport connections to gateway sun are set up, one from client
carol and the other from client dave. The gateway sun uses the Trusted
Key Manager (TKM) and is the responder for both connections. The
authentication is based on X.509 certificates. In order to test the
connections, both carol and dave ping gateway sun.
2013-03-19 15:23:51 +01:00
Reto Buerki a520e4a010 Implement net2net-xfrmproxy integration test 2013-03-19 15:23:50 +01:00
Reto Buerki 847d320950 Implement net2net-initiator integration test 2013-03-19 15:23:50 +01:00
Reto Buerki d8b2064a34 Add xfrm_proxy integration test 2013-03-19 15:23:50 +01:00
Reto Buerki f10f7fe261 Provide script to build Ada XFRM proxy 2013-03-19 15:23:50 +01:00
Reto Buerki 3150dbd3e3 Add TKM responder integration test 2013-03-19 15:23:50 +01:00
Reto Buerki 117375ed00 Add initial TKM integration test
A connection between the hosts moon and sun is set up. The host moon
uses the Trusted Key Manager (TKM) and is the initiator of the transport
connection. The authentication is based on X.509 certificates.
2013-03-19 15:23:50 +01:00
Reto Buerki 7b702150a0 Add expect-file guest image script
This script can be used in pretest.dat files to wait until a given file
appears.
2013-03-19 15:23:50 +01:00
Reto Buerki 0e1d008d71 Add /usr/local/lib/ipsec to linker cache 2013-03-19 15:23:50 +01:00
Reto Buerki b491ee4ecd Provide recipes to build tkm and required libraries 2013-03-19 15:23:50 +01:00
Reto Buerki 3fc766d61e Add GNAT compiler and Ada libs to base image 2013-03-19 15:23:50 +01:00
Reto Buerki ae6f4ee39f Don't manually register kernel_netlink_net
Load complete kernel_netlink plugin instead. Registering the TKM
specific plugins first still ensures that the correct ipsec plugin
is used.

Lazy initialize the RNG_WEAK plugin to avoid the unsatisfiable
soft dependency on startup.
2013-03-19 15:23:50 +01:00
Reto Buerki 32b2ea9edb Move stroke plugin to the end of PLUGINS list
This fixes the problem of stroke being unable to load the ca
certificates on startup.
2013-03-19 15:23:50 +01:00
Reto Buerki 41eaaef79b Make sure IP_XFRM_POLICY is defined 2013-03-19 15:23:50 +01:00
Adrian-Ken Rueegsegger 89b1d5f32c Call isa_skip_create_first when keeping IKE SA
An ALERT_KEEP_ON_CHILD_SA_FAILURE alert is issued when child SA establishment
fails but the corresponding IKE SA is not destroyed. To allow later creation
of child SAs the ISA context must be signaled that the implicity first child SA
creation was skipped.
2013-03-19 15:23:50 +01:00
Adrian-Ken Rueegsegger 140a6b7b34 Make IKE and EES sockets configurable
The IKE and EES sockets are now read from strongswan.conf. They can be
specified like this:

charon-tkm {
	ike_socket = /tmp/tkm.rpc.ike
	ees_socket = /tmp/tkm.rpc.ees
}

The socket names given above are used by default if none are configured.
2013-03-19 15:23:50 +01:00
Reto Buerki f47ea969f8 Implement TKM-specific credential set
The TKM credential set extends the in-memory credential set. It
provides a private key enumerator which is used to instantiate private
key proxy objects on-demand. This allows the usage of private keys with
arbitrary identifiers.
2013-03-19 15:23:50 +01:00
Reto Buerki ec169572a0 Initialize libstrongswan in test_runner main() 2013-03-19 15:23:50 +01:00
Adrian-Ken Rueegsegger 9099d2ba0b Set ri_id to reqid when setting user certificate
Pass the reqid (of the first child config of an IKE SA) as remote identity id
when calling cc_set_user_certificate. May lead to the usage of the wrong id in
case an IKE SA has multiple child configurations/reqids.

This must be replaced with a proper lookup once the configuration backend is
implemented and provides remote identity ids to charon-tkm.
2013-03-19 15:23:49 +01:00
Adrian-Ken Rueegsegger 722d68803e Set sp_id to reqid when creating ESA
The reqid corresponds to the sp_id (security policy id) on the TKM side.
2013-03-19 15:23:49 +01:00
Adrian-Ken Rueegsegger 1c1400f007 Call Esa_Select after creation of child SA
This tells the TKM which child SA is the currently active SA.
2013-03-19 15:23:49 +01:00
Adrian-Ken Rueegsegger d2371b728c Check that chunk fits into sequence when converting 2013-03-19 15:23:49 +01:00
Reto Buerki 3360bad910 Remove result out parameter from EES Init
Error processing is done by the registered exception handler.
2013-03-19 15:23:49 +01:00
Adrian-Ken Rueegsegger 0f5e57fe26 Drop support for pre-shared key authentication 2013-03-19 15:23:49 +01:00
Reto Buerki c457128ab6 charon-tkm: Register TKM private key on startup 2013-03-19 15:23:49 +01:00
Reto Buerki 08d199fa3d Add TKM private key implementation
The key currently imitates the private key of alice@strongswan.org by
returning it's fingerprint in the get_fingerprint function.

This associates the private key with alice's X.509 cert and charon will
use it to create a signature over the local AUTH octets of the test
connection.

The private key serves as a proxy to the TKM ike_isa_sign operation and
extracts the required information from the auth octets chunk passed on
by the keymat.
2013-03-19 15:23:49 +01:00
Reto Buerki fe504b745d keymat: Store signature info in auth octets
Store the ISA context id and the initial message in the auth octets
chunk using the sign_info_t struct. Charon will pass on this information
to the TKM private key sign operation where it is extracted.
2013-03-19 15:23:49 +01:00
Reto Buerki a2f97ff860 Add AUTH signature info data structure
The sign_info_t type is used to transfer an ISA context id and the
initial message from the keymat to the TKM private key sign operation.
2013-03-19 15:23:49 +01:00