Commit Graph

16102 Commits

Author SHA1 Message Date
Tobias Brunner e0e4322973 configure: Detect type of length parameter for gperf generated function
Since 3.1 gperf uses size_t for the length parameter instead of an
unsigned int.
2017-09-19 13:24:43 +02:00
Tobias Brunner d4593353c9 utils: Include stdint.h
Recent releases of glibc don't include the full stdint.h header in some
network headers included by utils.h.  So uintptr_t might not be defined.
Since we use fixed width integers, including the latter, all over the place
we make sure the complete file is included.

Fixes #2425.
2017-09-19 13:24:39 +02:00
Tobias Brunner c21fff303a sec-updater: Make sure `success` is initialized 2017-09-18 12:16:54 +02:00
Tobias Brunner e433d512f4 dhcp: Fix warning regarding unaligned pointer value due to packed struct
We don't need to access this as uint32_t so just cast it to a char*.
2017-09-18 12:16:54 +02:00
Tobias Brunner 787cc3a4e5 dhcp: Don't use signed char for DHCP options
The value of DHCP_OPTEND is 255.  When it is assigned this result in a
sign change as the positive int constant is cast to a signed char and -1
results. Clang 4.0 complains about this.
2017-09-18 12:16:54 +02:00
Tobias Brunner d04deff4df imv-agent: Fix get_attribute() call for preferred language 2017-09-18 12:16:54 +02:00
Tobias Brunner 7e7800e0a3 bliss: Fix compile error of unit tests due to uninitialized variable 2017-09-18 12:16:54 +02:00
Tobias Brunner f4bd467641 travis: Use Clang 4.0 instead of 3.9 due to va_start() warnings
This is a follow up on the issue documented in the previous commit.

To build with -Werror and Clang 3.9 we'd have to change all enum arguments
that are used as last argument before ... to e.g. u_int, which affects
quite a lot of places (crypto-factory, MODP_CUSTOM constructors, auth-cfg,
bus, vici-builder, vici-message).  Besides that it doesn't look as nice
it also seems a bit too much hassle just to cater to the whims of a
particular version of one compiler, so we just don't build with that
version on Travis and use 4.0 instead.
2017-09-18 12:16:51 +02:00
Tobias Brunner 7cecc98e8a settings: Fix possible undefined behavior with va_start() and bool
This fixes compilation with -Werror when using Clang 4.0 (but not 3.9)
and possibly prevents undefined behavior.

According to the C standard the following applies to the second
parameter of the va_start() macro (subclause 7.16.1.4, paragraph 4):

  The parameter parmN is the identifier of the rightmost parameter
  in the variable parameter list in the function definition (the
  one just before the ...). If the parameter parmN is declared with
  the register storage class, with a function or array type, or with
  a type that is not compatible with the type that results after
  application of the default argument promotions, the behavior is
  undefined.

Because bool is usually just 1 byte and therefore smaller than int (i.e.
the result of default argument promotion) its use as last argument before
... might result in undefined behavior.  This theoretically can also
apply to enums as a compiler may use a smaller base type than int.

Since Clang 3.9 (currently in use on Travis by default) a warning is
issued about this, however, that version did not yet compare the actual
size of the argument's type, causing warnings where they are not
warranted (basically for all cases where enum types are used for the
last argument).  This was apparently fixed with Clang 4.0, which only
warns about this use of bool with va_start(), which makes sense.
2017-09-18 12:07:26 +02:00
Tobias Brunner 46a62f0126 Define MODP_CUSTOM constructors as variadic functions
They now match the dh_constructor_t signature.  This is a follow up for
the changes merged with b668bf3f9e and should fix use of MODP_CUSTOM on
Apple's ARM64 platform.
2017-09-18 12:07:26 +02:00
Tobias Brunner f871b341d7 libtnccs: Correctly read dlopen_use_rtld_now option
Fixes: 50e4aeb22f ("libtnccs: Optionally use RTLD_NOW to load IMC/IMVs with dlopen()")
2017-09-18 12:07:26 +02:00
Tobias Brunner ddfb5dd44a plugin-loader: Correctly read dlopen_use_rtld_now option
Fixes: 305c4aa82c ("plugin-loader: Optionally use RTLD_NOW with dlopen()")
2017-09-18 12:07:26 +02:00
Tobias Brunner d3e1beaad5 android: New release after adding delta CRL support and some bug fixes 2017-09-18 11:04:46 +02:00
Tobias Brunner 66b7a08884 android: Ignore IllegalArgumentException for multicast addresses
Some Android versions seem to reject routes that use multicast addresses.

