Commit Graph

16680 Commits

Author SHA1 Message Date
Tobias Brunner 6e73a939a9 android: Reset error state after user confirmed it
This allows other listeners to change their display.
2018-07-03 11:31:34 +02:00
Tobias Brunner 52aaffdeb4 android: Use specific icon when connecting to the VPN 2018-07-03 11:31:34 +02:00
Tobias Brunner 70d6a0cf33 android: Use a handler to show/remove notification from main UI thread
This avoids races that were previously seen (e.g. when disconnecting
while connecting, which sometimes showed a "Disconnecting..."
notification).
2018-07-03 11:31:34 +02:00
Tobias Brunner 58d139dad3 android: Use separate activity to control VPN connections
This way we don't have to open the main window, but only show a dialog
if necessary (or nothing in many cases).
2018-07-03 11:31:34 +02:00
Tobias Brunner 1d336cc2ae android: Migrate onAttach() from deprecated version 2018-07-03 11:31:33 +02:00
Tobias Brunner 4671f023c3 android: Make certificate import activity properly transparent 2018-07-03 11:31:33 +02:00
Tobias Brunner d390d97da4 android: Remove deprecated progress indicator in MainActivity
Support for this was already removed with API level 21. On modern
devices loading CA certs should be quick enough anyway.
2018-07-03 11:31:33 +02:00
Tobias Brunner ed9d5a314c android: Replace deprecated ProgressDialog during profile import 2018-07-03 11:31:33 +02:00
Tobias Brunner 6ca0b46c20 android: Add notification channel for API level 26+
Unfortunately, setLockscreenVisibility() doesn't seem to have any
effect. So the full notification is shown unless the user manually
configures the notification settings.
2018-07-03 11:31:33 +02:00
Tobias Brunner 56dec924ec android: Set compile-/targetSdkVersion to 26
This allows us to add tiles to Quick Settings and enabling the Always-on
VPN feature in the VPN settings (both require API level 24, but 26 will
be required as targetSdkVersion later this year).
2018-07-03 11:31:33 +02:00
Tobias Brunner 71f4a20aa1 android: Show profile ID at bottom of advanced settings
Can be selected and copied to the clipboard to use in automation
software that doesn't support the shortcut.
2018-07-03 11:31:32 +02:00
Tobias Brunner 93033728a9 android: Accept a profile's UUID when initiating 2018-07-03 11:31:32 +02:00
Tobias Brunner 581f4326d5 android: Add additional Intent filter for import Activity with MIME type mask
Chrome creates such an Intent when opening downloaded files (not when
directly opening them), a MIME type is set, but apparently not ours.
2018-07-03 11:31:32 +02:00
Tobias Brunner 93489acc0d android: UUID is now mandatory
Unless there are profiles created with old versions of the app (< 1.8.0)
that were never updated since, all profiles should already have a UUID
assigned.  If not, we do that now with a DB migration.
2018-07-03 11:31:32 +02:00
Tobias Brunner 0917caa195 android: Show an error dialog if we can't get permission for VPNs
This is either because a third-party VPN app has the always-on feature
enabled, or because the user denied the permission in the system's confirmation
dialog.

If the always-on feature is enabled for a connection of the built-in VPN
client we get an IllegalStateException, for which we show an updated and
clearer error message.
2018-07-03 11:31:32 +02:00
Tobias Brunner 08601c58e9 android: Suppress self-assign warnings with clang
These are triggered by the little endian functions in byteorder.h.
2018-07-03 11:31:31 +02:00
Tobias Brunner 2afdb92dd0 atomics: Use type of destination in CAS implementation
The type of the value was incorrect (void**) if NULL was passed to cas_ptr()
as expected value, which caused a compiler warning with Clang because
__atomic_compare_exchange_n() expects the types of the first two arguments
to be the same.
2018-07-03 11:31:31 +02:00
Tobias Brunner 942599b623 atomics: Define HAVE_GCC_ATOMIC_OPERATIONS when building with clang
We should probably check for stdatomic.h and use the c11 functions if
available.
2018-07-03 11:31:31 +02:00
Tobias Brunner 929badfefd android: Build native libraries for all non-deprecated ABIs
armeabi has been superseded by armeabi-v7a and the MIPS ABIs were removed
with the latest NDK (r17), after being marked deprecated for a while.
By not specifying APP_ABI we build for all non-deprecated ABIs.
2018-07-03 11:31:31 +02:00
Tobias Brunner 4bb0a589ff android: Update Gradle plugin and wrapper 2018-07-03 11:31:31 +02:00
Tobias Brunner b68a0adace ike: Include length of reassembled IKE message in log message
Also simplify wording a bit when fragmenting.
2018-07-02 12:19:00 +02:00
Tobias Brunner 707b70725a dhcp: Only use DHCP server port if explicitly configured
If a DHCP server is running on the same host it isn't necessary to
bind the server port and might even cause conflicts.
2018-07-02 11:39:22 +02:00
Tobias Brunner 50c4c1bb40 kernel-pfkey: Avoid updating policies if nothing significant changed
The FreeBSD kernel doesn't update policies atomically, causing
unnecessary traffic loss during simple rekeyings.

