* Wes Hardaker (c) 2000
* wjhardaker@ucdavis.edu
*
- * $Id: packet-kerberos.c,v 1.20 2002/01/21 07:36:36 guy Exp $
+ * $Id: packet-kerberos.c,v 1.24 2002/08/22 08:47:13 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <string.h>
#include <ctype.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
#include <glib.h>
#include <epan/packet.h>
#include <epan/strutil.h>
#include "asn1.h"
+#include "packet-netbios.h"
#define UDP_PORT_KERBEROS 88
#define TCP_PORT_KERBEROS 88
#define KRB5_ADDR_ISO 0x07
#define KRB5_ADDR_DECNET 0x0c
#define KRB5_ADDR_APPLETALK 0x10
+#define KRB5_ADDR_NETBIOS 0x14
/* encryption type constants */
#define KRB5_ENCTYPE_NULL 0
{ KRB5_ADDR_ISO, "ISO"},
{ KRB5_ADDR_DECNET, "DECNET"},
{ KRB5_ADDR_APPLETALK, "APPLETALK"},
+ { KRB5_ADDR_NETBIOS, "NETBIOS"},
{ 0, NULL },
};
static int dissect_PrincipalName(char *title, ASN1_SCK *asn1p,
packet_info *pinfo, proto_tree *tree,
int start_offset);
-static int dissect_Ticket(char *title, ASN1_SCK *asn1p, packet_info *pinfo,
+static int dissect_Ticket(ASN1_SCK *asn1p, packet_info *pinfo,
proto_tree *tree, int start_offset);
static int dissect_EncryptedData(char *title, ASN1_SCK *asn1p,
packet_info *pinfo, proto_tree *tree,
int start_offset);
-static int dissect_Addresses(char *title, ASN1_SCK *asn1p, packet_info *pinfo,
+static int dissect_Addresses(ASN1_SCK *asn1p, packet_info *pinfo,
proto_tree *tree, int start_offset);
static const char *
if (CHECK_CONTEXT_TYPE(KRB5_BODY_ADDRESSES)) {
/* addresses supplied */
- length = dissect_Addresses("Addresses", asn1p, pinfo, kerberos_tree,
+ length = dissect_Addresses(asn1p, pinfo, kerberos_tree,
offset);
if (offset == -1)
return -1;
end = asn1p->offset + item_len;
while(asn1p->offset < end) {
KRB_DECODE_CONTEXT_HEAD_OR_DIE("ticket", KRB5_KDC_REP_TICKET);
- length = dissect_Ticket("ticket", asn1p, pinfo, additional_tickets_tree,
+ length = dissect_Ticket(asn1p, pinfo, additional_tickets_tree,
offset);
if (length == -1)
return -1;
offset += item_len;
KRB_DECODE_CONTEXT_HEAD_OR_DIE("ticket", KRB5_KDC_REP_TICKET);
- length = dissect_Ticket("ticket", asn1p, pinfo, kerberos_tree, offset);
+ length = dissect_Ticket(asn1p, pinfo, kerberos_tree, offset);
if (length == -1)
return -1;
offset += length;
}
static int
-dissect_Addresses(char *title, ASN1_SCK *asn1p, packet_info *pinfo,
+dissect_Addresses(ASN1_SCK *asn1p, packet_info *pinfo,
proto_tree *tree, int start_offset) {
proto_tree *address_tree = NULL;
int offset = start_offset;
int str_len;
guchar *str;
+ char netbios_name[(NETBIOS_NAME_LEN - 1)*4 + 1];
+ int netbios_name_type;
+
KRB_HEAD_DECODE_OR_DIE("sequence of addresses");
if (tree) {
item = proto_tree_add_text(tree, asn1p->tvb, offset,
str_len, "Value: %d.%d.%d.%d",
str[0], str[1], str[2], str[3]);
break;
+
+ case KRB5_ADDR_NETBIOS:
+ if (str_len == NETBIOS_NAME_LEN) {
+ netbios_name_type = process_netbios_name(str,
+ netbios_name);
+ proto_tree_add_text(address_tree, asn1p->tvb, tmp_pos2,
+ str_len,
+ "Value: %s<%02x> (%s)",
+ netbios_name, netbios_name_type,
+ netbios_name_type_descr(netbios_name_type));
+ } else {
+ proto_tree_add_text(address_tree, asn1p->tvb, tmp_pos2,
+ str_len,
+ "Value (Invalid length %d, should be 16): \"%s\"",
+ str_len, format_text(str, str_len));
+ }
+ break;
default:
proto_tree_add_text(address_tree, asn1p->tvb, tmp_pos2,
}
static int
-dissect_Ticket(char *title, ASN1_SCK *asn1p, packet_info *pinfo,
+dissect_Ticket(ASN1_SCK *asn1p, packet_info *pinfo,
proto_tree *tree, int start_offset)
{
/*