Files
NetworkManager/shared/systemd/nm-sd-utils-shared.h
Thomas Haller dec1678fec dhcp: enforce MUD URL to use "https://" scheme
nm_sd_http_url_is_valid_https() is rather clunky, but it is
this way, because we must not disagree with systemd code
about what makes a valid URL.

RFC 8520 says "MUD URLs MUST use the "https" scheme".

See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/463#note_476190

Fixes: cedcea5ee8 ('libnm: fix verification of connection:mud-url property')
2020-04-24 20:54:13 +02:00

42 lines
1.4 KiB
C

// SPDX-License-Identifier: LGPL-2.1+
/*
* Copyright (C) 2018 Red Hat, Inc.
*/
#ifndef __NM_SD_UTILS_SHARED_H__
#define __NM_SD_UTILS_SHARED_H__
/*****************************************************************************/
gboolean nm_sd_utils_path_equal (const char *a, const char *b);
char *nm_sd_utils_path_simplify (char *path, gboolean kill_dots);
const char *nm_sd_utils_path_startswith (const char *path, const char *prefix);
/*****************************************************************************/
int nm_sd_utils_unbase64char (char ch, gboolean accept_padding_equal);
int nm_sd_utils_unbase64mem (const char *p,
size_t l,
gboolean secure,
guint8 **mem,
size_t *len);
/*****************************************************************************/
int nm_sd_dns_name_to_wire_format (const char *domain,
guint8 *buffer,
size_t len,
gboolean canonical);
int nm_sd_dns_name_is_valid (const char *s);
gboolean nm_sd_hostname_is_valid(const char *s, bool allow_trailing_dot);
/*****************************************************************************/
gboolean nm_sd_http_url_is_valid_https (const char *url);
#endif /* __NM_SD_UTILS_SHARED_H__ */