Fixes #2420.
2017-09-18 11:00:58 +02:00
Tobias Brunner 86c10a958f openssl: Add support for delta CRLs 2017-09-18 10:54:31 +02:00
Tobias Brunner 4e7b7db62f certificates: Use shared destructor for x509_cdp_t 2017-09-18 10:54:19 +02:00
Tobias Brunner e7276f78aa child-create: Don't consider a DH group mismatch as failure as responder
This causes problems e.g. on Android where we handle the alert (and
reestablish the IKE_SA) even though it usually is no problem if the
peer retries with the requested group.  We don't consider it as a
failure on the initiator either.
2017-09-18 10:51:39 +02:00
Tobias Brunner 6e861947a0 libipsec: Make sure to expire the right SA
If an IPsec SA is actually replaced with a rekeying its entry in the
manager is freed. That means that when the hard expire is triggered a
new entry might be found at the cached pointer location.  So we have
to make sure we trigger the expire only if we found the right SA.

We could use SPI and addresses for the lookup, but this here requires
a bit less memory and is just a small change. Another option would be to
somehow cancel the queued job, but our scheduler doesn't allow that at
the moment.

Fixes #2399.
2017-09-18 10:51:39 +02:00
Tobias Brunner e138003de9 Merge branch 'libipsec-ip-frag'
This fixes "packet too short" errors when parsing fragmented IPv4
packets and correctly determines the protocol in fragmented IPv6 packets.
Protocol headers are only parsed in unfragmented IPv4 and IPv6 packets,
or IPv4 first fragments.

