* Copyright 2002, Tim Potter <tpot@samba.org>
* Copyright 1999, Andrew Tridgell <tridge@samba.org>
*
- * $Id: packet-http.c,v 1.52 2002/08/13 05:38:04 tpot Exp $
+ * $Id: packet-http.c,v 1.55 2002/08/14 23:34:20 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
{
tvbuff_t *tvb;
char *data = g_strdup(base64);
- ssize_t len;
+ size_t len;
len = base64_decode(data);
tvb = tvb_new_real_data(data, len, len);
- /* XXX: need to set free function */
+ tvb_set_free_cb(tvb, g_free);
return tvb;
}
static void
-dissect_http_ntlmssp(packet_info *pinfo, proto_tree *tree, char *line)
+dissect_http_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char *line)
{
tvbuff_t *ntlmssp_tvb;
ntlmssp_tvb = base64_to_tvb(line);
+ tvb_set_child_real_data_tvbuff(tvb, ntlmssp_tvb);
+ add_new_data_source(pinfo, ntlmssp_tvb, "NTLMSSP Data");
call_dissector(ntlmssp_handle, ntlmssp_tvb, pinfo, tree);
-
- tvb_free(ntlmssp_tvb);
}
static void
hdr_tree = proto_item_add_subtree(
hdr_item, ett_http_ntlmssp);
text += strlen(NTLMSSP_AUTH);
- dissect_http_ntlmssp(pinfo, hdr_tree, text);
+ dissect_http_ntlmssp(tvb, pinfo, hdr_tree, text);
}
if (strncmp(text, NTLMSSP_WWWAUTH, strlen(NTLMSSP_WWWAUTH)) == 0) {
hdr_tree = proto_item_add_subtree(
hdr_item, ett_http_ntlmssp);
text += strlen(NTLMSSP_WWWAUTH);
- dissect_http_ntlmssp(pinfo, hdr_tree, text);
+ dissect_http_ntlmssp(tvb, pinfo, hdr_tree, text);
}
}
offset = next_offset;