Fixes #2677.
2018-07-02 10:17:04 +02:00
Tobias Brunner daa0a0cc1b settings: Fix compilation with newer versions of Clang
Depending on the actual va_list definition it's not valid to compare it
directly or assign NULL.
2018-06-29 11:47:26 +02:00
Tobias Brunner fecafaaca3 Merge branch 'ike-proposal-switch'
This allows switching the originally selected IKE config (based on the
IPs and IKE version) to a different one if no matching proposal is found.

This way we don't rely that much on the order of configs anymore and it's
possible to configure separate configs for clients that require weak
algorithms.
2018-06-28 18:47:15 +02:00
Tobias Brunner 1ecac75f37 testing: Fix IKE proposal in swanctl/net2net-gw scenario
Also simplify config by using references.
2018-06-28 18:46:42 +02:00
Tobias Brunner 187a01cc9f backend-manager: Change how IKE/peer config matches are logged
Instead of logging the search parameters for IKE configs (which were already
before starting the lookup) we log the configured settings.

The peer config lookup is also changed slightly by doing the IKE config
match first and skipping some checks if that or the local peer identity
doesn't match.
2018-06-28 18:46:42 +02:00
Tobias Brunner 2ad1df9571 Replace 'inacceptable' with the more common 'unacceptable' 2018-06-28 18:46:42 +02:00
Tobias Brunner 84cdfbc9bc child-cfg: Allow suppressing log messages when selecting traffic selectors
Although being already logged on level 2, these messages are usually just
confusing if they pop up randomly in the log when e.g. querying the configs
or installing traps.  So after this the log messages will only be logged when
actually proposing or selecting traffic selectors during IKE.
2018-06-28 18:46:42 +02:00
Tobias Brunner 054ee5e7c0 ike-init: Switch to an alternative config if proposals don't match
This way we don't rely on the order of equally matching configs as
heavily anymore (which is actually tricky in vici) and this also doesn't
require repeating weak algorithms in all configs that might potentially be
selected if there are some clients that require them.

There is currently no ordering, so an explicitly configured exactly matching
proposal isn't a better match than e.g. the default proposal that also
contains the proposed algorithms.
2018-06-28 18:46:42 +02:00
Tobias Brunner da288a07aa ike-auth: Consider negotiated IKE proposal when selecting peer configs
In some scenarios we might find multiple usable peer configs with different
IKE proposals.  This is a problem if we use a config with non-matching
proposals that later causes IKE rekeying to fail.  It might even be a problem
already when creating the CHILD_SA if the proposals of IKE and CHILD_SA
are consistent.
2018-06-28 18:46:41 +02:00
Tobias Brunner 29e7fe63c3 ike-cfg: Add method to check if config contains matching proposal
This way we can check whether the config should be considered or not if
we have a selected proposal.
2018-06-28 18:46:41 +02:00
Tobias Brunner f72aa13a29 proposal: Add method to check if two proposals match
Similar to select() but does not return a proposal and does not log
anything.
2018-06-28 18:46:41 +02:00
Tobias Brunner 90f5fe1ca9 child-cfg: Log the selected proposal on level 1 2018-06-28 16:53:35 +02:00
Tobias Brunner 4d338b9acf ike-cfg: Log the selected proposal on level 1 2018-06-28 16:53:35 +02:00
Tobias Brunner aa4f0c44ee backend-manager: Add enumerator over all matching IKE configs 2018-06-28 16:53:35 +02:00
Tobias Brunner 82e237c04e backend-manager: Simplify sorting peer configs 2018-06-28 16:53:35 +02:00
Tobias Brunner 80c9ae4521 testing: Add wrapper for systemctl to collect leaks from charon-systemd
Similar to the wrapper around `service` added with 71d59af58a, this
sets the variable only when running the automated tests.
2018-06-28 16:45:54 +02:00
Tobias Brunner 3d021f5b06 Merge branch 'settings-references'
This adds the ability to reference existing sections to the settings parser.
Mainly for swanctl.conf, where this could simplify complex configs a lot
as redundant information has only to be specified once and may then be
included in other sections (there is an example in the man page and
there are some in the unit tests).

