diff options
author | Thomas Haller <thaller@redhat.com> | 2019-03-01 15:52:19 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-03-07 22:22:39 +0100 |
commit | 76828262299729e718924d5c14a69cfdc5cf48fa (patch) | |
tree | 8393f120393102624fe52e636b89d5c711ff92a3 /src/nm-firewall-manager.c | |
parent | 4a137f919b452255eef985ef1eee52c277599dd0 (diff) | |
download | NetworkManager-76828262299729e718924d5c14a69cfdc5cf48fa.tar.gz |
libnm: change nm_wireguard_peer_set_preshared_key() API to allow validation
This is an API break since 1.16-rc1.
The functions like _nm_utils_wireguard_decode_key() are internal API
and not accessible to a libnm user. Maybe this should be public API,
but for now it is not.
That makes it cumbersome for a client to validate the setting. The client
could only reimplement the validation (bad) or go ahead and set invalid
value.
When setting an invalid value, the user can afterwards detect it via
nm_wireguard_peer_is_valid(), but at that point, it's not clear which
exact property is invalid.
First I wanted to keep the API conservative and not promissing too much.
For example, not promising to do any validation when setting the key.
However, libnm indeed validates the key at the time of setting it
instead of doing lazy validation later. This makes sense, so we can
keep this promise and just expose the validation result to the caller.
Another downside of this is that the API just got more complicated.
But it not provides a validation API, that we previously did not have.
(cherry picked from commit d7bc1750c1bcc5082528d1f277e09454b2cbf1c2)
Diffstat (limited to 'src/nm-firewall-manager.c')
0 files changed, 0 insertions, 0 deletions