Add ca_path option for 802.1x connections

Special notes:
Hash the cacert in the ca_path as OpenSSL needs symlinks for ca
certificates from their symlinks to their filename if specifying a
directory.

In case ieee802_1x.ca_path is specified but not supported by
NetworkManager, fail to ensure the setting is not silently ignored.

References:
https://stackoverflow.com/questions/25889341/what-is-the-equivalent-of-unix-c-rehash-command-script-on-linux
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448

Co-authored-by: Till Maas <opensource@till.name>
This commit is contained in:
Jack Adolph 2020-05-17 18:10:50 +10:00 committed by Till Maas
parent f72fc394ea
commit dd4ae77cbf
10 changed files with 287 additions and 57 deletions

View file

@ -871,12 +871,21 @@ class ArgValidator_Dict802_1X(ArgValidatorDict):
),
ArgValidatorPath("client_cert", required=True),
ArgValidatorPath("ca_cert"),
ArgValidatorPath("ca_path"),
ArgValidatorBool("system_ca_certs", default_value=False),
ArgValidatorStr("domain_suffix_match", required=False),
],
default_value=None,
)
def _validate_post(self, value, name, result):
if result["system_ca_certs"] is True and result["ca_path"] is not None:
raise ValidationError(
name,
"ca_path will be ignored by NetworkManager if system_ca_certs is used",
)
return result
class ArgValidator_DictConnection(ArgValidatorDict):