Commit Graph

52 Commits

Author SHA1 Message Date
Tobias Brunner 1b67166921 Unify format of HSR copyright statements 2018-05-23 16:32:53 +02:00
Tobias Brunner 2307bffe56 proposal: Move proposal_t from libcharon to libstrongswan
This allows us to use it without having to initialize libcharon, which
was required for the logging (we probably could have included debug.h
instead of daemon.h to workaround that but this seems more correct).
2017-11-17 18:09:54 +01:00
Adrian-Ken Rueegsegger c198ddcb3f charon-tkm: Return current refcount when releasing ID 2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 1b2a8d963a charon-tkm: Add acquire_ref method to ID manager
The function acquires a reference to the given context reference id for
a specific context kind.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger c15dbfaf08 charon-tkm: Build fix for kernel SAD tests
Commit 7729577... added a flag to the get_esa_id function but the unit
tests were not adjusted.
2017-08-14 18:35:37 +02:00
Tobias Brunner 772957778c charon-tkm: Call esa_reset() when the inbound SA is deleted
After a rekeying the outbound SA and policy is deleted immediately, however,
the inbound SA is not removed until a few seconds later, so delayed packets
can still be processed.

This adds a flag to get_esa_id() that specifies the location of the
given SPI.
2017-08-07 10:46:00 +02:00
Tobias Brunner dbaeaaf605 charon-tkm: Remove unused get_other_esa_id() method 2017-08-07 10:46:00 +02:00
Tobias Brunner 9665686bd8 daemon: Use separate method to set default loggers
This way it is not necessary to pass the same values to reload the
loggers.
2017-01-25 14:58:09 +01:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Tobias Brunner 28649f6d91 libhydra: Remove empty unused library 2016-03-03 17:36:11 +01:00
Tobias Brunner 8394ea2a42 libhydra: Move kernel interface to libcharon
This moves hydra->kernel_interface to charon->kernel.
2016-03-03 17:36:11 +01:00
Martin Willi ee9f691915 unit-tests: Forward variable argument list in TEST_SUITE_DEPEND
For some plugin features, such as crypters or AEADs, we have some additional
feature arguments, such as the key size.
2015-07-12 13:25:50 +02:00
Adrian-Ken Rueegsegger 38b65d7186 charon-tkm: Also store local SPI in SAD 2015-05-04 18:07:52 +02:00
Reto Buerki 8cdc563258 charon-tkm: Reset stale nonce contexts
If the nonce generator detects a stale nonce upon destroy(), it resets
the context in the TKM and releases associated resources in the ID
manager and chunk map.

Also, do not acquire the nonce context ID in tkm_nonceg_create function
but rather when the nonce is actually created by get_nonce().

The nonces created with get_nonce must also be registered in the chunk map.
2015-05-04 18:07:51 +02:00
Reto Buerki a8ca50e635 charon-tkm: Drop unneeded nonceg get_id function 2015-05-04 18:07:51 +02:00
Adrian-Ken Rueegsegger c7ce0d96cd charon-tkm: Add get_other_esa_id function to TKM kernel SAD
The function gets the ESA id for another entry associated with the same
security policy as the specified ESA.
2015-05-04 18:07:50 +02:00
Martin Willi a777155ffe diffie-hellman: Add a bool return value to set_other_public_value() 2015-03-23 17:54:03 +01:00
Martin Willi 42431690e0 diffie-hellman: Add a bool return value to get_my_public_value() 2015-03-23 17:54:03 +01:00
Reto Buerki e12ff07c96 charon-tkm: Add get_dst_host getter to SAD
This function returns the destination host of an SAD entry for given
reqid, spi and protocol arguments or NULL if not found.
2015-02-20 13:34:53 +01:00
Reto Buerki f5fc592ae1 charon-tkm: Store reqid in SAD 2015-02-20 13:34:53 +01:00
Reto Buerki e63cbb367c charon-tkm: Fix logger entity name in tests.c
Change 'test_runner' to 'test-runner'.
2015-02-20 13:34:52 +01:00
Martin Willi 5421092b75 plugin-loader: Support a reload() callback for static features 2014-09-22 13:55:12 +02:00
Tobias Brunner 1c306c0ee9 libcharon: Remove unused charon->name 2014-02-12 14:34:33 +01:00
Tobias Brunner 9222bfc695 charon-tkm: Use lib->ns instead of charon->name 2014-02-12 14:34:32 +01:00
Tobias Brunner 10c4f4e1fd libhydra: Remove unused hydra->daemon 2014-02-12 14:34:32 +01:00
Martin Willi b034131555 unit-tests: Pass a test suite collection name to print during test execution
As we except to get more and more test runners for the different components,
we add a name to easily identify them on the test output.
2014-01-22 15:34:53 +01:00
Adrian-Ken Rueegsegger 6db7feacf6 charon-tkm: Implement IANA DH Id to TKM Id mapping
The TKM Diffie-Hellman plugin now maps IANA DH identifiers to TKM DH
algorithm identifiers. The mapping is specified in the daemon's
'dh_mapping' section in the strongswan.conf file:

dh_mapping {
	iana_id1 = tkm_id1
	iana_id2 = tkm_id2
	iana_id3 = tkm_id3
	...
}

Only the mapped IANA IDs are registered as supported DH groups.
2013-12-03 11:58:53 +01:00
Tobias Brunner d6032bff8b charon-tkm: Migrate tests to our own test runner
Due to problems with the external libraries tkm_init/deinit can't be
called for each test case.  Because of this leak detective has to be
disabled for these tests.
2013-11-27 18:35:44 +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 ec169572a0 Initialize libstrongswan in test_runner main() 2013-03-19 15:23:50 +01:00
Adrian-Ken Rueegsegger 464eb54ba4 Add TKM_CTX_CC (Certificate chain context id) 2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger 0f0165c81f Add typelen parameter to chunk_to_sequence function
The parameter is used to initialize the given sequence to zero.
2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger 62b625430e Let tkm_keymat_t extend keymat_v2_t 2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger e472129aa3 Add test for keymat derive_child_keys operation 2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger 1e13904f45 Implement TKM kernel SA database (SAD)
The TKM kernel SAD (security association database) stores information
about CHILD SAs.
2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger d1c0822759 Add TKM_CTX_ESA (ESP SA context id) 2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger d0ab667c99 Use rng to generate local ESP SPIs 2013-03-19 15:23:48 +01:00
Adrian-Ken Rueegsegger 6ed5c3bb1e charon-tkm: Register kernel_netlink_net
Explicitly register kernel netlink net implementation and avoid loading
the whole kernel-netlink plugin since the kernel netlink ipsec part is
unwanted.
2013-03-19 15:23:48 +01:00
Reto Buerki d91acfdb5d Add ISA context id getter to TKM keymat 2013-03-19 15:23:47 +01:00
Reto Buerki c755645032 Add TKM_CTX_AE (Authenticated Endpoint context) 2013-03-19 15:23:47 +01:00
Reto Buerki 7fb3e5ed10 Add TKM_CTX_ISA (IKE SA context) 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 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 528fc21ffe Add context id getter to TKM DH implementation 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 50e35e66d2 Pass context limits on to id manager 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 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