Commit Graph

14021 Commits

Author SHA1 Message Date
Martin Willi bace1d6479 diffie-hellman: Use bool instead of status_t as get_shared_secret() return value
While such a change is not unproblematic, keeping status_t makes the API
inconsistent once we introduce return values for the public value operations.
2015-03-23 17:54:02 +01:00
Martin Willi 4909612c3b load-tester: Migrate NULL DH implementation to INIT/METHOD macros 2015-03-23 17:54:02 +01:00
Tobias Brunner a7172ddaff ikev1: Make sure SPIs in an IKEv1 DELETE payload match the current SA
OpenBSD's isakmpd uses the latest ISAKMP SA to delete other expired SAs.
This caused strongSwan to delete e.g. a rekeyed SA even though isakmpd
meant to delete the old one.

What isakmpd does might not be standard compliant. As RFC 2408 puts
it:

  Deletion which is concerned with an ISAKMP SA will contain a
  Protocol-Id of ISAKMP and the SPIs are the initiator and responder
  cookies from the ISAKMP Header.

This could either be interpreted as "copy the SPIs from the ISAKMP
header of the current message to the DELETE payload" (which is what
strongSwan assumed, and the direction IKEv2 took it, by not sending SPIs
for IKE), or as clarification that ISAKMP "cookies" are actually the
SPIs meant to be put in the payload (but that any ISAKMP SA may be
deleted).
2015-03-23 17:23:57 +01:00
Tobias Brunner 8a0cc3f362 encoding: Add getter for IKE SPIs in IKEv1 DELETE payloads 2015-03-23 17:23:57 +01:00
Tobias Brunner 2872f77829 pki: Choose default digest based on the signature key 2015-03-23 17:22:31 +01:00
Tobias Brunner ae0604f583 pki: Use SHA-256 as default for signatures
Since the BLISS private key supports this we don't do any special
handling anymore (if the user choses a digest that is not supported,
signing will simply fail later because no signature scheme will be found).
2015-03-23 17:22:31 +01:00
Tobias Brunner 7fa03b308c trap-manager: Add option to ignore traffic selectors from acquire events
The specific traffic selectors from the acquire events, which are derived
from the triggering packet, are usually prepended to those from the
config.  Some implementations might not be able to handle these properly.

References #860.
2015-03-23 15:55:28 +01:00
Tobias Brunner cb461de2a2 unit-tests: Fix settings test after merging multi-line strings 2015-03-23 10:46:32 +01:00
Martin Willi d143e7b04b swanctl: Append /ESN to proposal for a CHILD_SA using Extended Sequence Numbers
We previously printed just the value for the "esn" keyword, which is "1", and
not helpful as such.

