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>
This commit is contained in:
David Spinadel 2016-04-06 19:42:02 +03:00 committed by Jouni Malinen
parent 74e982d8d7
commit 9d955f751e
4 changed files with 38 additions and 40 deletions

View file

@ -3778,22 +3778,12 @@ 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)
tmp = wpabuf_parse_bin(pos);
if (!tmp)
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);
return -1;
}
dst = (struct wpabuf **) (((u8 *) config) + (long) data->param1);
wpabuf_free(*dst);
*dst = tmp;