Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[th/wireguard-pt3] #281

Closed
wants to merge 12 commits into from
Closed

[th/wireguard-pt3] #281

wants to merge 12 commits into from

Conversation

thom311
Copy link
Member

@thom311 thom311 commented Jan 13, 2019

A major part for WireGuard support.

Still missing:

  • nmcli support (but there is an example script that can be used instead)
  • support for preshared-key (and requesting secrets)
  • more testing
  • see TODO.txt file

But I think it's at a point where it could be merged. We can make it perfect afterwards.

@thom311
Copy link
Member Author

thom311 commented Jan 13, 2019

I opened #282, which contains the early part of this branch. It is mostly preparation work, let's split this pull request in smaller chunks. If you care, review #282 first.

@lkundrak lkundrak force-pushed the th/wireguard-pt3 branch 8 times, most recently from 5a4b70d to 08d5311 Compare January 17, 2019 10:36
Copy link
Contributor

@bengal bengal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed all the code, but the API looks reasonable. I think we can merge this and improve it later.

libnm-core/nm-setting-wireguard.c Outdated Show resolved Hide resolved
libnm-core/nm-setting-wireguard.c Outdated Show resolved Hide resolved
libnm-core/nm-setting-wireguard.c Show resolved Hide resolved
src/devices/nm-device-wireguard.c Outdated Show resolved Hide resolved
@thom311
Copy link
Member Author

thom311 commented Jan 18, 2019

addressed comments so far and repushed.

…ttingEthtool)

We want to emit a change notification when gendata-based settings (like
NMSettingEthtool) change. But instead of adding a separate signal, just
emit a fake "notify:name" notification.
…se properties

While nm_setting_enumerate_values() should not be used anymore, still
extend it to make it workable also for properties that are not based on
GObject properties.
Instead of special-casing the aggregate implementation for NMSettingVpn,
delegate to a virtual function.

This will also work with other settings, that have properties/secrets
that are not GObject based properties.
For now only add the core settings, no peers' data.

To support peers and the allowed-ips of the peers is more complicated
and will be done later. It's more complicated because these are nested
lists (allowed-ips) inside a list (peers). That is quite unusual and to
conveniently support that in D-Bus API, in keyfile format, in libnm,
and nmcli, is a effort.
Also, it's further complicated by the fact that each peer has a secret (the
preshared-key). Thus we probably need secret flags for each peer, which
is a novelty as well (until now we require a fixed set of secrets per
profile that is well known).
NMSockAddrEndpoint is an immutable structure that contains the endpoint
string of a service. It also includes the (naive) parsing of the host and
port/service parts.

This will be used for the endpoint of WireGuard's peers. But since endpoints
are not something specifict to WireGuard, give it a general name (and
purpose) independent from WireGuard.

Essentially, this structure takes a string in a manner that libnm
understands, and uses it for node and service arguments for
getaddrinfo().

NMSockAddrEndpoint allows to have endpoints that are not parsable into
a host and port part. That is useful because our settings need to be
able to hold invalid values. That is for forward compatibility (server
sends a new endpoint format) and for better error handling (have
invalid settings that can be constructed without loss, but fail later
during the verify() step).
…rd profile

Use the script to test how GObject introspection with libnm's WireGuard
support works.

Also, since support for WireGuard peers is not yet implemented in nmcli
(or other clients), this script is rather useful.
Configuring peers (and allowed-ips of the peers) is not
yet supported.
@thom311
Copy link
Member Author

thom311 commented Jan 28, 2019

closing for the moment, to wait for #288 and #291 . Will be reopened later.

@thom311 thom311 closed this Jan 28, 2019
@thom311 thom311 mentioned this pull request Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants