aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2016-04-06 16:42:02 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-09 08:23:36 (GMT)
commit9d955f751ee721d77a451f67679450b7bbfcc4f6 (patch)
tree2abe6931b538e7a63729863a347bf6568bf7143d /hostapd
parent74e982d8d723ca6ff9e54dc01dbd3ed380048f9b (diff)
downloadhostap-9d955f751ee721d77a451f67679450b7bbfcc4f6.zip
hostap-9d955f751ee721d77a451f67679450b7bbfcc4f6.tar.gz
hostap-9d955f751ee721d77a451f67679450b7bbfcc4f6.tar.bz2
utils: Rename hostapd_parse_bin to wpabuf_parse_bin and move it
Make the function available as part of the wpabuf API. Use this renamed function where possible. Signed-off-by: David Spinadel <david.spinadel@intel.com>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 9e17388..3e8130b 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1920,29 +1920,6 @@ static int hs20_parse_osu_service_desc(struct hostapd_bss_config *bss,
#endif /* CONFIG_HS20 */
-static struct wpabuf * hostapd_parse_bin(const char *buf)
-{
- size_t len;
- struct wpabuf *ret;
-
- len = os_strlen(buf);
- if (len & 0x01)
- return NULL;
- len /= 2;
-
- ret = wpabuf_alloc(len);
- if (ret == NULL)
- return NULL;
-
- if (hexstr2bin(buf, wpabuf_put(ret, len), len)) {
- wpabuf_free(ret);
- return NULL;
- }
-
- return ret;
-}
-
-
#ifdef CONFIG_ACS
static int hostapd_config_parse_acs_chan_bias(struct hostapd_config *conf,
char *pos)
@@ -3029,15 +3006,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->wps_nfc_pw_from_config = 1;
} else if (os_strcmp(buf, "wps_nfc_dh_pubkey") == 0) {
wpabuf_free(bss->wps_nfc_dh_pubkey);
- bss->wps_nfc_dh_pubkey = hostapd_parse_bin(pos);
+ bss->wps_nfc_dh_pubkey = wpabuf_parse_bin(pos);
bss->wps_nfc_pw_from_config = 1;
} else if (os_strcmp(buf, "wps_nfc_dh_privkey") == 0) {
wpabuf_free(bss->wps_nfc_dh_privkey);
- bss->wps_nfc_dh_privkey = hostapd_parse_bin(pos);
+ bss->wps_nfc_dh_privkey = wpabuf_parse_bin(pos);
bss->wps_nfc_pw_from_config = 1;
} else if (os_strcmp(buf, "wps_nfc_dev_pw") == 0) {
wpabuf_free(bss->wps_nfc_dev_pw);
- bss->wps_nfc_dev_pw = hostapd_parse_bin(pos);
+ bss->wps_nfc_dev_pw = wpabuf_parse_bin(pos);
bss->wps_nfc_pw_from_config = 1;
#endif /* CONFIG_WPS_NFC */
#endif /* CONFIG_WPS */
@@ -3487,10 +3464,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->no_auth_if_seen_on = os_strdup(pos);
} else if (os_strcmp(buf, "lci") == 0) {
wpabuf_free(conf->lci);
- conf->lci = hostapd_parse_bin(pos);
+ conf->lci = wpabuf_parse_bin(pos);
} else if (os_strcmp(buf, "civic") == 0) {
wpabuf_free(conf->civic);
- conf->civic = hostapd_parse_bin(pos);
+ conf->civic = wpabuf_parse_bin(pos);
} else {
wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'",