diff options
author | Thomas Haller <thaller@redhat.com> | 2019-02-22 14:23:52 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-02-22 14:23:52 +0100 |
commit | e2fe19356665b94a16f2a149a330502750694b58 (patch) | |
tree | 0e5a31b430f0569c69515c0a27796cbf64c3461d | |
parent | 4aaa0ed482f4354b5819883a1627d9968e642f1c (diff) | |
parent | 95c8f74f8c05ee8b969cc29ce5298be44d397529 (diff) | |
download | NetworkManager-e2fe19356665b94a16f2a149a330502750694b58.tar.gz |
cli: merge branch 'th/nmcli-wifi-p2p-wfd-ies'
https://github.com/NetworkManager/NetworkManager/pull/300
-rw-r--r-- | clients/common/nm-meta-setting-desc.c | 65 | ||||
-rw-r--r-- | clients/common/nm-meta-setting-desc.h | 3 | ||||
-rw-r--r-- | libnm-core/nm-core-internal.h | 21 | ||||
-rw-r--r-- | libnm-core/nm-utils.c | 147 | ||||
-rw-r--r-- | shared/nm-utils/nm-shared-utils.c | 173 | ||||
-rw-r--r-- | shared/nm-utils/nm-shared-utils.h | 21 | ||||
-rw-r--r-- | src/nm-core-utils.c | 16 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 2 | ||||
-rw-r--r-- | src/supplicant/nm-supplicant-config.c | 46 |
9 files changed, 256 insertions, 238 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 03be32f645..5bfb76fb4c 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -1513,18 +1513,16 @@ bytes_to_string (GBytes *bytes) { const guint8 *data; gsize len; - GString *cert = NULL; - int i; if (!bytes) return NULL; - data = g_bytes_get_data (bytes, &len); - - cert = g_string_new (NULL); - for (i = 0; i < len; i++) - g_string_append_printf (cert, "%02X", data[i]); - return g_string_free (cert, FALSE); + data = g_bytes_get_data (bytes, &len); + return nm_utils_bin2hexstr_full (data, + len, + '\0', + TRUE, + NULL); } static char * @@ -1943,25 +1941,36 @@ nmc_util_is_domain (const char *domain) } static gboolean -nmc_property_set_bytes (NMSetting *setting, const char *prop, const char *value, GError **error) +_set_fcn_gobject_bytes (ARGS_SET_FCN) { - gs_free char *val_strip = NULL; + gs_free char *val_strip_free = NULL; gs_free const char **strv = NULL; + const char *val_strip; const char **iter; gs_unref_bytes GBytes *bytes = NULL; GByteArray *array; nm_assert (!error || !*error); - val_strip = g_strstrip (g_strdup (value)); + val_strip = nm_strstrip_avoid_copy (value, &val_strip_free); /* First try hex string in the format of AAbbCCDd */ bytes = nm_utils_hexstr2bin (val_strip); if (bytes) goto done; + if ( !property_info->property_typ_data + || !property_info->property_typ_data->subtype.gobject_bytes.legacy_format) { + if (value && value[0]) { + g_set_error_literal (error, 1, 0, _("not a valid hex-string")); + return FALSE; + } + /* accept the emtpy word to reset the property to %NULL. */ + goto done; + } + /* Otherwise, consider the following format: AA b 0xCc D */ - strv = nm_utils_strsplit_set (val_strip, " \t", FALSE); + strv = nm_utils_strsplit_set (value, " \t", FALSE); array = g_byte_array_sized_new (NM_PTRARRAY_LEN (strv)); for (iter = strv; iter && *iter; iter++) { int v; @@ -1979,7 +1988,7 @@ nmc_property_set_bytes (NMSetting *setting, const char *prop, const char *value, bytes = g_byte_array_free_to_bytes (array); done: - g_object_set (setting, prop, bytes, NULL); + g_object_set (setting, property_info->property_name, bytes, NULL); return TRUE; } @@ -2096,14 +2105,16 @@ _get_fcn_802_1x_phase2_client_cert (ARGS_GET_FCN) } static gconstpointer -_get_fcn_802_1x_password_raw (ARGS_GET_FCN) +_get_fcn_gobject_bytes (ARGS_GET_FCN) { - NMSetting8021x *s_8021X = NM_SETTING_802_1X (setting); + gs_unref_bytes GBytes *bytes = NULL; char *str; RETURN_UNSUPPORTED_GET_TYPE (); - str = bytes_to_string (nm_setting_802_1x_get_password_raw (s_8021X)); + g_object_get (setting, property_info->property_name, &bytes, NULL); + + str = bytes_to_string (bytes); NM_SET_OUT (out_is_default, !str || !str[0]); RETURN_STR_TO_FREE (str); } @@ -2321,12 +2332,6 @@ DEFINE_SETTER_PRIV_KEY (_set_fcn_802_1x_phase2_private_key, nm_setting_802_1x_get_phase2_private_key_password, nm_setting_802_1x_set_phase2_private_key) -static gboolean -_set_fcn_802_1x_password_raw (ARGS_SET_FCN) -{ - return nmc_property_set_bytes (setting, property_info->property_name, value, error); -} - static gconstpointer _get_fcn_bond_options (ARGS_GET_FCN) { @@ -5049,6 +5054,11 @@ static const NMMetaPropertyType _pt_gobject_mtu = { .set_fcn = _set_fcn_gobject_mtu, }; +static const NMMetaPropertyType _pt_gobject_bytes = { + .get_fcn = _get_fcn_gobject_bytes, + .set_fcn = _set_fcn_gobject_bytes, +}; + static const NMMetaPropertyType _pt_gobject_mac = { .get_fcn = _get_fcn_gobject, .set_fcn = _set_fcn_gobject_mac, @@ -5344,9 +5354,9 @@ static const NMMetaPropertyInfo *const property_infos_802_1X[] = { "(with optional 0x/0X prefix, and optional leading 0).\n\n" "Examples: ab0455a6ea3a74C2\n" " ab 4 55 0xa6 ea 3a 74 C2\n"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_802_1x_password_raw, - .set_fcn = _set_fcn_802_1x_password_raw, + .property_type = &_pt_gobject_bytes, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_bytes, + .legacy_format = TRUE, ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, @@ -7364,7 +7374,7 @@ static const NMMetaPropertyInfo *const property_infos_WIFI_P2P[] = { .prompt = N_("Peer"), .property_type = &_pt_gobject_mac, ), - PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WPS_METHOD, + PROPERTY_INFO_WITH_DESC (NM_SETTING_WIFI_P2P_WPS_METHOD, .property_type = &_pt_gobject_enum, .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, @@ -7372,6 +7382,9 @@ static const NMMetaPropertyInfo *const property_infos_WIFI_P2P[] = { ), ), ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_WIFI_P2P_WFD_IES, + .property_type = &_pt_gobject_bytes, + ), NULL }; diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index 7129870a25..e3f9d230ee 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -269,6 +269,9 @@ struct _NMMetaPropertyTypData { const char *(*validate_fcn) (const char *value, char **out_to_free, GError **error); } gobject_string; struct { + bool legacy_format:1; + } gobject_bytes; + struct { guint32 (*get_fcn) (NMSetting *setting); } mtu; struct { diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index 4a5796bd6e..b737e747f8 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -249,27 +249,6 @@ guint nm_setting_ethtool_init_features (NMSettingEthtool *setting, guint8 *_nm_utils_hwaddr_aton (const char *asc, gpointer buffer, gsize buffer_length, gsize *out_length); const char *nm_utils_hwaddr_ntoa_buf (gconstpointer addr, gsize addr_len, gboolean upper_case, char *buf, gsize buf_len); -char *_nm_utils_bin2hexstr_full (gconstpointer addr, gsize length, const char delimiter, gboolean upper_case, char *out); - -guint8 *_nm_utils_hexstr2bin_full (const char *hexstr, - gboolean allow_0x_prefix, - gboolean delimiter_required, - const char *delimiter_candidates, - gsize required_len, - guint8 *buffer, - gsize buffer_len, - gsize *out_len); - -#define _nm_utils_hexstr2bin_buf(hexstr, allow_0x_prefix, delimiter_required, delimiter_candidates, buffer) \ - _nm_utils_hexstr2bin_full ((hexstr), (allow_0x_prefix), (delimiter_required), (delimiter_candidates), G_N_ELEMENTS (buffer), (buffer), G_N_ELEMENTS (buffer), NULL) - -guint8 *_nm_utils_hexstr2bin_alloc (const char *hexstr, - gboolean allow_0x_prefix, - gboolean delimiter_required, - const char *delimiter_candidates, - gsize required_len, - gsize *out_len); - GSList * _nm_utils_hash_values_to_slist (GHashTable *hash); GHashTable *_nm_utils_copy_strdict (GHashTable *strdict); diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index fd9f87f879..7a745651c0 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -3874,147 +3874,6 @@ nm_utils_hwaddr_len (int type) g_return_val_if_reached (0); } -guint8 * -_nm_utils_hexstr2bin_full (const char *hexstr, - gboolean allow_0x_prefix, - gboolean delimiter_required, - const char *delimiter_candidates, - gsize required_len, - guint8 *buffer, - gsize buffer_len, - gsize *out_len) -{ - const char *in = hexstr; - guint8 *out = buffer; - gboolean delimiter_has = TRUE; - guint8 delimiter = '\0'; - gsize len; - - nm_assert (hexstr); - nm_assert (buffer); - nm_assert (required_len > 0 || out_len); - - if ( allow_0x_prefix - && in[0] == '0' - && in[1] == 'x') - in += 2; - - while (TRUE) { - const guint8 d1 = in[0]; - guint8 d2; - int i1, i2; - - i1 = nm_utils_hexchar_to_int (d1); - if (i1 < 0) - goto fail; - - /* If there's no leading zero (ie "aa:b:cc") then fake it */ - d2 = in[1]; - if ( d2 - && (i2 = nm_utils_hexchar_to_int (d2)) >= 0) { - *out++ = (i1 << 4) + i2; - d2 = in[2]; - if (!d2) - break; - in += 2; - } else { - /* Fake leading zero */ - *out++ = i1; - if (!d2) { - if (!delimiter_has) { - /* when using no delimiter, there must be pairs of hex chars */ - goto fail; - } - break; - } - in += 1; - } - - if (--buffer_len == 0) - goto fail; - - if (delimiter_has) { - if (d2 != delimiter) { - if (delimiter) - goto fail; - if (delimiter_candidates) { - while (delimiter_candidates[0]) { - if (delimiter_candidates++[0] == d2) - delimiter = d2; - } - } - if (!delimiter) { - if (delimiter_required) - goto fail; - delimiter_has = FALSE; - continue; - } - } - in++; - } - } - - len = out - buffer; - if ( required_len == 0 - || len == required_len) { - NM_SET_OUT (out_len, len); - return buffer; - } - -fail: - NM_SET_OUT (out_len, 0); - return NULL; -} - -guint8 * -_nm_utils_hexstr2bin_alloc (const char *hexstr, - gboolean allow_0x_prefix, - gboolean delimiter_required, - const char *delimiter_candidates, - gsize required_len, - gsize *out_len) -{ - guint8 *buffer; - gsize buffer_len, len; - - g_return_val_if_fail (hexstr, NULL); - - nm_assert (required_len > 0 || out_len); - - if ( allow_0x_prefix - && hexstr[0] == '0' - && hexstr[1] == 'x') - hexstr += 2; - - if (!hexstr[0]) - goto fail; - - if (required_len > 0) - buffer_len = required_len; - else - buffer_len = strlen (hexstr) / 2 + 3; - - buffer = g_malloc (buffer_len); - - if (_nm_utils_hexstr2bin_full (hexstr, - FALSE, - delimiter_required, - delimiter_candidates, - required_len, - buffer, - buffer_len, - &len)) { - NM_SET_OUT (out_len, len); - return buffer; - } - - g_free (buffer); - -fail: - NM_SET_OUT (out_len, 0); - return NULL; -} - /** * nm_utils_hexstr2bin: * @hex: a string of hexadecimal characters with optional ':' separators @@ -4032,14 +3891,14 @@ nm_utils_hexstr2bin (const char *hex) guint8 *buffer; gsize len; - buffer = _nm_utils_hexstr2bin_alloc (hex, TRUE, FALSE, ":", 0, &len); + buffer = nm_utils_hexstr2bin_alloc (hex, TRUE, FALSE, ":", 0, &len); if (!buffer) return NULL; buffer = g_realloc (buffer, len); return g_bytes_new_take (buffer, len); } -#define hwaddr_aton(asc, buffer, buffer_len, out_len) _nm_utils_hexstr2bin_full ((asc), FALSE, TRUE, ":-", 0, (buffer), (buffer_len), (out_len)) +#define hwaddr_aton(asc, buffer, buffer_len, out_len) nm_utils_hexstr2bin_full ((asc), FALSE, TRUE, ":-", 0, (buffer), (buffer_len), (out_len)) /** * nm_utils_hwaddr_atoba: @@ -4976,7 +4835,7 @@ _nm_utils_dhcp_duid_valid (const char *duid, GBytes **out_duid_bin) return TRUE; } - if (_nm_utils_hexstr2bin_full (duid, FALSE, FALSE, ":", 0, duid_arr, sizeof (duid_arr), &duid_len)) { + if (nm_utils_hexstr2bin_full (duid, FALSE, FALSE, ":", 0, duid_arr, sizeof (duid_arr), &duid_len)) { /* MAX DUID length is 128 octects + the type code (2 octects). */ if ( duid_len > 2 && duid_len <= (128 + 2)) { diff --git a/shared/nm-utils/nm-shared-utils.c b/shared/nm-utils/nm-shared-utils.c index 270cbb852e..0e427a24c6 100644 --- a/shared/nm-utils/nm-shared-utils.c +++ b/shared/nm-utils/nm-shared-utils.c @@ -2538,8 +2538,10 @@ nm_utils_memeqzero (gconstpointer data, gsize length) /** * nm_utils_bin2hexstr_full: - * @addr: pointer of @length bytes. - * @length: number of bytes in @addr + * @addr: pointer of @length bytes. If @length is zero, this may + * also be %NULL. + * @length: number of bytes in @addr. May also be zero, in which + * case this will return an empty string. * @delimiter: either '\0', otherwise the output string will have the * given delimiter character between each two hex numbers. * @upper_case: if TRUE, use upper case ASCII characters for hex. @@ -2565,9 +2567,6 @@ nm_utils_bin2hexstr_full (gconstpointer addr, const char *LOOKUP = upper_case ? "0123456789ABCDEF" : "0123456789abcdef"; char *out0; - nm_assert (addr); - nm_assert (length > 0); - if (out) out0 = out; else { @@ -2579,18 +2578,162 @@ nm_utils_bin2hexstr_full (gconstpointer addr, /* @out must contain at least @length*3 bytes if @delimiter is set, * otherwise, @length*2+1. */ - for (;;) { - const guint8 v = *in++; + if (length > 0) { + nm_assert (in); + for (;;) { + const guint8 v = *in++; - *out++ = LOOKUP[v >> 4]; - *out++ = LOOKUP[v & 0x0F]; - length--; - if (!length) - break; - if (delimiter) - *out++ = delimiter; + *out++ = LOOKUP[v >> 4]; + *out++ = LOOKUP[v & 0x0F]; + length--; + if (!length) + break; + if (delimiter) + *out++ = delimiter; + } } - *out = 0; + *out = '\0'; return out0; } + +guint8 * +nm_utils_hexstr2bin_full (const char *hexstr, + gboolean allow_0x_prefix, + gboolean delimiter_required, + const char *delimiter_candidates, + gsize required_len, + guint8 *buffer, + gsize buffer_len, + gsize *out_len) +{ + const char *in = hexstr; + guint8 *out = buffer; + gboolean delimiter_has = TRUE; + guint8 delimiter = '\0'; + gsize len; + + nm_assert (hexstr); + nm_assert (buffer); + nm_assert (required_len > 0 || out_len); + + if ( allow_0x_prefix + && in[0] == '0' + && in[1] == 'x') + in += 2; + + while (TRUE) { + const guint8 d1 = in[0]; + guint8 d2; + int i1, i2; + + i1 = nm_utils_hexchar_to_int (d1); + if (i1 < 0) + goto fail; + + /* If there's no leading zero (ie "aa:b:cc") then fake it */ + d2 = in[1]; + if ( d2 + && (i2 = nm_utils_hexchar_to_int (d2)) >= 0) { + *out++ = (i1 << 4) + i2; + d2 = in[2]; + if (!d2) + break; + in += 2; + } else { + /* Fake leading zero */ + *out++ = i1; + if (!d2) { + if (!delimiter_has) { + /* when using no delimiter, there must be pairs of hex chars */ + goto fail; + } + break; + } + in += 1; + } + + if (--buffer_len == 0) + goto fail; + + if (delimiter_has) { + if (d2 != delimiter) { + if (delimiter) + goto fail; + if (delimiter_candidates) { + while (delimiter_candidates[0]) { + if (delimiter_candidates++[0] == d2) + delimiter = d2; + } + } + if (!delimiter) { + if (delimiter_required) + goto fail; + delimiter_has = FALSE; + continue; + } + } + in++; + } + } + + len = out - buffer; + if ( required_len == 0 + || len == required_len) { + NM_SET_OUT (out_len, len); + return buffer; + } + +fail: + NM_SET_OUT (out_len, 0); + return NULL; +} + +guint8 * +nm_utils_hexstr2bin_alloc (const char *hexstr, + gboolean allow_0x_prefix, + gboolean delimiter_required, + const char *delimiter_candidates, + gsize required_len, + gsize *out_len) +{ + guint8 *buffer; + gsize buffer_len, len; + + g_return_val_if_fail (hexstr, NULL); + + nm_assert (required_len > 0 || out_len); + + if ( allow_0x_prefix + && hexstr[0] == '0' + && hexstr[1] == 'x') + hexstr += 2; + + if (!hexstr[0]) + goto fail; + + if (required_len > 0) + buffer_len = required_len; + else + buffer_len = strlen (hexstr) / 2 + 3; + + buffer = g_malloc (buffer_len); + + if (nm_utils_hexstr2bin_full (hexstr, + FALSE, + delimiter_required, + delimiter_candidates, + required_len, + buffer, + buffer_len, + &len)) { + NM_SET_OUT (out_len, len); + return buffer; + } + + g_free (buffer); + +fail: + NM_SET_OUT (out_len, 0); + return NULL; +} diff --git a/shared/nm-utils/nm-shared-utils.h b/shared/nm-utils/nm-shared-utils.h index 4591ab41ac..65e3495983 100644 --- a/shared/nm-utils/nm-shared-utils.h +++ b/shared/nm-utils/nm-shared-utils.h @@ -1128,10 +1128,31 @@ nm_strv_ptrarray_take_gstring (GPtrArray *cmd, int nm_utils_getpagesize (void); +/*****************************************************************************/ + char *nm_utils_bin2hexstr_full (gconstpointer addr, gsize length, char delimiter, gboolean upper_case, char *out); +guint8 *nm_utils_hexstr2bin_full (const char *hexstr, + gboolean allow_0x_prefix, + gboolean delimiter_required, + const char *delimiter_candidates, + gsize required_len, + guint8 *buffer, + gsize buffer_len, + gsize *out_len); + +#define nm_utils_hexstr2bin_buf(hexstr, allow_0x_prefix, delimiter_required, delimiter_candidates, buffer) \ + nm_utils_hexstr2bin_full ((hexstr), (allow_0x_prefix), (delimiter_required), (delimiter_candidates), G_N_ELEMENTS (buffer), (buffer), G_N_ELEMENTS (buffer), NULL) + +guint8 *nm_utils_hexstr2bin_alloc (const char *hexstr, + gboolean allow_0x_prefix, + gboolean delimiter_required, + const char *delimiter_candidates, + gsize required_len, + gsize *out_len); + #endif /* __NM_SHARED_UTILS_H__ */ diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index 340bbcdb15..809e98a10c 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -2428,14 +2428,14 @@ again: if ( nm_utils_file_get_contents (-1, "/etc/machine-id", 100*1024, 0, &content, NULL, NULL) >= 0 || nm_utils_file_get_contents (-1, LOCALSTATEDIR"/lib/dbus/machine-id", 100*1024, 0, &content, NULL, NULL) >= 0) { g_strstrip (content); - if (_nm_utils_hexstr2bin_full (content, - FALSE, - FALSE, - NULL, - 16, - (guint8 *) &uuid, - sizeof (uuid), - NULL)) { + if (nm_utils_hexstr2bin_full (content, + FALSE, + FALSE, + NULL, + 16, + (guint8 *) &uuid, + sizeof (uuid), + NULL)) { if (!nm_utils_uuid_is_null (&uuid)) { /* an all-zero machine-id is not valid. */ is_fake = FALSE; diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index ba5eb916cc..ff1fc0beed 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -187,7 +187,7 @@ _secret_password_raw_to_bytes (const char *ifcfg_key, password_raw += 2; secret = nm_secret_buf_new (strlen (password_raw) / 2 + 3); - if (!_nm_utils_hexstr2bin_full (password_raw, FALSE, FALSE, ":", 0, secret->bin, secret->len, &len)) { + if (!nm_utils_hexstr2bin_full (password_raw, FALSE, FALSE, ":", 0, secret->bin, secret->len, &len)) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Invalid hex password in %s", ifcfg_key); diff --git a/src/supplicant/nm-supplicant-config.c b/src/supplicant/nm-supplicant-config.c index 0b269f11c9..7708224b35 100644 --- a/src/supplicant/nm-supplicant-config.c +++ b/src/supplicant/nm-supplicant-config.c @@ -403,11 +403,11 @@ nm_supplicant_config_add_setting_macsec (NMSupplicantConfig * self, value = nm_setting_macsec_get_mka_cak (setting); if ( !value - || !_nm_utils_hexstr2bin_buf (value, - FALSE, - FALSE, - NULL, - buffer_cak)) { + || !nm_utils_hexstr2bin_buf (value, + FALSE, + FALSE, + NULL, + buffer_cak)) { g_set_error_literal (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG, @@ -424,11 +424,11 @@ nm_supplicant_config_add_setting_macsec (NMSupplicantConfig * self, value = nm_setting_macsec_get_mka_ckn (setting); if ( !value - || !_nm_utils_hexstr2bin_buf (value, - FALSE, - FALSE, - NULL, - buffer_ckn)) { + || !nm_utils_hexstr2bin_buf (value, + FALSE, + FALSE, + NULL, + buffer_ckn)) { g_set_error_literal (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG, @@ -704,14 +704,14 @@ add_wep_key (NMSupplicantConfig *self, if ((key_len == 10) || (key_len == 26)) { guint8 buffer[26/2]; - if (!_nm_utils_hexstr2bin_full (key, - FALSE, - FALSE, - NULL, - key_len / 2, - buffer, - sizeof (buffer), - NULL)) { + if (!nm_utils_hexstr2bin_full (key, + FALSE, + FALSE, + NULL, + key_len / 2, + buffer, + sizeof (buffer), + NULL)) { g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG, "cannot add wep-key %s to suplicant config because key is not hex", name); @@ -825,11 +825,11 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, guint8 buffer[32]; /* Hex PSK */ - if (!_nm_utils_hexstr2bin_buf (psk, - FALSE, - FALSE, - NULL, - buffer)) { + if (!nm_utils_hexstr2bin_buf (psk, + FALSE, + FALSE, + NULL, + buffer)) { g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG, "Cannot add psk to supplicant config due to invalid hex"); return FALSE; |