Commit Graph
8350 Commits
Author SHA1 Message Date
Reto Buerki 7fb3e5ed10 Add TKM_CTX_ISA (IKE SA context) 2013-03-19 15:23:46 +01:00
Reto Buerki fa22fc2419 Use remote PSK signature computed by TKM 2013-03-19 15:23:46 +01:00
Reto Buerki e7a497c307 keymat: Check for aes256-sha512 in derive_ike_keys
Return FALSE if peers try to use other algorithm combinations.
2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger 51fdbd0429 keymat: Call ike_isa_sign_psk in get_psk_sig
Get PSK signed AUTH octets from TKM in initiator case.
2013-03-19 15:23:46 +01:00
Reto Buerki e285544be2 Factor out AEAD transform creation
Introduce static aead_create_from_keys function to initialize AEAD
transforms from key chunks.
2013-03-19 15:23:46 +01:00
Reto Buerki 4be8471fab Add keymat IKE key derivation test case 2013-03-19 15:23:46 +01:00
Reto Buerki 3290b9995c keymat: Create inbound and outbound AEAD transforms
Create and initialize AEAD transforms with keys derived by the TKM.
Return these transforms in the get_aead function.

IKE keys used by charon are derived by TKM now.
2013-03-19 15:23:46 +01:00
Reto Buerki 4c38878db5 keymat: Extract enc,inc algorithms from proposal
Extract encryption and integrity algorithms from proposal and check them
before deriving IKE keys.
2013-03-19 15:23:46 +01:00
Reto Buerki fc828aaac6 keymat: Call TKM Isa_Create procedure 2013-03-19 15:23:46 +01:00
Reto Buerki 0327fac6b6 Implement chunk_to_sequence function
This function converts a given chunk to a variable-length byte sequence.
2013-03-19 15:23:46 +01:00
Reto Buerki 53232d5883 Implement sequence_to_chunk function
This function converts a given TKM variable-length byte sequence to
chunk.
2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger d61cea7524 keymat: Log nonce and DH context ids 2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger 528fc21ffe Add context id getter to TKM DH implementation 2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger ba0d7d9a76 keymat: Get context id of local nonce
To derive IKE keys using TKM the nonce context id of the local nonce is needed.
Get the id for a given chunk using the chunk map.
2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger 624178fece nonceg: Insert id mapping when allocating nonce 2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger 3242a178b3 Add chunk map
This data structure allows to store mappings of chunks to ids. This will
be used to map nonces to their corresponding nonce context ids.
2013-03-19 15:23:46 +01:00
Adrian-Ken Rueegsegger 601de9f36f Add context id getter to TKM nonce generator 2013-03-19 15:23:46 +01:00
Reto Buerki ebe592a393 id_manager: Use calloc instead of malloc
This way we don't need to manually initialize the slot status; free
slots are now indicated by 0 though.
2013-03-19 15:23:46 +01:00
Reto Buerki 1ee792f9ea Use ikev2 keymat proxy
Forward incoming calls to default ikev2 keymat instance. This is needed
to make a stepwise migration to TKM keymat possible. It will be removed
once the corresponding parts are implemented in the TKM.
2013-03-19 15:23:45 +01:00
Reto Buerki 5b3bcdfada Add skeleton for TKM keymat variant 2013-03-19 15:23:45 +01:00
Reto Buerki 84967b4439 id_manager: Use limits given by TKM 2013-03-19 15:23:45 +01:00
Reto Buerki 50e35e66d2 Pass context limits on to id manager 2013-03-19 15:23:45 +01:00
Reto Buerki ef5372395a Request limits from TKM on init 2013-03-19 15:23:45 +01:00
Reto Buerki 7aa573a50e id_manager: Use array of bool instead of list
Instead of storing the acquired context ids in a linked list, use an
array of booleans for the job. A boolean value of true in the array
designates an available context id.
2013-03-19 15:23:45 +01:00
Reto Buerki 49c513c1d9 Use id manager to acquire DH context id 2013-03-19 15:23:45 +01:00
Reto Buerki 65a777f7fb Add TKM_CTX_DH (Diffie-Hellman context) to id manager 2013-03-19 15:23:45 +01:00
Reto Buerki c38459d77d Use id manager to acquire nonce context id 2013-03-19 15:23:45 +01:00
Reto Buerki f3cd7f50de Add initial TKM Diffie-Hellman implementation
The tkm_diffie_hellman_t plugin acquires a DH context from the Trusted
Key Manager and uses it to get a DH public value and the calculated
shared secret. Proper context handling is still missing though, the
plugin currently uses context ID 1.