Also added is a new setting in filelog sections to specify the path of
the log file (in case it contains characters that are not allowed in section
names). We should encourage people to configure their log files that way
which might allow use to prohibit dots in section names in the future.
2018-06-27 14:34:57 +02:00
Tobias Brunner b9745618cd daemon: Allow configuration of logfile path as value
Some characters are not allowed in section names, this way they can
still be used in paths of log files.
2018-06-27 14:19:35 +02:00
Tobias Brunner 61c3870bef conf: Document reference syntax 2018-06-27 14:19:35 +02:00
Tobias Brunner 089d5f9765 settings: Properly lock when extending sections or adding fallbacks
There was a potential chance for a race condition if the ensured section
was purged for some reason before using it later.

This also changes the behavior for NULL/empty strings via load_string*
with merge == FALSE, which now purges the config/section.
2018-06-27 14:19:35 +02:00
Tobias Brunner ca3c7b7ea6 settings-test: Add option to use the frontend to display the settings
This resolves references and redefined values. It currently doesn't work
properly if section names contain dots.
2018-06-27 14:19:35 +02:00
Tobias Brunner 35ca6a7b2f settings: Add reference feature
Similar to the `also` keyword in ipsec.conf, the new syntax allows adding
one or more references to other sections, which means all the settings and
subsections defined there are inherited (values may be overridden, even
with an empty value to clear it).

It's important to note that all subsections are inherited, so if this is
used to reference a connection in swanctl.conf all auth rounds and
children are inherited.  There is currently no syntax to limit the
inclusion level or clear inherited sections (but as mentioned, settings
in those inherited sections may be overridden).

Another property is that inherited settings or sections always follow
explicitly defined entries in the current section when they are enumerated.
This is relevant if the order is important (e.g. for auth rounds if `round`
is not specified).

References are evaluated dynamically at runtime, so referring to
sections later in the config file or included via other files is no
problem.

The colon used as separator to reference other sections may be used in
section names by writing :: (e.g. for Windows log file paths).

This is based on a patch originally written in 2016.
2018-06-27 14:19:35 +02:00
Tobias Brunner 0ca0fa71c0 charon-systemd: Register journal logger as custom logger
This way we get early log messages during plugin loading (including
integrity check results).

Instead of the fallback we could also remove the `customlog` namespace,
which was added to avoid conflicts with other settings/sections.
2018-06-26 15:24:42 +02:00
Tobias Brunner 2c02b02589 linked-list: Order of insert_before/remove_at calls doesn't matter anymore
This was quite confusing previously:  While calling insert_before()
and then remove_at() properly replaced the current item, calling them the
other way around inserted the new item before the previous item because
remove_at() changed the enumerator's position to the previous item.

The behavior in corner cases (calling the methods before or after
enumeration) is also changed slightly.
2018-06-26 15:11:02 +02:00
Tobias Brunner 91640baf6d vici: Maintain connection order when replacing one 2018-06-26 15:10:40 +02:00
Tobias Brunner 57447015db eap-radius: Document station_id_with_port option 2018-06-25 10:42:17 +02:00
Andreas Steffen 5b91e8c03c Version bump to 5.7.0dr4 2018-06-22 11:21:02 +02:00
Andreas Steffen ef4a63524f vici: list cert_policy parameter 2018-06-22 10:39:40 +02:00