mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-14 04:20:21 +01:00
The keyfile code has to handle a few different formats of cert/key values, and wasn't doing a good enough job of detecting plain paths as values. By default the writer will write out a plain path (ie, not prefixed with file://) and the reader will handle that correctly, *unless* that file does not exist, at which the reader assumed it was a byte array. This caused the read-in keyfile not to match the in-memory connection (since the in-memory connection though the cert/key held a path, but the read-in one thought it contained a blob) and this seems to eventually have triggered a write-out with the new values (as a blob), which would then drop a .pem file into system-connections/ containing the path that should have been in the keyfile in the first place. This all happened because we assumed that the given path for the cert or key would actually be valid, which doesn't seem to be the case for a lot of people. Clearly these connections won't work (since the certificate or key does not exist) but the keyfile plugin shouldn't be messing up the connection's settings at the very least. Fix that by handling the check of whether the cert/key data is a path or not in a less restrictive manner and add some testcases to make sure that everything works as we expect. |
||
|---|---|---|
| .. | ||
| tests | ||
| common.h | ||
| errors.c | ||
| Makefile.am | ||
| nm-keyfile-connection.c | ||
| nm-keyfile-connection.h | ||
| plugin.c | ||
| plugin.h | ||
| reader.c | ||
| reader.h | ||
| utils.c | ||
| utils.h | ||
| writer.c | ||
| writer.h | ||