The get_shared_secret function will be removed as soon as the TKM
specific keymat is ready.
2013-03-19 15:23:45 +01:00
Reto Buerki d51305aa3f charon-tkm: Register tkm nonce generator 2013-03-19 15:23:45 +01:00
Reto Buerki 8e95bf455d tkm_nonceg: Return nonce generated by TKM 2013-03-19 15:23:45 +01:00
Reto Buerki 3d2746309e Initialize TKM client library in tkm.c 2013-03-19 15:23:45 +01:00
Reto Buerki 559fe48c50 Introduce TKM specific charon daemon (charon-tkm)
Analogous to charon-nm the charon-tkm daemon is a specialized charon
instance used in combination with the trusted key manager (TKM) written
in Ada.

The charon-tkm is basically a copy of the charon-nm code which will
register it's own TKM specific plugins.

The daemon binary is built using the gprbuild utility. This is needed
because it uses the tkm-rpc Ada library and consequently the Ada
runtime. gprbuild takes care of the complete binding and linker steps
required to properly initialize the Ada runtime.
2013-03-19 15:23:45 +01:00
Adrian-Ken Rueegsegger 4dc3ef94a1 starter: Make daemon name configurable
A daemon can be specified using the '--daemon' command line parameter. This
tells starter to invoke a daemon other than 'charon'.

Additionally the ipsec script uses the environment variable DAEMON_NAME to tell
the starter which daemon to use.
2013-03-19 15:23:45 +01:00
Tobias Brunner deafaf51f1 Load arbitrary (non-host) attributes from strongswan.conf
This allows to e.g. load Cisco-specific attributes that contain FQDNs.
2013-03-19 15:21:30 +01:00
Martin Willi 824864f4e0 Don't try to mmap() empty ipsec.secret files 2013-03-19 13:46:16 +01:00
Tobias Brunner 8a0a1ae857 Delete IKE_SAs if responder does not initiate XAuth exchange within a certain time frame 2013-03-19 12:00:00 +01:00
Tobias Brunner 3c34e15ee4 Make sure that xauth-noauth is not used accidentally
It has to be selected explicitly with rightauth2=xauth-noauth.
2013-03-19 11:23:03 +01:00
Tobias Brunner e4013bb904 Added xauth-noauth plugin
This XAuth backend does not do any authentication of client credentials
but simply sends a successful XAuth status to the client, thereby
concluding the XAuth exchange.  This can be useful to fallback to basic
RSA authentication with clients that can not be configured without XAuth
authentication.
2013-03-19 11:23:03 +01:00
Martin Willi 41131528a9 In stroke counters, check if we have an IKE_SA before getting the name from it
Fixes a segfault when receiving an invalid IKE SPI, where we don't have an
IKE_SA for the raised alert.
2013-03-19 11:20:35 +01:00
Martin Willi a0f1c4cf29 Add an "esp" load-tester option to configure custom CHILD_SA ESP proposal 2013-03-18 14:30:21 +01:00
Tobias Brunner 6cf79c1e9d Algorithms are not really specific to an IKE version
But not all of them can be used with IKEv1.

Fixes #314.
2013-03-18 12:20:47 +01:00
Martin Willi d29246cabe Merge branch 'radius-ext'
Bring some extensions to eap-radius, namely a virtual IP address provider based
on received Framed-IPs, forwarding of Cisco Unity banners, Interim Accounting
updates and the reporting of sent/received packets.
2013-03-18 10:13:36 +01:00
Martin Willi 048872f2f7 Merge branch 'stroke-counters'
Extend stroke counters functionality by connection specific counters, and
a resetcounters command to reset the global or connection counters.
2013-03-18 10:12:22 +01:00
Martin Willi e85c0f6b84 Merge branch 'stroke-timeout'
Add a strongswan.conf timeout option for stroke control commands.
2013-03-18 10:11:46 +01:00
Martin Willi cb14ecb1d3 Merge branch 'netlink-align'
Fixes some Netlink alignment issues, and then refactors Netlink XFRM message
attribute handling.
2013-03-18 10:09:35 +01:00
Martin Willi 94163816fa Use netlink_add_attribute() to copy over attributes during update_sa() 2013-03-15 16:02:01 +01:00
Martin Willi 0d9f31e1ed Use a helper function to add XFRM_MARK attribute 2013-03-15 16:02:01 +01:00
Martin Willi 6dfc633927 Use netlink_reserve() helper function in XFRM to simplify message construction 2013-03-15 16:02:01 +01:00
Martin Willi 6359ab04f4 Add a Netlink utility function to add a RTA header and reserve space for data 2013-03-15 14:32:51 +01:00
Martin Willi 53c98f098f Correctly check buffer length in netlink_add_attribute() 2013-03-15 14:32:25 +01:00