aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/config.c
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 /wpa_supplicant/config.c
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 'wpa_supplicant/config.c')
-rw-r--r--wpa_supplicant/config.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 7ecc5b0..b1c7870 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -3778,21 +3778,11 @@ static int wpa_global_config_parse_bin(const struct global_parse_data *data,
struct wpa_config *config, int line,
const char *pos)
{
- size_t len;
struct wpabuf **dst, *tmp;
- len = os_strlen(pos);
- if (len & 0x01)
- return -1;
-
- tmp = wpabuf_alloc(len / 2);
- if (tmp == NULL)
- return -1;
-
- if (hexstr2bin(pos, wpabuf_put(tmp, len / 2), len / 2)) {
- wpabuf_free(tmp);
+ tmp = wpabuf_parse_bin(pos);
+ if (!tmp)
return -1;
- }
dst = (struct wpabuf **) (((u8 *) config) + (long) data->param1);
wpabuf_free(*dst);