NetworkManager/clients/cloud-setup
Thomas Haller 511b4ab411
cloud-setup: add and use nmcs_utils_hwaddr_normalize_gbytes()
Previously we would call

    nmcs_utils_hwaddr_normalize(g_bytes_get_data(response, NULL), -1);

which treats the data in response as NUL terminated. That is not
entirely wrong, because the HTTP request's response is guaranteed
to have a NUL termination at the end. However, it doesn't seam to good
either.

For one, we already have the length. Use it. But also, if the response
contains any NUL bytes in the middle, then this would wrongly only
consider the first line. We should not accept "00:11:22:33:44:55\0bogus"
as valid.

While at it, reject NUL characters from nmcs_utils_hwaddr_normalize() --
except one NUL at the end.
2021-01-08 16:32:48 +01:00
..
90-nm-cloud-setup.sh cloud-setup: let dispatcher script run tool only if service is enabled 2019-12-03 16:18:33 +01:00
main.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
meson.build all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-cloud-setup-utils.c cloud-setup: add and use nmcs_utils_hwaddr_normalize_gbytes() 2021-01-08 16:32:48 +01:00
nm-cloud-setup-utils.h cloud-setup: add and use nmcs_utils_hwaddr_normalize_gbytes() 2021-01-08 16:32:48 +01:00
nm-cloud-setup.service.in cloud-setup: add tool for automatic IP configuration in cloud 2020-07-29 15:56:15 +02:00
nm-cloud-setup.timer cloud-setup: add tool for automatic IP configuration in cloud 2019-11-28 19:52:18 +01:00
nm-http-client.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-http-client.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider-azure.c cloud-setup: add and use nmcs_utils_hwaddr_normalize_gbytes() 2021-01-08 16:32:48 +01:00
nmcs-provider-azure.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider-ec2.c cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00
nmcs-provider-ec2.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider-gcp.c cloud-setup: add and use nmcs_utils_hwaddr_normalize_gbytes() 2021-01-08 16:32:48 +01:00
nmcs-provider-gcp.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nmcs-provider.c cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00
nmcs-provider.h cloud-setup: move common code for get_config() to base class and improve cancellation 2021-01-08 16:32:48 +01:00