Fixes #904.
2015-03-23 10:15:07 +01:00
Martin Willi e284a861b8 unit-tests: Depend on SHA1/SHA256 features for mgf1 test cases 2015-03-23 09:53:34 +01:00
Tobias Brunner a83d1245d8 man: More accurately describe features of the new parser in ipsec.conf(5) 2015-03-20 18:37:22 +01:00
Tobias Brunner d148c7ab6c settings: Merge quoted strings that span multiple lines 2015-03-20 18:37:22 +01:00
Tobias Brunner 79ebdc0788 starter: Merge quoted strings that span multiple lines 2015-03-20 18:37:22 +01:00
Tobias Brunner 2ed5f5693d encoding: Don't verify length of IKEv1 KE payloads
The verification introduced with 84738b1aed ("encoding: Verify the length
of KE payload data for known groups") can't be done for IKEv1 as the KE
payload does not contain the DH group.
2015-03-20 16:37:59 +01:00
Tobias Brunner d2f4345b03 charon-systemd: Optionally load plugin list from charon-systemd.load 2015-03-19 18:37:24 +01:00
Martin Willi 945fdeb918 apidoc: Limit INPUT to src subdirectory and README.md
While 0909bf6c explicitly includes the whole source tree (to cover README.md),
this has the unpleasant side effect of covering a workspace under "testing"
with all its sources, or any other potential subdirectory that exists.
2015-03-19 12:17:03 +01:00
Martin Willi b546a98e0a utils: Fix enum_flags_to_string parameter name to match Doxygen description 2015-03-19 12:14:30 +01:00
Martin Willi fd6cc7f243 attr-sql: Rename sql_attribute_t to attr_sql_provider_t
As the plugin has its origins in the sql plugin, it still uses the naming
scheme for the attribute provider implementation. Rename the class to better
match the naming scheme we use in any other plugin
2015-03-19 11:24:31 +01:00
Tobias Brunner 31be582399 ikev1: Adopt virtual IPs on new IKE_SA during re-authentication
Some clients like iOS/Mac OS X don't do a mode config exchange on the
new SA during re-authentication.  If we don't adopt the previous virtual
IP Quick Mode rekeying will later fail.

If a client does do Mode Config we directly reassign the VIPs we migrated
from the old SA, without querying the attributes framework.

Fixes #807, #810.
2015-03-19 10:32:06 +01:00
Tobias Brunner 5c6a62ceb6 ikev1: Mark rekeyed CHILD_SAs as INSTALLED
Since we keep them around until they finally expire they otherwise would block
IKE_SA rekeying/reauthentication.
2015-03-19 10:24:15 +01:00
Tobias Brunner 7d02f8dbf4 mem-pool: Remove entries without online or offline leases
This avoids filling up the hash table with unused/old identities.

References #841.
2015-03-19 09:55:56 +01:00
Tobias Brunner f30be6a92f kernel-handler: Log new endpoint if NAT mapping changed 2015-03-19 09:54:10 +01:00
Tobias Brunner 46188b0eb0 child-sa: Remove policies before states to avoid acquire events for untrapped policies 2015-03-19 09:54:03 +01:00
Martin Willi c5f4e7c69e Merge branch 'vici-python'
Introduce a Python Egg for the vici plugin, contributed by Björn Schuberg.
2015-03-18 15:03:28 +01:00
Martin Willi 2185c29b65 NEWS: Introduce vici Python Egg 2015-03-18 14:29:46 +01:00
Martin Willi 75a8457922 travis: Install pip to install pytest in "all" tests
This allows ./configure to detect py.test, and execute python unit tests we
provide in the vici python egg.
2015-03-18 14:29:45 +01:00
Björn Schuberg 2e74aa0a91 vici: Add support for python 3 2015-03-18 13:59:15 +01:00
Martin Willi c7e3c5943f vici: Execute python tests during "check" if py.test is available 2015-03-18 13:59:15 +01:00
Martin Willi 07302b2f7c configure: Check optional py.test availability when building with python eggs 2015-03-18 13:59:15 +01:00
Björn Schuberg c193b5947a vici: Add test of Packet layer in python library 2015-03-18 13:59:15 +01:00
Björn Schuberg 9b97029a5f vici: Add test of Message (de)serialization in python library 2015-03-18 13:59:15 +01:00
Martin Willi b5d17e55d7 vici: Evaluate Python streamed command results, and raise CommandException 2015-03-18 13:59:14 +01:00
Martin Willi 90c5b48c96 vici: Catch Python GeneratorExit to properly cancel streamed event iteration 2015-03-18 13:59:14 +01:00
Martin Willi 288b654173 vici: Fall back to heap buffer when vararg printing on stack fails
This avoids failures when building log event messages including larger hexdumps.
2015-03-18 13:59:14 +01:00
Martin Willi a47e431ba9 vici: Return a Python generator instead of a list for streamed responses
In addition that it may reduce memory usage and improve performance for large
responses, it returns immediate results. This is important for longer lasting
commands, such as initiate/terminate, where immediate log feedback is preferable
when interactively calling such commands.
2015-03-18 13:59:14 +01:00
Martin Willi 90e16837ba vici: Raise a Python CommandException instead of returning a CommandResult 2015-03-18 13:59:14 +01:00
Martin Willi 871cffa141 vici: Add initial Python egg documentation to README 2015-03-18 13:59:14 +01:00
Martin Willi 305023a27d vici: Use OrderedDict to handle vici responses in Python library
The default Python dictionaries are unordered, but order is important for some
vici trees (for example the order of authentication rounds).
2015-03-18 13:59:14 +01:00
Martin Willi 94bb26fae3 vici: Return authentication rounds with unique names
To simplify handling of authentication rounds in dictionaries/hashtables on the
client side, we assign unique names to each authentication round when listing
connection.
2015-03-18 13:59:14 +01:00
Martin Willi d1ad65f7b2 vici: Rebuild ruby gem on source file changes 2015-03-18 13:59:14 +01:00
Martin Willi fb8b119cfa vici: Use default Unix vici socket if none passed to ruby constructor
While we currently have a static path instead of one generated with Autotools,
this at least is congruent to what we have in the Python library.
2015-03-18 13:59:14 +01:00
Martin Willi 61fb10c8cf vici: Support non-Unix sockets for vici connections using Python 2015-03-18 13:59:14 +01:00
Martin Willi 358793389a vici: Add python egg setuptools building and installation using easy_install
An uninstall target is currently not supported, as there is no trivial way with
either plain setuptools or with easy_install. pip would probably be the best
choice, but we currently don't depend on it.
2015-03-18 13:59:14 +01:00
Martin Willi 1e2ec9f96a vici: Generate a version specific setup.py for setuptools installation 2015-03-18 13:59:14 +01:00
Martin Willi 2c8c52c4e2 vici: Include python package in distribution 2015-03-18 13:59:14 +01:00
Martin Willi 374b3db191 configure: Add --enable-python-eggs and --with-pythoneggdir options
Detect easy_install for Python egg installation to install any egg we provide
in strongSwan.
2015-03-18 13:59:13 +01:00
Björn Schuberg 163e15a571 vici: Add python package MIT license 2015-03-18 13:59:13 +01:00
Björn Schuberg b269c1a89a vici: Expose Session as a top-level symbol in python package 2015-03-18 13:59:13 +01:00
Björn Schuberg 6a31a0f60c vici: Introduce main API Session class in python package 2015-03-18 13:59:13 +01:00
Björn Schuberg 8c089cddef vici: Add a python vici command execution handler 2015-03-18 13:59:13 +01:00