Commit Graph

12119 Commits

Author SHA1 Message Date
Martin Willi 35e8eb93a0 unit-tests: Implement testing framework without "check" 2013-11-06 10:30:59 +01:00
Martin Willi 56866ecf3d leak-detective: Call {gm,local}time_r() to allocate static buffer
On OS X Mavericks, these functions use a static allocation and are hard
to whitelist using other means.
2013-11-06 10:30:59 +01:00
Martin Willi ef6d78d6ef leak-detective: Register OS X specific hooks just once
If we initialize libstrongswan more than once in the same process, we may
not register the hooks twice.
2013-11-06 10:30:59 +01:00
Martin Willi f192526c3f leak-detective: Reset leak list during cleanup
This resets leak detective state should it get created/destroyed more than once.
2013-11-06 10:30:59 +01:00
Martin Willi a426851f63 leak-detective: Use callback functions to report leaks and usage information
This is more flexible than printing reports to a FILE.
2013-11-06 10:30:59 +01:00
Martin Willi 9ae1140118 unit-tests: Move test suites to its own subfolder 2013-11-06 10:30:58 +01:00
Tobias Brunner c49c3f3208 ikev2: Properly free DH secret in case of errors during IKE key derivation
Fixes #437.
2013-11-06 10:24:19 +01:00
Andreas Steffen 2da887da35 unit-tests: completed asn1_suite 2013-11-04 18:35:25 +01:00
Andreas Steffen 79b8a384b5 Updated test_runner.h with new suites 2013-11-03 21:34:42 +01:00
Andreas Steffen 7817d88e1a unit-tests: 100% function coverage for asn1.c 2013-11-03 17:40:51 +01:00
Andreas Steffen 54bce665c4 unit-tests: 12 asn1 functions tested 2013-11-02 21:20:04 +01:00
Andreas Steffen c3103700fc Some minor refactoring in asn1.c 2013-11-02 21:17:46 +01:00
Andreas Steffen 1347c936bd Do not free zero-length integer 2013-11-02 02:11:32 +01:00
Andreas Steffen a40c4bc28c unit-tests: Added tests for pen_type_t 2013-11-01 22:29:29 +01:00
Andreas Steffen 6db81edac3 Added IFOM_CAPABILITY notify message type 2013-11-01 14:07:11 +01:00
Andreas Steffen dc4dd88c42 Updated copyright statement 2013-11-01 13:46:58 +01:00
Martin Willi 10900ed7e7 charon-xpc: Set AUTH_RULE_IDENTITY_LOOSE on responder config
This allows the server to use a different IKE identity as long as the
configured hostname is contained in the certificate.
2013-11-01 12:05:48 +01:00
Martin Willi b76e96e2ef ike: Don't immediately DPD after deferred DELETEs following IKE_SA rekeying
Some peers seem to defer DELETEs a few seconds after rekeying the IKE_SA, which
is perfectly valid. For short(er) DPD delays, this leads to the situation where
we send a DPD request during set_state(), but the IKE_SA has no hosts set yet.
Avoid that DPD by resetting the INBOUND timestamp during set_state().
2013-11-01 11:33:29 +01:00
Andreas Steffen 7b8fbd7402 Added security info on CVE-2013-6075 and CVE-2013-6076 2013-10-31 22:11:11 +01:00
Volker Rümelin 643da9d2e6 ikev1: Properly initialize list of fragments in case fragment ID is 0
Fixes CVE-2013-6076.
2013-10-31 21:58:42 +01:00
Martin Willi 7f4a13fffb identification: Properly check length before comparing for binary DN equality
Fixes CVE-2013-6075.
2013-10-31 21:57:07 +01:00
Martin Willi ed3eb62723 unit-tests: Additionally do reverse match checking with empty identities 2013-10-31 21:57:07 +01:00
Martin Willi e02b12e374 unit-tests: Test matching against some empty data identities 2013-10-31 21:57:07 +01:00
Martin Willi df12b3a61f unit-tests: Test for equality against some empty data identities 2013-10-31 21:57:07 +01:00
Martin Willi c409be2506 unit-tests: Let identity equality test fail if a->equals(b) != b->equals(a) 2013-10-31 21:57:07 +01:00
Andreas Steffen 2590cd20d3 PB-TNC PDP_REFERRAL message doesn't have to be in RESULT batch 2013-10-31 12:01:47 +01:00
Andreas Steffen c501c78c5f Version bump to 5.1.1 2013-10-31 09:42:15 +01:00
Andreas Steffen 6d18e23e9f Added test-driver to .gitignore 2013-10-30 20:47:44 +01:00
Andreas Steffen 7967876257 Encrypt carol's PKCS#8 private key in openssl-ikve2/rw-suite-b-128|192 scenarios 2013-10-30 20:46:32 +01:00
Ansis Atteka 4334735605 updown: fix segfault when interface name can't be resolved
The child_updown() function sets up environment variables to the updown
script. Sometimes call to hydra->kernel_interface->get_interface() could
fail and iface variable could be left uninitialized. This patch fixes
this issue by passing "unknown" as interface name.

Here is the stacktrace:

