2005-03-08 22:32:43 +00:00
|
|
|
/* packet-kink.c
|
2011-02-07 18:49:29 +00:00
|
|
|
* Routines for KINK packet disassembly
|
2005-03-08 22:32:43 +00:00
|
|
|
* It is referrenced draft-ietf-kink-kink-jp-04.txt,v 1.14 2003/02/10
|
2011-02-07 18:49:29 +00:00
|
|
|
*
|
2005-03-14 10:27:25 +00:00
|
|
|
* Copyright 2004, Takeshi Nakashima <T.Nakashima@jp.yokogawa.com>
|
2005-03-08 22:32:43 +00:00
|
|
|
*
|
2005-03-09 03:04:46 +00:00
|
|
|
* $Id$
|
2005-03-08 22:32:43 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-03-08 22:32:43 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-03-08 22:32:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2013-02-27 03:35:04 +00:00
|
|
|
#include <epan/expert.h>
|
2007-05-06 22:34:05 +00:00
|
|
|
#include <epan/asn1.h>
|
2005-03-08 22:32:43 +00:00
|
|
|
#include "packet-kerberos.h"
|
2005-06-16 06:19:03 +00:00
|
|
|
#include "packet-isakmp.h"
|
2005-03-08 22:32:43 +00:00
|
|
|
|
2011-02-07 18:49:29 +00:00
|
|
|
#define KINK_PORT 57203
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
#define KINK_ISAKMP_PAYLOAD_BASE 14
|
|
|
|
|
|
|
|
static int proto_kink = -1;
|
|
|
|
|
|
|
|
/* Argument for proto_tree_add_uint() */
|
|
|
|
static int hf_kink_type = -1;
|
|
|
|
static int hf_kink_length = -1;
|
|
|
|
static int hf_kink_transactionId = -1;
|
|
|
|
static int hf_kink_checkSumLength = -1;
|
|
|
|
static int hf_kink_A = -1;
|
2013-02-27 03:35:04 +00:00
|
|
|
static int hf_kink_reserved8 = -1;
|
|
|
|
static int hf_kink_reserved15 = -1;
|
|
|
|
static int hf_kink_reserved16 = -1;
|
|
|
|
static int hf_kink_reserved24 = -1;
|
2005-03-08 22:32:43 +00:00
|
|
|
static int hf_kink_checkSum = -1;
|
|
|
|
static int hf_kink_next_payload = -1;
|
2013-02-27 03:35:04 +00:00
|
|
|
static int hf_kink_payload_length = -1;
|
|
|
|
static int hf_kink_epoch = -1;
|
|
|
|
static int hf_kink_inner_next_pload = -1;
|
|
|
|
static int hf_kink_realm_name_length = -1;
|
|
|
|
static int hf_kink_realm_name = -1;
|
|
|
|
static int hf_kink_princ_name_length = -1;
|
|
|
|
static int hf_kink_princ_name = -1;
|
|
|
|
static int hf_kink_tgt_length = -1;
|
|
|
|
static int hf_kink_tgt = -1;
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
/* Argument for making the subtree */
|
|
|
|
static gint ett_kink = -1;
|
|
|
|
/*static gint ett_kink_version = -1;*/
|
2011-02-07 18:49:29 +00:00
|
|
|
static gint ett_kink_payload = -1;
|
2005-03-08 22:32:43 +00:00
|
|
|
static gint ett_payload_kink_ap_req = -1;
|
|
|
|
static gint ett_payload_kink_ap_rep = -1;
|
|
|
|
static gint ett_payload_kink_krb_error = -1;
|
|
|
|
static gint ett_payload_kink_tgt_req = -1;
|
|
|
|
static gint ett_payload_kink_tgt_rep = -1;
|
|
|
|
static gint ett_payload_kink_isakmp = -1;
|
|
|
|
static gint ett_payload_kink_encrypt = -1;
|
|
|
|
static gint ett_payload_kink_error = -1;
|
|
|
|
static gint ett_payload_not_defined = -1;
|
2005-05-27 08:53:07 +00:00
|
|
|
static gint ett_decrypt_kink_encrypt = -1;
|
2005-03-08 22:32:43 +00:00
|
|
|
|
2013-05-26 03:29:07 +00:00
|
|
|
static expert_field ei_kink_payload_length_small = EI_INIT;
|
|
|
|
static expert_field ei_kink_payload_length_mismatch = EI_INIT;
|
|
|
|
|
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* Define the kink type value */
|
|
|
|
#define KINK_TYPE_RESERVED 0
|
|
|
|
#define KINK_TYPE_CREATE 1
|
|
|
|
#define KINK_TYPE_DELETE 2
|
|
|
|
#define KINK_TYPE_REPLY 3
|
|
|
|
#define KINK_TYPE_GETTGT 4
|
|
|
|
#define KINK_TYPE_ACK 5
|
|
|
|
#define KINK_TYPE_STATUS 6
|
|
|
|
|
|
|
|
static const value_string kink_type_vals[]={
|
|
|
|
{KINK_TYPE_RESERVED,"RESERVED"},
|
|
|
|
{KINK_TYPE_CREATE,"CREATE"},
|
|
|
|
{KINK_TYPE_DELETE,"DELETE"},
|
|
|
|
{KINK_TYPE_REPLY,"REPLY"},
|
|
|
|
{KINK_TYPE_GETTGT,"GETTGT"},
|
|
|
|
{KINK_TYPE_ACK,"ACK"},
|
|
|
|
{KINK_TYPE_STATUS,"STATUS"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Define the kink A value */
|
|
|
|
#define KINK_A_NOT_REQUEST_ACK 0
|
|
|
|
#define KINK_A_REQUEST_ACK 1
|
|
|
|
|
|
|
|
static const value_string kink_A_vals[]={
|
|
|
|
{KINK_A_NOT_REQUEST_ACK,"Not Request ACK"},
|
|
|
|
{KINK_A_REQUEST_ACK,"Request ACK"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Define the kink payload */
|
|
|
|
#define KINK_DONE 0
|
|
|
|
#define KINK_AP_REQ KINK_ISAKMP_PAYLOAD_BASE+0
|
|
|
|
#define KINK_AP_REP KINK_ISAKMP_PAYLOAD_BASE+1
|
|
|
|
#define KINK_KRB_ERROR KINK_ISAKMP_PAYLOAD_BASE+2
|
|
|
|
#define KINK_TGT_REQ KINK_ISAKMP_PAYLOAD_BASE+3
|
|
|
|
#define KINK_TGT_REP KINK_ISAKMP_PAYLOAD_BASE+4
|
|
|
|
#define KINK_ISAKMP KINK_ISAKMP_PAYLOAD_BASE+5
|
|
|
|
#define KINK_ENCRYPT KINK_ISAKMP_PAYLOAD_BASE+6
|
|
|
|
#define KINK_ERROR KINK_ISAKMP_PAYLOAD_BASE+7
|
|
|
|
|
|
|
|
static const value_string kink_next_payload[]={
|
|
|
|
{KINK_DONE, "KINK_DONE"},
|
|
|
|
{KINK_AP_REQ, "KINK_AP_REQ"},
|
|
|
|
{KINK_AP_REP, "KINK_AP_REP"},
|
|
|
|
{KINK_KRB_ERROR, "KINK_KRB_ERROR"},
|
|
|
|
{KINK_TGT_REQ, "KINK_TGT_REQ"},
|
|
|
|
{KINK_TGT_REP, "KINK_TGT_REP"},
|
|
|
|
{KINK_ISAKMP, "KINK_ISAKMP"},
|
|
|
|
{KINK_ENCRYPT, "KINK_ENCRYPT"},
|
|
|
|
{KINK_ERROR, "KINK_ERROR"},
|
|
|
|
{0, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Define the magic number
|
2011-02-07 18:49:29 +00:00
|
|
|
* Using at the kink error
|
2005-03-08 22:32:43 +00:00
|
|
|
*/
|
|
|
|
#define KINK_OK 0
|
|
|
|
#define KINK_PROTOERR 1
|
|
|
|
#define KINK_INVDOI 2
|
|
|
|
#define KINK_INVMAJ 3
|
|
|
|
#define KINK_INVMIN 4
|
|
|
|
#define KINK_INTERR 5
|
|
|
|
#define KINK_BADQMVERS 6
|
|
|
|
#define BOTTOM_RESERVED 7
|
|
|
|
#define TOP_RESERVED 8191
|
|
|
|
#define BOTTOM_PRIVATE_USE 8192
|
2011-02-07 18:49:29 +00:00
|
|
|
#define TOP_PRIVATE_USE 16383
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
/* Using at the kink header */
|
|
|
|
#define IPSEC 1
|
|
|
|
#define VERSION_BIT_SHIFT 4
|
|
|
|
#define A_BIT_SHIFT 7
|
|
|
|
#define FROM_TYPE_TO_RESERVED 16
|
|
|
|
|
|
|
|
/* Using at the payload */
|
|
|
|
#define TO_PAYLOAD_LENGTH 2
|
|
|
|
#define PADDING 4
|
|
|
|
#define KINK_KRB_ERROR_HEADER 4
|
|
|
|
#define FROM_NP_TO_PL 4
|
|
|
|
#define TO_REALM_NAME_LENGTH 4
|
|
|
|
#define KINK_TGT_REQ_HEADER 6
|
|
|
|
#define FRONT_TGT_REP_HEADER 6
|
|
|
|
#define PAYLOAD_HEADER 8
|
|
|
|
#define KINK_ERROR_LENGTH 8
|
|
|
|
|
|
|
|
|
|
|
|
/* define hexadecimal */
|
|
|
|
#define FRONT_FOUR_BIT 0xf0
|
|
|
|
#define SECOND_FOUR_BIT 0x0f
|
|
|
|
#define FRONT_ONE_BIT 0x80
|
|
|
|
#define SECOND_FIFTEEN_BIT 0x7fff
|
|
|
|
|
2005-05-27 08:53:07 +00:00
|
|
|
/* decrypt element */
|
|
|
|
static guint32 keytype;
|
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
static void control_payload(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 next_payload, proto_tree *kink_payload_tree);
|
|
|
|
static void dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_krb_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_tgt_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_tgt_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
|
|
|
static void dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree);
|
2007-03-22 15:19:49 +00:00
|
|
|
#ifdef HAVE_KERBEROS
|
2005-05-27 08:53:07 +00:00
|
|
|
static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length);
|
2007-03-22 15:19:49 +00:00
|
|
|
#endif
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* This function is dissecting the kink header. */
|
2011-02-07 18:49:29 +00:00
|
|
|
static void
|
2005-03-08 22:32:43 +00:00
|
|
|
dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
proto_tree *kink_tree = NULL;
|
|
|
|
guint8 type;
|
|
|
|
guint8 major_version, minor_version, version;
|
|
|
|
guint32 doi;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint chsumlen;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint8 next_payload;
|
|
|
|
guint8 value_a_and_front_reserved;
|
|
|
|
guint8 value_a;
|
|
|
|
int offset=0;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
type = tvb_get_guint8(tvb,offset);
|
|
|
|
|
2009-08-09 07:59:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KINK");
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* It shows kink type by the type value. */
|
2013-06-14 01:02:11 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, kink_type_vals, "unknown"));
|
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* Make the kink tree */
|
2013-06-14 01:02:11 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_kink, tvb, offset, -1, ENC_NA);
|
|
|
|
kink_tree = proto_item_add_subtree(ti, ett_kink);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
proto_tree_add_uint(kink_tree, hf_kink_type, tvb, offset, 1, type);
|
|
|
|
offset++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
|
|
|
/* This part is the version. Consider less than 1 octet value.
|
2005-03-08 22:32:43 +00:00
|
|
|
* Major version and minor version is 4bit. Front half of 1octet
|
|
|
|
* is major version, and second half of 1octet is minor version.
|
|
|
|
* The calculation of major version is shown below.
|
|
|
|
* The logical product of the value of 1octet and 0xf0 is performed.
|
|
|
|
* And It is performed 4bit right shift.
|
|
|
|
* Secondarily, the calculation of minor version is shown below.
|
|
|
|
* The logical product of the value of 1octet and 0x0f is performed.
|
|
|
|
*/
|
|
|
|
version = tvb_get_guint8(tvb,offset);
|
|
|
|
major_version = (version & FRONT_FOUR_BIT) >> VERSION_BIT_SHIFT;
|
|
|
|
minor_version = version & SECOND_FOUR_BIT;
|
|
|
|
proto_tree_add_text(kink_tree, tvb, offset, 1, "version: %u.%u", major_version, minor_version);
|
|
|
|
offset++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(kink_tree, hf_kink_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
doi = tvb_get_ntohl(tvb, offset);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
if(doi == IPSEC){
|
|
|
|
proto_tree_add_text(kink_tree, tvb, offset, 4, "Domain Of Interpretation: %s (%u)", "IPsec", doi);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
proto_tree_add_text(kink_tree, tvb, offset, 4, "Domain Of Interpretation: %s (%u)", "Not IPsec", doi);
|
|
|
|
}
|
|
|
|
offset += 4;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(kink_tree, hf_kink_transactionId, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 4;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
chsumlen = tvb_get_guint8(tvb, offset);
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(kink_tree, hf_kink_checkSumLength, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(kink_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* A is 1bit field. The caluculation of A is shown below.
|
|
|
|
* The logical product of 1octet value and 0x80 is performed.
|
|
|
|
* And It is performed 7bit right shift.
|
|
|
|
*/
|
|
|
|
value_a_and_front_reserved = tvb_get_guint8(tvb, offset);
|
|
|
|
value_a = (value_a_and_front_reserved & FRONT_ONE_BIT) >> A_BIT_SHIFT;
|
|
|
|
proto_tree_add_uint(kink_tree, hf_kink_A, tvb, offset, 1, value_a);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
|
|
|
/* The reserved field is 15bit.
|
2005-03-08 22:32:43 +00:00
|
|
|
* The logical product of 2octet value and 0x7fff is performed.
|
|
|
|
*/
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(kink_tree, hf_kink_reserved15, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(kink_tree, hf_kink_checkSum, tvb, offset, chsumlen, ENC_NA);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
|
|
|
/* This part consider the padding. Chsumlen don't contain the padding. */
|
2005-03-08 22:32:43 +00:00
|
|
|
if((chsumlen % PADDING) != 0){
|
|
|
|
chsumlen += (PADDING - (chsumlen % PADDING));
|
|
|
|
offset += chsumlen;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
offset += chsumlen;
|
|
|
|
}
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
control_payload(pinfo, tvb, offset, next_payload, kink_tree);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
2011-02-07 18:49:29 +00:00
|
|
|
/* This part call the dissect payload function by next_payload value.
|
2005-03-08 22:32:43 +00:00
|
|
|
* This function called by the respective function again.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
control_payload(packet_info *pinfo, tvbuff_t *tvb, int offset, guint8 next_payload, proto_tree *kink_tree){
|
|
|
|
switch(next_payload){
|
|
|
|
case KINK_DONE:
|
|
|
|
break;
|
2011-02-07 18:49:29 +00:00
|
|
|
case KINK_AP_REQ:
|
2005-03-08 22:32:43 +00:00
|
|
|
dissect_payload_kink_ap_req(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
case KINK_AP_REP:
|
|
|
|
dissect_payload_kink_ap_rep(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
case KINK_KRB_ERROR:
|
|
|
|
dissect_payload_kink_krb_error(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
case KINK_TGT_REQ:
|
|
|
|
dissect_payload_kink_tgt_req(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
case KINK_TGT_REP:
|
|
|
|
dissect_payload_kink_tgt_rep(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
case KINK_ISAKMP:
|
|
|
|
dissect_payload_kink_isakmp(pinfo, tvb, offset, kink_tree);
|
2011-02-07 18:49:29 +00:00
|
|
|
break;
|
|
|
|
case KINK_ENCRYPT:
|
2005-03-08 22:32:43 +00:00
|
|
|
dissect_payload_kink_encrypt(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
case KINK_ERROR:
|
|
|
|
dissect_payload_kink_error(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
dissect_payload_kink_not_defined(pinfo, tvb, offset, kink_tree);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_ap_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_ap_req_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint payload_length;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint16 krb_ap_req_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep beginning of payload offset */
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
start_payload_offset = offset;
|
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
|
|
|
|
|
|
|
/* Make the subtree. */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length, "KINK_AP_REQ");
|
|
|
|
payload_kink_ap_req_tree = proto_item_add_subtree(ti, ett_payload_kink_ap_req);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_ap_req_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_ap_req_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
ti = proto_tree_add_uint(payload_kink_ap_req_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length <= PAYLOAD_HEADER){
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_kink_payload_length_small);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
2009-12-11 08:45:45 +00:00
|
|
|
/* Show time as UTC, not local time. */
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_ap_req_tree, hf_kink_epoch, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 4;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length > PAYLOAD_HEADER){
|
|
|
|
tvbuff_t *krb_tvb;
|
|
|
|
|
|
|
|
krb_ap_req_length = payload_length - PAYLOAD_HEADER;
|
|
|
|
krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_req_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):krb_ap_req_length, krb_ap_req_length);
|
2005-05-27 08:53:07 +00:00
|
|
|
keytype=kerberos_output_keytype();
|
2005-03-08 22:32:43 +00:00
|
|
|
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_ap_req_tree, FALSE, NULL);
|
|
|
|
offset += krb_ap_req_length;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This part consider padding the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING != 0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_ap_rep_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint payload_length;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint16 krb_ap_rep_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep beginning of payload offset */
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_AP_REP");
|
|
|
|
payload_kink_ap_rep_tree = proto_item_add_subtree(ti, ett_payload_kink_ap_rep);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_ap_rep_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_ap_rep_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
ti = proto_tree_add_uint(payload_kink_ap_rep_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length <= PAYLOAD_HEADER){
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_kink_payload_length_small);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
2009-12-11 08:45:45 +00:00
|
|
|
/* Show time as UTC, not local time. */
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_ap_rep_tree, hf_kink_epoch, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if(payload_length > PAYLOAD_HEADER){
|
|
|
|
tvbuff_t *krb_tvb;
|
|
|
|
|
|
|
|
krb_ap_rep_length = payload_length - PAYLOAD_HEADER;
|
|
|
|
krb_tvb=tvb_new_subset(tvb, offset, (krb_ap_rep_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):krb_ap_rep_length, krb_ap_rep_length);
|
2005-05-27 08:53:07 +00:00
|
|
|
keytype=kerberos_output_keytype();
|
2005-03-08 22:32:43 +00:00
|
|
|
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_ap_rep_tree, FALSE, NULL);
|
|
|
|
|
|
|
|
offset += krb_ap_rep_length;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING != 0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_krb_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_krb_error_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint payload_length;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint16 krb_error_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_KRB_ERROR");
|
|
|
|
payload_kink_krb_error_tree = proto_item_add_subtree(ti, ett_payload_kink_krb_error);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_krb_error_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_krb_error_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
ti = proto_tree_add_uint(payload_kink_krb_error_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length <= KINK_KRB_ERROR_HEADER){
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_kink_payload_length_small);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
2013-02-27 03:35:04 +00:00
|
|
|
else {
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(payload_length > KINK_KRB_ERROR_HEADER){
|
|
|
|
tvbuff_t *krb_tvb;
|
|
|
|
|
|
|
|
krb_error_length = payload_length - KINK_KRB_ERROR_HEADER;
|
|
|
|
krb_tvb=tvb_new_subset(tvb, offset, (krb_error_length>tvb_length_remaining(tvb, offset))?tvb_length_remaining(tvb, offset):krb_error_length, krb_error_length);
|
|
|
|
|
|
|
|
dissect_kerberos_main(krb_tvb, pinfo, payload_kink_krb_error_tree, FALSE, NULL);
|
|
|
|
offset += krb_error_length;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING != 0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_tgt_req(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_tgt_req_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint payload_length;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint16 realm_name_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
|
|
|
realm_name_length = tvb_get_ntohs(tvb, offset + TO_REALM_NAME_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_TGT_REQ");
|
|
|
|
payload_kink_tgt_req_tree = proto_item_add_subtree(ti, ett_payload_kink_tgt_req);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_tgt_req_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_tgt_req_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_tgt_req_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_tgt_req_tree, hf_kink_realm_name_length, tvb, offset, 2, realm_name_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_tgt_req_tree, hf_kink_realm_name, tvb, offset, realm_name_length, ENC_NA|ENC_ASCII);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING != 0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_tgt_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_tgt_rep_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint payload_length;
|
|
|
|
guint princ_name_length;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint16 tgt_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_TGT_REP");
|
|
|
|
payload_kink_tgt_rep_tree = proto_item_add_subtree(ti, ett_payload_kink_tgt_rep);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_tgt_rep_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_tgt_rep_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_tgt_rep_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
princ_name_length = tvb_get_ntohs(tvb, offset);
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_tgt_rep_tree, hf_kink_princ_name_length, tvb, offset, 2, princ_name_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_tgt_rep_tree, hf_kink_princ_name, tvb, offset, princ_name_length, ENC_NA|ENC_ASCII);
|
2005-03-08 22:32:43 +00:00
|
|
|
|
2011-02-07 18:49:29 +00:00
|
|
|
/* This part consider the padding. Princ_name_length don't contain the padding. */
|
2005-03-08 22:32:43 +00:00
|
|
|
if((princ_name_length + FRONT_TGT_REP_HEADER) % PADDING != 0){
|
|
|
|
offset += (princ_name_length + PADDING - ((princ_name_length + FRONT_TGT_REP_HEADER) % PADDING));
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
offset += princ_name_length;
|
|
|
|
}
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
tgt_length = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_tgt_rep_tree, hf_kink_tgt_length, tvb, offset, 2, tgt_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_tgt_rep_tree, hf_kink_tgt, tvb, offset, tgt_length, ENC_NA|ENC_ASCII);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += tgt_length;
|
|
|
|
|
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING!=0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_isakmp_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-05-27 08:53:07 +00:00
|
|
|
guint payload_length,isakmp_length;
|
2005-06-16 06:27:18 +00:00
|
|
|
int length, reported_length;
|
2005-03-08 22:32:43 +00:00
|
|
|
guint8 inner_next_pload;
|
|
|
|
guint8 qm, qmmaj, qmmin;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2005-05-27 08:53:07 +00:00
|
|
|
tvbuff_t *isakmp_tvb;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
|
|
|
/* Make the subtree. */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_ISAKMP");
|
|
|
|
payload_kink_isakmp_tree = proto_item_add_subtree(ti, ett_payload_kink_isakmp);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_isakmp_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_isakmp_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
ti = proto_tree_add_uint(payload_kink_isakmp_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length <= PAYLOAD_HEADER){
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_kink_payload_length_small);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
inner_next_pload = tvb_get_guint8(tvb, offset);
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_isakmp_tree, hf_kink_inner_next_pload, tvb, offset, 1, inner_next_pload);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* The qmmaj is first half 4bit field of the octet. Therefore, the logical product
|
|
|
|
* of the 1octet value and 0xf0 is performed, and performed 4bit right shift.
|
|
|
|
* The qmmin is second half 4bit field of the octet. Therefore, the logical product
|
|
|
|
* of the 1octet value and 0x0f is performed.
|
|
|
|
*/
|
|
|
|
qm = tvb_get_guint8(tvb,offset);
|
|
|
|
qmmaj = (qm & FRONT_FOUR_BIT) >> VERSION_BIT_SHIFT;
|
|
|
|
qmmin = qm & SECOND_FOUR_BIT;
|
|
|
|
|
|
|
|
proto_tree_add_text(payload_kink_isakmp_tree, tvb, offset, 1, "QMVersion: %u.%u", qmmaj, qmmin);
|
|
|
|
offset += 1;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_isakmp_tree, hf_kink_reserved16, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length > PAYLOAD_HEADER){
|
2005-06-16 06:27:18 +00:00
|
|
|
isakmp_length = payload_length - PAYLOAD_HEADER;
|
|
|
|
length = tvb_length_remaining(tvb, offset);
|
|
|
|
if (length > (int)isakmp_length)
|
|
|
|
length = isakmp_length;
|
|
|
|
reported_length = tvb_reported_length_remaining(tvb, offset);
|
|
|
|
if (reported_length > (int)isakmp_length)
|
|
|
|
reported_length = isakmp_length;
|
|
|
|
isakmp_tvb = tvb_new_subset(tvb, offset, length, reported_length);
|
2005-06-16 06:19:03 +00:00
|
|
|
isakmp_dissect_payloads(isakmp_tvb, payload_kink_isakmp_tree, 1, inner_next_pload, 0, isakmp_length, pinfo);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING != 0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_encrypt_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2009-07-28 13:01:41 +00:00
|
|
|
guint payload_length;
|
2011-11-12 12:37:38 +00:00
|
|
|
#ifdef HAVE_KERBEROS
|
2009-07-28 13:01:41 +00:00
|
|
|
gint encrypt_length;
|
2011-11-12 12:37:38 +00:00
|
|
|
#endif
|
2005-03-08 22:32:43 +00:00
|
|
|
guint8 inner_next_pload;
|
|
|
|
guint16 inner_payload_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2005-05-27 08:53:07 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
payload_length = tvb_get_ntohs(tvb,offset + TO_PAYLOAD_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
2011-11-12 12:37:38 +00:00
|
|
|
#ifdef HAVE_KERBEROS
|
2005-05-27 08:53:07 +00:00
|
|
|
encrypt_length = payload_length - FROM_NP_TO_PL;
|
2011-11-12 12:37:38 +00:00
|
|
|
#endif
|
2005-03-08 22:32:43 +00:00
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_ENCRYPT");
|
|
|
|
payload_kink_encrypt_tree = proto_item_add_subtree(ti, ett_payload_kink_encrypt);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_encrypt_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_encrypt_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
ti = proto_tree_add_uint(payload_kink_encrypt_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length <= PAYLOAD_HEADER){
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_kink_payload_length_small);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
2005-05-27 08:53:07 +00:00
|
|
|
/* decrypt kink encrypt */
|
|
|
|
|
|
|
|
if(keytype != 0){
|
2005-05-27 21:39:38 +00:00
|
|
|
#ifdef HAVE_KERBEROS
|
2009-07-28 13:01:41 +00:00
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
guint8 *plaintext=NULL;
|
|
|
|
|
|
|
|
next_tvb=tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset), encrypt_length), encrypt_length);
|
2011-02-07 18:49:29 +00:00
|
|
|
plaintext=decrypt_krb5_data(tree, pinfo, 0, next_tvb, keytype, NULL);
|
2005-05-27 08:53:07 +00:00
|
|
|
if(plaintext){
|
2009-05-13 19:46:11 +00:00
|
|
|
next_tvb=tvb_new_child_real_data(tvb, plaintext, encrypt_length, encrypt_length);
|
2009-10-06 19:15:58 +00:00
|
|
|
tvb_set_free_cb(next_tvb, g_free);
|
2005-05-27 08:53:07 +00:00
|
|
|
add_new_data_source(pinfo, next_tvb, "decrypted kink encrypt");
|
|
|
|
dissect_decrypt_kink_encrypt(pinfo, next_tvb, tree, encrypt_length);
|
|
|
|
}
|
2005-05-27 21:39:38 +00:00
|
|
|
#endif
|
2005-05-27 08:53:07 +00:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
inner_next_pload = tvb_get_guint8(tvb, offset);
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_encrypt_tree, hf_kink_inner_next_pload, tvb, offset, 1, inner_next_pload);
|
2005-05-27 08:53:07 +00:00
|
|
|
offset += 1;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_encrypt_tree, hf_kink_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
|
2005-05-27 08:53:07 +00:00
|
|
|
offset += 3;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-05-27 08:53:07 +00:00
|
|
|
if(payload_length > PAYLOAD_HEADER){
|
|
|
|
inner_payload_length = payload_length - PAYLOAD_HEADER;
|
|
|
|
proto_tree_add_text(payload_kink_encrypt_tree, tvb, offset, inner_payload_length, "Payload");
|
|
|
|
offset += inner_payload_length;
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING !=0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-24 21:17:08 +00:00
|
|
|
|
|
|
|
if(payload_length > 0) {
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
2007-03-22 15:19:49 +00:00
|
|
|
#ifdef HAVE_KERBEROS
|
2005-05-27 08:53:07 +00:00
|
|
|
static void
|
|
|
|
dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length){
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-05-27 08:53:07 +00:00
|
|
|
proto_tree *decrypt_kink_encrypt_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
int offset=0;
|
|
|
|
guint8 next_payload;
|
|
|
|
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length, "decrypted data");
|
|
|
|
decrypt_kink_encrypt_tree = proto_item_add_subtree(ti, ett_decrypt_kink_encrypt);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
|
|
|
|
proto_tree_add_uint(decrypt_kink_encrypt_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(decrypt_kink_encrypt_tree, hf_kink_reserved24, tvb, offset, 3, ENC_BIG_ENDIAN);
|
2005-05-27 08:53:07 +00:00
|
|
|
offset += 3;
|
|
|
|
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, decrypt_kink_encrypt_tree);
|
|
|
|
}
|
2007-03-22 15:19:49 +00:00
|
|
|
#endif
|
2005-05-27 08:53:07 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
static void
|
|
|
|
dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_error_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
|
|
|
guint16 payload_length;
|
|
|
|
guint32 error_code;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2005-07-30 16:34:38 +00:00
|
|
|
const char *char_error_code[] = {
|
2005-03-08 22:32:43 +00:00
|
|
|
"KINK_OK",
|
|
|
|
"KINK_PROTOERR",
|
|
|
|
"KINK_INVDOI",
|
|
|
|
"KINK_INVMAJ",
|
|
|
|
"KINK_INVMIN",
|
|
|
|
"KINK_INTERR",
|
|
|
|
"KINK_BADQMVERS"
|
|
|
|
};
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
payload_length = tvb_get_ntohs(tvb,offset + TO_PAYLOAD_LENGTH);
|
|
|
|
start_payload_offset = offset;
|
|
|
|
|
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length,"KINK_ERROR");
|
|
|
|
payload_kink_error_tree = proto_item_add_subtree(ti, ett_payload_kink_error);
|
|
|
|
|
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_error_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_error_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
ti = proto_tree_add_uint(payload_kink_error_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
if(payload_length != KINK_ERROR_LENGTH){
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_kink_payload_length_mismatch);
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
error_code = tvb_get_ntohl(tvb, offset);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* Choosed the error code by erro_code */
|
|
|
|
switch(error_code){
|
|
|
|
case KINK_OK:
|
|
|
|
case KINK_PROTOERR:
|
|
|
|
case KINK_INVDOI:
|
|
|
|
case KINK_INVMAJ:
|
|
|
|
case KINK_INVMIN:
|
|
|
|
case KINK_INTERR:
|
|
|
|
case KINK_BADQMVERS:
|
|
|
|
proto_tree_add_text(payload_kink_error_tree, tvb, offset, 4, "ErrorCode: %s (%u)", char_error_code[error_code], error_code);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if(BOTTOM_RESERVED <= error_code && TOP_RESERVED >= error_code){
|
|
|
|
proto_tree_add_text(payload_kink_error_tree, tvb, offset, 4, "ErrorCode: %s (%u)", "RESERVED", error_code);
|
|
|
|
}
|
|
|
|
else if(BOTTOM_PRIVATE_USE <= error_code && TOP_PRIVATE_USE >= error_code){
|
|
|
|
proto_tree_add_text(payload_kink_error_tree, tvb, offset, 4, "ErrorCode: %s (%u)", "PRIVATE USE", error_code);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
proto_tree_add_text(payload_kink_error_tree, tvb, offset, 4, "ErrorCode: %s (%u)", "This Error Code is not Defined.", error_code);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
offset = start_payload_offset + KINK_ERROR_LENGTH;
|
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree); /* Recur control_payload() */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){
|
|
|
|
proto_tree *payload_kink_not_defined_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 next_payload;
|
2005-03-18 00:23:16 +00:00
|
|
|
guint payload_length;
|
2013-02-26 04:42:26 +00:00
|
|
|
int start_payload_offset = 0; /* Keep the beginning of the payload offset */
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
start_payload_offset = offset;
|
|
|
|
payload_length = tvb_get_ntohs(tvb, offset + TO_PAYLOAD_LENGTH);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* Make the subtree */
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, payload_length, "UNKNOWN PAYLOAD");
|
|
|
|
payload_kink_not_defined_tree = proto_item_add_subtree(ti, ett_payload_not_defined);
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
next_payload = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(payload_kink_not_defined_tree, hf_kink_next_payload, tvb, offset, 1, next_payload);
|
|
|
|
offset ++;
|
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_item(payload_kink_not_defined_tree, hf_kink_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset ++;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-02-27 03:35:04 +00:00
|
|
|
proto_tree_add_uint(payload_kink_not_defined_tree, hf_kink_payload_length, tvb, offset, 2, payload_length);
|
2005-03-08 22:32:43 +00:00
|
|
|
offset += 2;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
/* This part consider the padding. Payload_length don't contain the padding. */
|
|
|
|
if(payload_length % PADDING != 0){
|
|
|
|
payload_length += (PADDING - (payload_length % PADDING));
|
|
|
|
}
|
|
|
|
offset = start_payload_offset + payload_length;
|
2005-03-21 20:01:35 +00:00
|
|
|
|
|
|
|
/* XXX - prevent an endless loop if payload_length is 0, don't know the correct way to handle this! */
|
2005-03-24 21:17:08 +00:00
|
|
|
if(payload_length > 0) {
|
2005-03-21 20:01:35 +00:00
|
|
|
control_payload(pinfo, tvb, offset, next_payload, tree);
|
|
|
|
}
|
2005-03-08 22:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Output part */
|
2011-02-07 18:49:29 +00:00
|
|
|
void
|
2005-03-08 22:32:43 +00:00
|
|
|
proto_register_kink(void) {
|
|
|
|
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_kink_type,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Type", "kink.type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(kink_type_vals), 0x0,
|
|
|
|
"the type of the kink", HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
{ &hf_kink_length,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Length", "kink.length",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"the length of the kink length", HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
{ &hf_kink_transactionId,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Transaction ID", "kink.transactionId",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"the transactionID of kink", HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
{ &hf_kink_checkSumLength,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Checksum Length", "kink.checkSumLength",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"the check sum length of kink", HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
{ &hf_kink_A,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "A", "kink.A",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(kink_A_vals), 0x0,
|
|
|
|
"the A of kink", HFILL }},
|
2013-02-27 03:35:04 +00:00
|
|
|
{ &hf_kink_reserved8,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Reserved", "kink.reserved",
|
2013-02-27 03:35:04 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"the reserved of kink", HFILL }},
|
|
|
|
{ &hf_kink_reserved15,
|
|
|
|
{ "Reserved", "kink.reserved",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, SECOND_FIFTEEN_BIT,
|
|
|
|
"the reserved of kink", HFILL }},
|
|
|
|
{ &hf_kink_reserved16,
|
|
|
|
{ "Reserved", "kink.reserved",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
"the reserved of kink", HFILL }},
|
|
|
|
{ &hf_kink_reserved24,
|
|
|
|
{ "Reserved", "kink.reserved",
|
|
|
|
FT_UINT24, BASE_DEC, NULL, 0,
|
2011-02-07 18:49:29 +00:00
|
|
|
"the reserved of kink", HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
{ &hf_kink_checkSum,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Checksum", "kink.checkSum",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
"the checkSum of kink", HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
{ &hf_kink_next_payload,
|
2011-02-07 18:49:29 +00:00
|
|
|
{ "Next Payload", "kink.nextPayload",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(kink_next_payload), 0x0,
|
2013-02-27 03:35:04 +00:00
|
|
|
"the next payload of kink", HFILL }},
|
|
|
|
{ &hf_kink_payload_length,
|
|
|
|
{ "Payload Length", "kink.payloadLength",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_epoch,
|
|
|
|
{ "EPOCH", "kink.epoch",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_inner_next_pload,
|
|
|
|
{ "InnerNextPload", "kink.innerNextPload",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_realm_name_length,
|
|
|
|
{ "RealmNameLength", "kink.realmNameLength",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_realm_name,
|
|
|
|
{ "RealmName", "kink.realmName",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_princ_name_length,
|
|
|
|
{ "PrincNameLength", "kink.princNameLength",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_princ_name,
|
|
|
|
{ "PrincName", "kink.princName",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_tgt_length,
|
|
|
|
{ "TGT Length", "kink.tgtLength",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_kink_tgt,
|
|
|
|
{ "TGT", "kink.tgt",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2005-03-08 22:32:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Argument for making the subtree. */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_kink,
|
|
|
|
/* &ett_kink_version, */
|
|
|
|
&ett_kink_payload,
|
|
|
|
&ett_payload_kink_ap_req,
|
|
|
|
&ett_payload_kink_ap_rep,
|
|
|
|
&ett_payload_kink_krb_error,
|
|
|
|
&ett_payload_kink_tgt_req,
|
|
|
|
&ett_payload_kink_tgt_rep,
|
|
|
|
&ett_payload_kink_isakmp,
|
|
|
|
&ett_payload_kink_encrypt,
|
|
|
|
&ett_payload_kink_error,
|
|
|
|
&ett_payload_not_defined,
|
2005-05-27 08:53:07 +00:00
|
|
|
&ett_decrypt_kink_encrypt,
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
};
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2013-05-26 03:29:07 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_kink_payload_length_small, { "kink.payload_length_small", PI_PROTOCOL, PI_WARN, "This Payload Length is too small", EXPFILL }},
|
|
|
|
{ &ei_kink_payload_length_mismatch, { "kink.payload_length_mismatch", PI_PROTOCOL, PI_WARN, "This Payload Length is mismatch", EXPFILL }},
|
|
|
|
};
|
|
|
|
|
|
|
|
expert_module_t* expert_kink;
|
|
|
|
|
2005-03-18 00:23:16 +00:00
|
|
|
proto_kink = proto_register_protocol("Kerberized Internet Negotiation of Key", "KINK", "kink");
|
2005-03-08 22:32:43 +00:00
|
|
|
proto_register_field_array(proto_kink, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_kink = expert_register_protocol(proto_kink);
|
|
|
|
expert_register_field_array(expert_kink, ei, array_length(ei));
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void proto_reg_handoff_kink(void) {
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
dissector_handle_t kink_handle = NULL;
|
2011-02-07 18:49:29 +00:00
|
|
|
|
2005-03-08 22:32:43 +00:00
|
|
|
kink_handle = create_dissector_handle(dissect_kink, proto_kink);
|
|
|
|
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("udp.port", KINK_PORT, kink_handle);
|
2005-03-08 22:32:43 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|