Tobias Brunner
d517a9893e
settings: Log all errors on level 1
...
Closes #539 .
2014-03-04 13:30:09 +01:00
Tobias Brunner
af15c71bfb
configure: Fix autoreconf with older autotools
...
Older autoconf versions (e.g. on CentOS 6.5) produce an empty else block
for the removed empty argument, which the shell then trips over when
executing ./configure.
Fixes #536 .
2014-03-03 17:14:26 +01:00
Tobias Brunner
bd1c9f1eac
conf: Fix out-of-tree build from distribution
...
It worked from the repository, where strongswan.conf.5.main is generated
in the build dir, but not from the distribution where it is located in
the source dir, so explicitly create it in the source dir.
2014-02-27 12:02:13 +01:00
Tobias Brunner
2ed241aeb3
utils: Add memrchr(3) replacement for platforms that don't support it
...
For instance, on Mac OS X memrchr(3) is not provided by the C library.
2014-02-26 11:05:07 +01:00
Tobias Brunner
625fc60154
Merge branch 'dirname'
...
Fixes the incorrect usage of dirname(3) in settings_t and stroke_cred_t,
and adds thread-safe variants of dirname(3) and basename(3).
2014-02-24 12:04:24 +01:00
Tobias Brunner
6b895d7b25
libpts: Use path_base|dirname()
2014-02-24 12:04:11 +01:00
Tobias Brunner
9222d58634
conftest: Use path_dirname()
2014-02-24 12:04:11 +01:00
Tobias Brunner
849e401b37
stroke: Use thread-safe dirname(3)
2014-02-24 12:04:11 +01:00
Tobias Brunner
18019a3b89
settings: Use thread-safe dirname(3)
2014-02-24 12:04:11 +01:00
Tobias Brunner
766141bc77
utils: Add thread-safe variants of dirname(3) and basename(3)
2014-02-24 12:04:11 +01:00
Tobias Brunner
ba10cd3c7f
utils: Move thread-safe strerror replacement to a separate file
...
For some utils _GNU_SOURCE might be needed but that conflicts with the
signature of strerror_r(3).
2014-02-24 12:04:10 +01:00
Tobias Brunner
aa693d763a
stroke: Use dirname(3) correctly
2014-02-24 12:04:10 +01:00
Tobias Brunner
caf1770905
settings: Use dirname(3) correctly
...
dirname(3) may return a pointer to a statically allocated buffer.
So freeing the returned value can result to undefined behavior. This was
noticed on FreeBSD where it caused very strange crashes.
It is also not thread-safe, which will be addressed later.
2014-02-24 12:03:49 +01:00
Tobias Brunner
ab13364c65
uclibc only defines strndup(3) if _GNU_SOURCE is defined
...
References #516 .
2014-02-19 16:11:47 +01:00
Tobias Brunner
09417da49c
sshkey: uclibc only defines fmemopen(3) if _GNU_SOURCE is defined
...
Fixes #516 .
2014-02-19 15:55:20 +01:00
Tobias Brunner
6122bfd2eb
coverage: Apparently not all shells can expand {src,scripts}
...
One example is ash.
2014-02-19 15:53:59 +01:00
Tobias Brunner
435aed8287
pki: Fix minor resource leak on failure to read the private key in --req
2014-02-18 16:46:25 +01:00
Tobias Brunner
5a04056295
stroke: Use proper modifiers to print size_t arguments
2014-02-18 16:46:25 +01:00
Tobias Brunner
65ee857a88
android: Don't limit number to packets during EAP-TTLS
2014-02-18 11:32:37 +01:00
Tobias Brunner
7867ae42ab
lookip: Properly return from disconnect callback job
...
References #518 .
2014-02-18 11:21:51 +01:00
Tobias Brunner
21cfbce0c2
Doxygen: Sort group names alphabetically
2014-02-18 10:45:51 +01:00
Tobias Brunner
4ab38d98a7
Fixed some typos
2014-02-18 10:36:25 +01:00
Tobias Brunner
86865da388
plugin-loader: Escape <ns> in comment as Doxygen sees this as XML tag
2014-02-18 10:18:54 +01:00
Tobias Brunner
1281c297d9
unit-tests: Ignore tests not test_runner
2014-02-18 10:09:30 +01:00
Tobias Brunner
e1af4d88a6
conf: Ignore generated strongswan.conf.5.main
2014-02-18 10:08:54 +01:00
Tobias Brunner
5645ad2976
conf: Fix installation on FreeBSD
...
Apparently, the -t option for install is not portable.
2014-02-13 13:53:25 +01:00
Tobias Brunner
c2d5add6ce
NEWS: Add strongswan.conf changes and IPComp fixes
2014-02-13 11:47:13 +01:00
Tobias Brunner
03650d5a2d
conf: The use of $^ is not portable
...
Generating strongswan.conf.5.main in a subshell gets the file
properly written to the builddir in out-of-tree builds.
2014-02-13 11:47:02 +01:00
Tobias Brunner
6477e64a8d
printf-hook-glibc: printf.h on FreeBSD 10 does not include stdargs.h
2014-02-13 10:46:52 +01:00
Tobias Brunner
593251fcf6
array: Fix compilation on FreeBSD
2014-02-13 10:46:46 +01:00
Tobias Brunner
5501503618
Merge branch 'modular-load'
...
Introduces a new configuration file layout. strongswan.conf is now only
very simple and mainly includes the config snippets from the strongswan.d
and strongswan.d/charon directories (the latter containing snippets for
individual plugins).
Config snippets with commented defaults are generated for all currently
defined settings and are installed if they don't exist yet and the
respective plugin/component is enabled. Similarly, the strongswan.conf(5)
man page, which documents all these settings, is automatically generated
from the same source.
The config snippets are also installed in $prefix/share/strongswan so
existing files can be compared to the most current defaults.
As an alternative to the non-extensible charon.load option, the plugins
to load can now be determined via the respective charon.plugins.<name>.load
setting. This functionality is enabled by the new default strongswan.conf
file (via the charon.load_modular option) and the load setting in the
generated config snippets of all enabled plugins. The load setting
optionally takes a numeric priority value that allows reordering the
plugins (plugins with the same priority are ordered according to the
default plugin order).
Additionally, all settings that were formerly defined in library
specific "global" sections are now application specific. For instance,
instead of configuring libstrongswan.plugins.random.random and affecting
charon, charon-cmd, pki, basically every application using libstrongswan,
the option can now be set individually for each application (e.g.
pki.plugins.random.random to affect only pki). The old options are still
supported though, which actually allows to define defaults for all
applications in the libstrongswan section.
The libtls options are mapped to <app>.tls. The libimcv and libtnccs options
are mapped to <app>.imcv and <app>.tnc, respectively (while their plugin's
options are now under <app>.plugins together with all the others).
Fixes #475 .
2014-02-12 15:51:42 +01:00
Tobias Brunner
efce4559e8
conf: Install config files world-readable but warn about permissions for certain options
2014-02-12 15:16:57 +01:00
Tobias Brunner
5422bb9070
conf: Document variables and config files/dirs
2014-02-12 14:34:34 +01:00
Tobias Brunner
07d971ef22
Add Python and pkg-config as requirements to HACKING
...
pkg-config is probably installed on most systems by default, but e.g. not
on Cygwin.
2014-02-12 14:34:34 +01:00
Tobias Brunner
7573a7ed56
conf: Only install config snippets for enabled components
2014-02-12 14:34:34 +01:00
Tobias Brunner
ff94fe157a
conf: Document options of other programs
2014-02-12 14:34:34 +01:00
Tobias Brunner
5ac757872b
conf: Document options of plugins in libpts
2014-02-12 14:34:34 +01:00
Tobias Brunner
50fdff70e8
libpts: Move settings to <ns>.plugins with fallback to libimcv
2014-02-12 14:34:34 +01:00
Tobias Brunner
bf3f4bf7a2
conf: Document libimcv options
2014-02-12 14:34:34 +01:00
Tobias Brunner
1ec3476398
libimcv: Move settings to <ns>.imcv and <ns>.plugins with fallback
2014-02-12 14:34:34 +01:00
Tobias Brunner
4576f7f960
conf: Document libtnccs options
2014-02-12 14:34:34 +01:00
Tobias Brunner
abd5c7bea2
libtnccs: Move settings to <ns>.tnc and <ns>.plugins with fallback
2014-02-12 14:34:34 +01:00
Tobias Brunner
505a69eba4
attr: Silently skip over load option
2014-02-12 14:34:34 +01:00
Tobias Brunner
127f65db16
Prevent 'make distcheck' from complaining about config files we leave in /etc
2014-02-12 14:34:34 +01:00
Tobias Brunner
d56a23c515
conf: Create automatically generated config snippets in build dir
2014-02-12 14:34:34 +01:00
Tobias Brunner
7f535b3938
conf: Install config snippets in /usr/share/strongswan/templates/config too
2014-02-12 14:34:34 +01:00
Tobias Brunner
6a2de77f2e
conf: Only install config snippets if they don't exist yet
2014-02-12 14:34:34 +01:00
Tobias Brunner
fc380b175d
conf: Move load-tester options to plugin specific file
2014-02-12 14:34:34 +01:00
Tobias Brunner
828815b0d8
conf: Options of all plugins documented
...
Some options are still missing descriptions though.
2014-02-12 14:34:34 +01:00
Tobias Brunner
da8b16a160
conf: Add logger example config
2014-02-12 14:34:34 +01:00
Tobias Brunner
5da20b3dc6
conf: Converted charon options
2014-02-12 14:34:33 +01:00
Tobias Brunner
c4bb26b849
conf: Split strongswan.conf(5) man page and use generated snippet
2014-02-12 14:34:33 +01:00
Tobias Brunner
7f62b7d02d
conf: Generate groff snippet for configuration options
2014-02-12 14:34:33 +01:00
Tobias Brunner
91cc523ca7
conf: Generate strongswan.conf(5) man page in different directory
2014-02-12 14:34:33 +01:00
Tobias Brunner
1b98f85821
conf: Generate and install config sippets for option descriptions
...
The strongswan.d directory is also created relative to the configured
location of strongswan.conf.
2014-02-12 14:34:33 +01:00
Tobias Brunner
e90b37b9c3
conf: Script to convert option descriptions to man page and config snippets added
2014-02-12 14:34:33 +01:00
Tobias Brunner
dee50a6046
conf: Create /etc/strongswan.d directory and include .conf files
2014-02-12 14:34:33 +01:00
Tobias Brunner
45e19c7c88
conf: Simplified strongswan.conf template
2014-02-12 14:34:33 +01:00
Tobias Brunner
c75acc4c44
conf: Install strongswan.conf template from a separate directory
2014-02-12 14:34:33 +01:00
Tobias Brunner
9925eeabd2
settings: Add support to enumerate sections and key/value pairs with fallbacks
2014-02-12 14:34:33 +01:00
Tobias Brunner
f4da1989cd
settings: Implement subsections and key/value pairs with sorted arrays
...
Is a bit more memory efficient (also due to lazy instantiation) and
lookups for sections with lots of subsections/keys (e.g. charon.plugins) are
faster.
2014-02-12 14:34:33 +01:00
Tobias Brunner
b3613c49a2
array: Add fallback for qsort_r using thread-local value
...
Cygwin for example does not support qsort_r.
2014-02-12 14:34:33 +01:00
Tobias Brunner
190a278854
plugin-loader: Optionally use load option in each plugin section to load plugins
...
This now works because all plugins use the same config namespace.
If <ns>.load_modular is true, the list of plugins to load is determined
via the value of the <ns>.plugins.<name>.load options.
Using includes the following is possible:
charon {
load_modular = yes
plugins {
include strongswan.d/charon/*.conf
}
}
charon-cmd {
load_modular = yes
plugins {
include strongswan.d/charon-cmd/*.conf
}
}
Where each .conf file would contain something like:
<name> {
load = yes
<option> = <value>
}
To increase the priority of individual plugins load = <priority> can be
used (the default is 1). For instance, to use openssl instead of the
built-in crypto plugins set in strongswan.d/charon/openssl.conf:
openssl {
load = 10
}
If two plugins have the same priority their order in the default plugin
list is preserved. Plugins not found in that list are ordered
alphabetically before other plugins with the same priority.
2014-02-12 14:34:33 +01:00
Tobias Brunner
79962d9e99
array: Add array_bsearch function
2014-02-12 14:34:33 +01:00
Tobias Brunner
132b00ce02
array: Add array_sort function
2014-02-12 14:34:33 +01: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
d223fe807a
libcharon: 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
Tobias Brunner
d347a130f5
libhydra: Use lib->ns instead of hydra->daemon
2014-02-12 14:34:32 +01:00
Tobias Brunner
409adef43c
libtls: Move settings to <ns>.tls with fallback to libtls
2014-02-12 14:34:32 +01:00
Tobias Brunner
eb9b375aa1
attr-sql: Use namespace for attr-sql config, with fallback
2014-02-12 14:34:32 +01:00
Tobias Brunner
8dc6e71632
lib: All settings use configured namespace
2014-02-12 14:34:32 +01:00
Tobias Brunner
7a684aece4
lib: Add default config fallback for configured namespace
...
All settings in the configured global namespace fall back to libstrongswan.
2014-02-12 14:34:32 +01:00
Tobias Brunner
dbed07782b
unit-tests: Test how settings_t handles some invalid data
2014-02-12 14:34:32 +01:00
Tobias Brunner
1713d88278
settings: Add method that allows to define fallback sections for other sections
...
The fallbacks are currently only used for single value lookups.
Enumerators are not affected by them.
2014-02-12 14:34:32 +01:00
Tobias Brunner
ef72d4cc3f
settings: Make print_key() not rely on null-terminated beginning of key buffer
...
The key to print (e.g. until the next .) still has to be
null-terminated.
2014-02-12 14:34:32 +01:00
Tobias Brunner
24d2bb7793
unit-tests: Add tests for includes and file loading in settings_t
2014-02-12 14:34:32 +01:00
Tobias Brunner
25ee33ba65
settings: Allow empty strings in section key
2014-02-12 14:34:32 +01:00
Tobias Brunner
9f9a6b0681
unit-tests: Add tests for enumerators in settings_t
2014-02-12 14:34:32 +01:00
Tobias Brunner
cd0523e0a4
unit-tests: Add tests for setters in settings_t
2014-02-12 14:34:31 +01:00
Tobias Brunner
9f2870216d
unit-tests: Add basic tests for settings_t
2014-02-12 14:34:31 +01:00
Tobias Brunner
34d3bfcf14
lib: Add global config namespace
2014-02-12 14:34:31 +01:00
Tobias Brunner
4f8bd6d404
pool: Typo in Makefile fixed
2014-02-12 14:34:09 +01:00
Tobias Brunner
b84b5410a4
Merge branch 'sql-install'
...
SQL schemas and example data (IMV) are now part of the distribution and
installed in $prefix/share/strongswan. This way no extra copy is needed
for the test suite and distributions can easily pack those files together
with the plugins.
2014-02-12 14:27:21 +01:00
Tobias Brunner
6e288ed19c
pool: Install SQL schemas from src/pool
...
This allows us to install the schemas if either the attr-sql or sql
plugin is enabled, since both use the same schema (at least in parts).
2014-02-12 14:21:26 +01:00
Tobias Brunner
b2cd0870a3
sql: Set default values for some fields in addresses table
2014-02-12 14:08:34 +01:00
Tobias Brunner
9942e43dc6
testing: Use installed PTS SQL schema and data instead of local copy
2014-02-12 14:08:34 +01:00
Tobias Brunner
96e8715e32
testing: Use installed SQL schema instead of local copy
2014-02-12 14:08:34 +01:00
Tobias Brunner
de7f5305d9
libimcv: Install SQL files in /usr/share/strongswan/templates/database
2014-02-12 14:08:34 +01:00
Tobias Brunner
9ca9d99bc4
sql: Install SQL schemas in /usr/share/strongswan/templates/database
2014-02-12 14:08:34 +01:00
Tobias Brunner
68539c38e2
sql: Remove unused cred.sql snippet
2014-02-12 14:08:34 +01:00
Tobias Brunner
ebc665be4d
asn1: Support dates before 1970-01-01 (i.e. when time_t gets negative)
...
On x86 we allow "overflows" around 1969/1970 but not for other dates.
Fixes #509 .
2014-02-12 13:54:05 +01:00
Tobias Brunner
addc34d5f0
asn1: Add additional validation for parsed ASN.1 date/time values
2014-02-12 13:53:57 +01:00
Tobias Brunner
9e1ce63915
ikev1: Fix config switching due to failed authentication during Aggressive mode
...
The encoded ID payload gets destroyed by the authenticator, which caused
a segmentation fault after the switch.
Fixes #501 .
2014-02-12 13:53:03 +01:00
Tobias Brunner
822b22c96f
kernel-pfroute: Don't cache route entries if installation fails
2014-02-12 13:52:25 +01:00
Tobias Brunner
f0f78b74d4
kernel-netlink: Don't cache route entries if installation fails
...
Fixes #500 .
2014-02-12 13:52:01 +01:00
Tobias Brunner
5e75f50b70
identification: Fix printing of empty RDNs on FreeBSD
...
On FreeBSD (null) is printed for NULL even if the precision is 0.
2014-02-12 13:45:42 +01:00
Tobias Brunner
f8c9c03de0
tests: Fix test for printing NULL on FreeBSD
2014-02-12 13:45:42 +01:00
Tobias Brunner
44e6dbf04d
testing: Add ssh script to distribution
2014-02-12 10:53:17 +01:00