0  0x00007fa90791f445 in raise () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007fa907922bab in abort () from /lib/x86_64-linux-gnu/libc.so.6
2  0x0000000000401ed7 in segv_handler (signal=11) at charon.c:183
3  <signal handler called>
4  0x00007fa90793221f in vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
5  0x00007fa9079f0580 in __vsnprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
6  0x00007fa9079f04c8 in __snprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
7  0x00007fa8f9b95b86 in snprintf (
    __fmt=0x7fa8f9b961b8 "2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='%s%s%s' PLUTO_CONNECTION='%s' PLUTO_INTERFACE='%s' PLUTO_REQID='%u' PLUTO_ME='%H' PLUTO_MY_ID='%Y' PLUTO_MY_CLIENT='%H/%u' PLUTO_MY_PORT='%u' PLUTO_MY_PROTOCOL='%u"..., __n=1024, __s=0x7fa8f7923440 "2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='up-host' PLUTO_CONNECTION='remote-40.0.0.40' PLUTO_INTERFACE='\367\250\177")
    at /usr/include/x86_64-linux-gnu/bits/stdio2.h:65
8  child_updown (this=0x8486b0, ike_sa=0x7fa8e4005f80, child_sa=0x7fa8d4008290, up=true) at updown_listener.c:308
9  0x00007fa907ecc11c in ?? () from /usr/lib/strongswan/libcharon.so.0
10 0x00007fa907ef89bf in ?? () from /usr/lib/strongswan/libcharon.so.0
11 0x00007fa907ef2fc8 in ?? () from /usr/lib/strongswan/libcharon.so.0
12 0x00007fa907ee84ff in ?? () from /usr/lib/strongswan/libcharon.so.0
13 0x00007fa907ee3067 in ?? () from /usr/lib/strongswan/libcharon.so.0
14 0x00007fa90835e8fb in ?? () from /usr/lib/strongswan/libstrongswan.so.0
15 0x00007fa908360d30 in ?? () from /usr/lib/strongswan/libstrongswan.so.0
16 0x00007fa907cade9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
17 0x00007fa9079db4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
18 0x0000000000000000 in ?? ()

Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
2013-10-30 09:29:41 +01:00
Ansis Atteka 588099f772 debian: build debug symbol package
Before this patch all debug symbols were stripped off and simply
discarded.  GDB without debug symbols is barely usable, but at
the same time distributing binaries with debug symbols would
drastically increase strongswan/libstrongswan package size.

Instead of discarding debug symbols, it would be better to strip
them off into a dedicated debian package.  So that, if needed, one
could still install them and use GDB.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2013-10-30 09:29:28 +01:00
Tobias Brunner 19046552b6 ipsec: Updated ipsec(8) 2013-10-29 17:22:45 +01:00
Tobias Brunner 71687f4fad ipsec: Remove unused distro.txt 2013-10-29 16:34:10 +01:00
Tobias Brunner 5ac29360fc utils: Include stdio.h for fmemopen() replacement
This might now be required because Vstr is not necessarily required
anymore, which means stdio.h might not be pulled in by prinf_hook.h.
2013-10-29 16:18:35 +01:00
Tobias Brunner 60ddf6284f Use exact mask when calling umask(2)
Due to the previous negation the high bits of the mask were set, which
at least some versions of the Android build system prevent with a compile-time
check.
2013-10-29 16:01:55 +01:00
Martin Willi d402e87d16 whitelist: Read multiple commands until client closes connection
This restores the same behavior we had before e11c02c8, and fixes the whitelist
add/remove-from command.
2013-10-29 14:22:52 +01:00
Tobias Brunner 348b9d82b4 libtnccs: Add dummy entry to pb_tnc_tcg_msg_infos
That's required because the first message type in pb_tnc_tcg_msg_type_t
is 1 not 0.
2013-10-29 13:36:15 +01:00
Tobias Brunner 751670a93b swid: Properly clean up after reading SWID tag 2013-10-29 13:18:05 +01:00
Tobias Brunner bb49dfb02e man: strongswan.conf(5) updated 2013-10-29 11:45:25 +01:00
Tobias Brunner 1dd58b0e21 Fixed some typos 2013-10-29 11:44:23 +01:00
Martin Willi 1ba47fa565 charon-xpc: Load missing eap-md5 plugin after enabling it 2013-10-28 15:18:11 +01:00
Martin Willi 9f2a4d3315 charon-xpc: Disable warnings about deprecated functions
This avoids all the deprecated warnings when using OpenSSL functins.
2013-10-28 14:51:59 +01:00
Martin Willi f5ea7d781f charon-xpc: Avoid -all_load linker flag
This seems to be not required anymore with the LLVM 5 toolchain.
2013-10-28 14:51:51 +01:00
Martin Willi a1c2ed8820 charon-xpc: Properly xpc_retain() connections we xpc_release() 2013-10-28 14:51:40 +01:00
Martin Willi 888d8d73ab charon-xpc: Properly cast SA identifier to uintptr representation 2013-10-28 14:51:28 +01:00
Martin Willi 3e40dbb128 charon-xpc: Don’t build against libvstr anymore
We now have our own printf backend and use it instead of Vstr.
2013-10-28 14:51:03 +01:00
Martin Willi 6a3cfbdc0d charon-xpc: Build with EAP-MD5 support 2013-10-28 14:49:19 +01:00
Martin Willi 9df621d21f utils: Fix check for fmemopen() fallback implementation 2013-10-24 15:58:49 +02:00
Martin Willi 8465514157 unit-tests: Set sa_len in sockaddr template data, if required 2013-10-24 15:37:21 +02:00
Martin Willi e71c57467c printf-hook-builtin: Don't rely on isinf() return value signedness
Many systems don't return a negative value for negative infinities; so do
a separate check.
2013-10-24 15:37:20 +02:00