Closes strongswan/strongswan#80.
2017-09-18 10:31:58 +02:00
Tobias Brunner 98e7285394 testing: Add libipsec/net2net-cert-ipv6 scenario 2017-09-18 10:28:54 +02:00
Tobias Brunner bdcaca76c5 ip-packet: Correctly determine protocol in fragmented IPv6 packets
We don't attempt to parse the transport headers for fragments, not even
for the initial fragment (it's not guaranteed they contain the header,
depending on the number and type of extension headers).
2017-09-18 10:28:54 +02:00
Tobias Brunner b3cc46381d ip-packet: Fix "packet too short" error when parsing fragmented IPv4 packets
Only attempt to parse the transport header of an IPv4 packet if it's
not fragmented or the first fragment.
2017-09-18 10:28:54 +02:00
Tobias Brunner 42aa569617 Merge branch 'tkm-cid-ref'
This fixes IKE_SA rekey collision handling and improves error handling
if CHILD_SA setup fails.
2017-09-15 12:17:07 +02:00
Adrian-Ken Rueegsegger fc08e6af8a charon-tkm: Reset ESA on child SA create failure
Since we are also releasing the ESA ID we have to make sure that the ESA
context is reset and in a clean state in order for it to be actually
reusable.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 59e7298ff9 charon-tkm: Check for error when acquiring ESA ID 2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger 8e823bb8b1 charon-tkm: Fix AE context life-cycle handling
Use new reference counting feature of ID manager for AE contexts and
only perform reset if count is zero. Also, do not pass on AE ID as every
IKE SA must decrement AE ID count once it is not used any longer.
2017-09-15 12:16:57 +02: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 fcde9686f6 charon-tkm: Store context ids as int instead of bool
This is in preparation of making context ids refcountable.
2017-09-15 12:16:57 +02:00
Adrian-Ken Rueegsegger d35ebfbce1 charon-tkm: Add missing whitespace log message 2017-09-15 12:16:57 +02:00
Tobias Brunner da479ae2c9 child-delete: Only let SAs expire naturally if they not already did 2017-09-15 12:16:45 +02:00
Andreas Steffen c80cec2d5e Version bump to 5.6.1dr2 2017-09-13 16:56:45 +02:00
Andreas Steffen 8aad7ffb11 sec-updater: Import SWID tags of updated packages
sec-updater downloads the deb package files from security updates from
a given linux repository and uses the swid_generator command to
derive a SWID tag. The SWID tag is then imported into strongTNC
using the manage.py importswid command.
2017-09-09 20:23:19 +02:00
Andreas Steffen 33a729fac2 libimcv: Corrected caption 2017-09-09 13:10:45 +02:00
Andreas Steffen 165d28174d pt-tls-client: Introduced --options as a synonym for --optionsfrom 2017-09-09 10:31:02 +02:00
Andreas Steffen 94bdd463d8 sec-updater: Write to log only if at least one update is found. 2017-09-07 14:54:41 +02:00
Tobias Brunner 311d931aef android: New release after adding OCSP, CRL cache and some other stuff 2017-09-04 11:27:40 +02:00
Tobias Brunner 82088028d8 testing: Reduce log level of SSH client
This should suppress the "Permanently added ... to the list of known
hosts" warnings that occasionally come up for no apparent reason.
2017-09-04 11:16:00 +02:00
Tobias Brunner c353996191 ike: Reset local SPI if retrying to connect in state IKE_CONNECTING
In case we send retransmits for an IKE_SA_INIT where we propose a DH
group the responder will reject we might later receive delayed responses
that either contain INVALID_KE_PAYLOAD notifies with the group we already
use or, if we retransmitted an IKE_SA_INIT with the requested group but
then had to restart again, a KE payload with a group different from the
one we proposed.  So far we didn't change the initiator SPI when
restarting the connection, i.e. these delayed responses were processed
and might have caused fatal errors due to a failed DH negotiation or
because of the internal retry counter in the ike-init task.  Changing
the initiator SPI avoids that as we won't process the delayed responses
anymore that caused this confusion.
2017-09-04 11:16:00 +02:00
Tobias Brunner eaedcf8c00 ike-sa-manager: Add method to change the initiator SPI of an IKE_SA 2017-09-04 11:16:00 +02:00
Tobias Brunner bd371590ab ike-init: Fail if DH group in KE payload does not match proposed group 2017-09-04 11:02:55 +02:00
Tobias Brunner 9c03e8c80b Merge branch 'android-updates'
Caches CRLs in the app directory, adds support for OCSP, adds a button
to reconnect to the "already connected" dialog, only apply/configure app
selection on Android >= 5 (older versions don't support the API), and catches
some random exceptions.
2017-09-04 10:44:08 +02:00
Tobias Brunner 1926efadde android: Add disconnect button to dialog if already connected to profile 2017-09-04 10:41:30 +02:00
Tobias Brunner 037b353d2c android: Load x509 plugin to generate OCSP requests and parse responses
BoringSSL does not support OpenSSL's OCSP API.
2017-09-04 10:41:29 +02:00
Tobias Brunner 829cc56a53 android: Add support to POST data via SimpleFetcher
That's required for OCSP verification.
2017-09-04 10:41:29 +02:00
Tobias Brunner 6e39240a3e android: Add option to clear cached CRLs 2017-09-04 10:41:29 +02:00
Tobias Brunner 0bebbae9e3 android: Cache CRLs in app directory
Fixes #2405.
2017-09-04 10:41:25 +02:00
Tobias Brunner 3fe9a436ee android: Pass absolute path to the app's data directory via JNI 2017-09-04 10:41:25 +02:00
Tobias Brunner 98ab757284 android: Hide app selection in profile editor on Android < 5 2017-09-04 10:41:25 +02:00
Tobias Brunner 0b4f7d646b android: Only apply app filter on Android 5 and newer 2017-09-04 10:41:24 +02:00